pax_global_header00006660000000000000000000000064141470100110014477gustar00rootroot0000000000000052 comment=c7ca5ad91253c948e2df67b0c7b2f7e2cc577de0 ksnip-1.9.2/000077500000000000000000000000001414701001100126345ustar00rootroot00000000000000ksnip-1.9.2/.editorconfig000066400000000000000000000002431414701001100153100ustar00rootroot00000000000000root = true [*] charset = utf-8 end_of_line = lf trim_trailing_whitespace = true [CMakeLists.txt] indent_style = tab indent_size = 1 insert_final_newline = true ksnip-1.9.2/.github/000077500000000000000000000000001414701001100141745ustar00rootroot00000000000000ksnip-1.9.2/.github/FUNDING.yml000066400000000000000000000001451414701001100160110ustar00rootroot00000000000000# These are supported funding model platforms github: [DamirPorobic] custom: paypal.me/damirporobic ksnip-1.9.2/.github/ISSUE_TEMPLATE/000077500000000000000000000000001414701001100163575ustar00rootroot00000000000000ksnip-1.9.2/.github/ISSUE_TEMPLATE/bug_report.md000066400000000000000000000014151414701001100210520ustar00rootroot00000000000000--- name: Bug report about: Create a report to help us improve title: '' labels: bug assignees: '' --- **Describe the bug** A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error **Expected behavior** A clear and concise description of what you expected to happen. **Screenshots** If applicable, add screenshots to help explain your problem. **Desktop (please complete the following information):** - OS: [e.g. Linux] - Distribution in case of Linux [e.g. Ubuntu] - Window System in case of Linux [e.g. X11] - ksnip version [e.g. 1.8.0] - How did you install ksnip [e.g. AppImage] **Additional context** Add any other context about the problem here. ksnip-1.9.2/.github/ISSUE_TEMPLATE/feature_request.md000066400000000000000000000007271414701001100221120ustar00rootroot00000000000000--- name: Feature request about: Suggest an idea for this project title: '' labels: feature_request assignees: '' --- **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] **Describe the solution you'd like** A clear and concise description of what you want to happen. **Additional context** Add any other context or screenshots about the feature request here. ksnip-1.9.2/.github/scripts/000077500000000000000000000000001414701001100156635ustar00rootroot00000000000000ksnip-1.9.2/.github/scripts/build_ksnip.sh000066400000000000000000000003741414701001100205260ustar00rootroot00000000000000#!/bin/bash mkdir build && cd build cmake .. -G"${CMAKE_GENERATOR}" -DBUILD_TESTS=${BUILD_TESTS} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DVERSION_SUFIX=${VERSION_SUFFIX} -DBUILD_NUMBER=${BUILD_NUMBER} -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} ${MAKE_BINARY}ksnip-1.9.2/.github/scripts/linux/000077500000000000000000000000001414701001100170225ustar00rootroot00000000000000ksnip-1.9.2/.github/scripts/linux/build_appImage.sh000066400000000000000000000017731414701001100222700ustar00rootroot00000000000000#!/bin/bash mkdir build && cd build echo "--> Build" cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=/usr -DVERSION_SUFIX=${VERSION_SUFFIX} -DBUILD_NUMBER=${BUILD_NUMBER} -DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} make DESTDIR=appdir -j$(nproc) install ; find appdir/ echo "--> Copy SSL libs to appDir" mkdir -p appdir/usr/lib/ cp /lib/x86_64-linux-gnu/libssl.so.1.0.0 appdir/usr/lib/ echo "--> Copy kImageAnnotator translations to appDir" mkdir -p appdir/usr/share/kImageAnnotator/ cp -r ${INSTALL_PREFIX}/share/kImageAnnotator/translations appdir/usr/share/kImageAnnotator/ echo "--> Package appImage" unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH ../linuxdeployqt-continuous-x86_64.AppImage appdir/usr/share/applications/*.desktop -bundle-non-qt-libs ../linuxdeployqt-continuous-x86_64.AppImage appdir/usr/share/applications/*.desktop -appimage -extra-plugins=iconengines,imageformats echo "--> Whats in here" ls echo "--> Move" mv ksnip*.AppImage* ${GITHUB_WORKSPACE}/ echo "--> Done" ksnip-1.9.2/.github/scripts/linux/deb/000077500000000000000000000000001414701001100175545ustar00rootroot00000000000000ksnip-1.9.2/.github/scripts/linux/deb/build_deb.sh000066400000000000000000000002101414701001100220120ustar00rootroot00000000000000#!/bin/bash cd ksnip-${VERSION_NUMBER} dpkg-buildpackage -us -uc -i -b mv ${WORKSPACE}/ksnip_*.deb ${WORKSPACE}/ksnip-${VERSION}.deb ksnip-1.9.2/.github/scripts/linux/deb/debian/000077500000000000000000000000001414701001100207765ustar00rootroot00000000000000ksnip-1.9.2/.github/scripts/linux/deb/debian/compat000066400000000000000000000000031414701001100221750ustar00rootroot0000000000000012 ksnip-1.9.2/.github/scripts/linux/deb/debian/control000066400000000000000000000006421414701001100224030ustar00rootroot00000000000000Source: ksnip Section: utils Priority: optional Maintainer: Damir Porobic Build-Depends: debhelper (>=9), cmake (>=3.5) Standards-Version: 4.1.1 Homepage: http://ksnip.org Package: ksnip Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Conflicts: libkimageannotator-common Description: Screenshot Tool Screenshot tool that provides many annotation features for your screenshots. ksnip-1.9.2/.github/scripts/linux/deb/debian/copyright000066400000000000000000000017741414701001100227420ustar00rootroot00000000000000Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: ksnip Source: https://github.com/ksnip/ksnip/blob/master/LICENSE Files: * Copyright: Copyright 2021 ksnip License: GPL-2+ License: GPL-2+ This package 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 2 of the License, or (at your option) any later version. . This package 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 . On Debian systems, the complete text of the GNU General Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". ksnip-1.9.2/.github/scripts/linux/deb/debian/rules000077500000000000000000000020761414701001100220630ustar00rootroot00000000000000#!/usr/bin/make -f # See debhelper(7) (uncomment to enable) # output every command that modifies files on the build system. export DH_VERBOSE = 1 # see FEATURE AREAS in dpkg-buildflags(1) #export DEB_BUILD_MAINT_OPTIONS = hardening=+all # see ENVIRONMENT in dpkg-buildflags(1) # package maintainers to append CFLAGS #export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic # package maintainers to append LDFLAGS #export DEB_LDFLAGS_MAINT_APPEND = %: dh $@ #dh_make generated override targets # This is example for Cmake (See https://bugs.debian.org/641051 ) override_dh_auto_configure: dh_auto_configure -- -DVERSION_SUFIX=$(VERSION_SUFFIX) -DBUILD_NUMBER=$(BUILD_NUMBER) -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_PREFIX_PATH="$(Qt5_DIR);$(INSTALL_PREFIX)" -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) override_dh_shlibdeps: dh_shlibdeps -l"$(Qt5_DIR)/lib" --dpkg-shlibdeps-params=--ignore-missing-info # Manually install kimageannotator translation files override_dh_auto_install: dh_auto_install mkdir -p $(CURDIR)/debian/ksnip/usr/ cp -r $(INSTALL_PREFIX)/share $(CURDIR)/debian/ksnip/usr/ ksnip-1.9.2/.github/scripts/linux/deb/debian/source/000077500000000000000000000000001414701001100222765ustar00rootroot00000000000000ksnip-1.9.2/.github/scripts/linux/deb/debian/source/format000066400000000000000000000000151414701001100235050ustar00rootroot000000000000003.0 (native) ksnip-1.9.2/.github/scripts/linux/deb/setup_changelog_file.sh000066400000000000000000000014211414701001100242540ustar00rootroot00000000000000#!/bin/bash cp CHANGELOG.md changelog sed -i '1,2d' changelog #Remove header and empty line ad the beginning sed -i 's/\[\(.*[^]]*\)\].*/\1)/g' changelog # Replace links to issues with only number sed -i "s/^[[:blank:]]*$/\n -- Damir Porobic ${BUILD_TIME}\n/" changelog # After every release add time and author sed -i 's/## Release \([0-9]*\.[0-9]*\.[0-9]*\)/ksnip (\1) stable; urgency=medium\n/' changelog # Rename release headers sed -i 's/^\(\* .*\)/ \1/' changelog # Add two spaces before every entry printf "\n -- Damir Porobic ${BUILD_TIME}\n" >> changelog # Add time and author for the first release cp changelog ksnip-${VERSION_NUMBER}/debian/ echo "Changelog:" echo "---------------" cat changelog echo "---------------" ksnip-1.9.2/.github/scripts/linux/deb/setup_deb_directory_structure.sh000066400000000000000000000007051414701001100262700ustar00rootroot00000000000000#!/bin/bash echo "--> Create directory and copy everything we need to deliver" mkdir ksnip-${VERSION_NUMBER} cp -R CMakeLists.txt cmake/ desktop/ icons/ LICENSE.txt README.md src/ translations/ ksnip-${VERSION_NUMBER}/ echo "--> Package source content" tar -cvzf ksnip_${VERSION_NUMBER}.orig.tar.gz ksnip-${VERSION_NUMBER}/ echo "--> Copy source package to debian directory" cp -R ${WORKSPACE}/.github/scripts/linux/deb/debian ksnip-${VERSION_NUMBER}/ ksnip-1.9.2/.github/scripts/linux/rpm/000077500000000000000000000000001414701001100176205ustar00rootroot00000000000000ksnip-1.9.2/.github/scripts/linux/rpm/build_rpm.sh000066400000000000000000000003061414701001100221300ustar00rootroot00000000000000#!/bin/bash cd ksnip-${VERSION_NUMBER} rpmbuild -ba SPECS/ksnip-*.spec --define '_topdir %(pwd)' mv ${WORKSPACE}/ksnip-${VERSION_NUMBER}/RPMS/x86_64/ksnip-*.rpm ${WORKSPACE}/ksnip-${VERSION}.rpm ksnip-1.9.2/.github/scripts/linux/rpm/ksnip.spec000066400000000000000000000022111414701001100216140ustar00rootroot00000000000000%define packager Damir Porobic %define __spec_install_post %{nil} %define debug_package %{nil} %define __os_install_post %{_dbpath}/brp-compress %define _signature gpg %define _gpg_name Ksnip Name: ksnip Summary: Screenshot Tool Version: X.X.X Release: 1 Source0: %{name}-%{version}.tar.gz URL: https://github.com/ksnip/ksnip License: GPLV2+ Group: Application/Utility %description Screenshot tool that provides many annotation features for your screenshots. %prep %setup %build cmake . make %install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/usr/share/kImageAnnotator/ cp -a $INSTALL_PREFIX/share/kImageAnnotator/translations/. $RPM_BUILD_ROOT/usr/share/kImageAnnotator/translations %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %{_usr}/bin/%{name} %{_usr}/share/applications/org.%{name}.%{name}.desktop %{_usr}/share/icons/hicolor/scalable/apps/%{name}.svg %{_usr}/share/%{name}/translations/*.qm %{_usr}/share/kImageAnnotator/translations/*.qm %{_usr}/share/metainfo/org.%{name}.%{name}.appdata.xml %changelog ksnip-1.9.2/.github/scripts/linux/rpm/setup_rpm_directory_structure.sh000066400000000000000000000011471414701001100264010ustar00rootroot00000000000000#!/bin/bash echo "--> Create directory and everything we need to deliver" mkdir ksnip-${VERSION_NUMBER} cp -R CMakeLists.txt cmake/ desktop/ icons/ LICENSE.txt README.md src/ translations/ ksnip-${VERSION_NUMBER}/ echo "--> Package directory" tar -cvzf ksnip-${VERSION_NUMBER}.tar.gz ksnip-${VERSION_NUMBER}/ echo "--> Move package to SOURCE directory" mkdir ksnip-${VERSION_NUMBER}/SOURCES mv ksnip-${VERSION_NUMBER}.tar.gz ksnip-${VERSION_NUMBER}/SOURCES/ echo "--> Copy spec file to SPEC directory" mkdir ksnip-${VERSION_NUMBER}/SPECS cp ksnip.spec ksnip-${VERSION_NUMBER}/SPECS/ksnip-${VERSION_NUMBER}.spec ksnip-1.9.2/.github/scripts/linux/rpm/setup_spec_file.sh000066400000000000000000000015571414701001100233350ustar00rootroot00000000000000#!/bin/bash echo "--> Create copy of spec file" cp ${WORKSPACE}/.github/scripts/linux/rpm/ksnip.spec . echo "--> Update changelog entries" cp CHANGELOG.md changelog sed -i '1,2d' changelog #Remove header and empty line ad the beginning sed -i 's/* /-- /g' changelog # Replace asterisk with double dash sed -i 's/\[\(.*[^]]*\)\].*/\1)/g' changelog # Replace links to issues with only number sed -i "s/## Release \([0-9]*\.[0-9]*\.[0-9]*\)/* ${BUILD_DATE} Damir Porobic \1/" changelog # Format release headers cat changelog >> ksnip.spec echo "--> Update version" sed -i "s/Version: X.X.X/Version: ${VERSION_NUMBER}/" ksnip.spec sed -i "s;cmake .;cmake . -DVERSION_SUFIX=${VERSION_SUFFIX} -DBUILD_NUMBER=${BUILD_NUMBER} -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} -DCMAKE_BUILD_TYPE=${BUILD_TYPE};" ksnip.spec # ; is the delimiter ksnip-1.9.2/.github/scripts/linux/setup_linux_build_variables.sh000066400000000000000000000001511414701001100251410ustar00rootroot00000000000000#!/bin/bash echo "MAKE_BINARY=make" >> $GITHUB_ENV echo "CMAKE_GENERATOR=Unix Makefiles" >> $GITHUB_ENV ksnip-1.9.2/.github/scripts/macos/000077500000000000000000000000001414701001100167655ustar00rootroot00000000000000ksnip-1.9.2/.github/scripts/macos/add_osx_cert.sh000077500000000000000000000011651414701001100217650ustar00rootroot00000000000000#!/bin/bash KEY_CHAIN=build.keychain CERTIFICATE_P12=certificate.p12 # Recreate the certificate from the secure environment variable echo ${APPLE_CERT_P12} | base64 --decode > $CERTIFICATE_P12 # Create a keychain security create-keychain -p main $KEY_CHAIN # Make the keychain the default so identities are found security default-keychain -s $KEY_CHAIN # Unlock the keychain security unlock-keychain -p main $KEY_CHAIN security import $CERTIFICATE_P12 -k $KEY_CHAIN -P ${APPLE_CERT_P12_PASS} -T /usr/bin/codesign; security set-key-partition-list -S apple-tool:,apple: -s -k main $KEY_CHAIN # Remove cert file rm -fr *.p12ksnip-1.9.2/.github/scripts/macos/notarize_osx_dmg_package.sh000066400000000000000000000021061414701001100243460ustar00rootroot00000000000000#!/bin/bash echo "Starting Notarization process." response=$(xcrun altool -t osx -f ksnip-${VERSION}.dmg --primary-bundle-id org.ksnip.ksnip --notarize-app -u ${APPLE_DEV_USER} -p ${APPLE_DEV_PASS}) requestUUID=$(echo "${response}" | tr ' ' '\n' | tail -1) retryCounter=0 while true; do retryCounter=$((retryCounter + 1)) if [[ "${retryCounter}" -gt 5 ]]; then echo "Notarization timeout!" exit 1 fi echo "Notarization retry ${retryCounter}." echo "Checking notarization status." statusCheckResponse=$(xcrun altool --notarization-info ${requestUUID} -u ${APPLE_DEV_USER} -p ${APPLE_DEV_PASS}) isSuccess=$(echo "${statusCheckResponse}" | grep "success") isFailure=$(echo "${statusCheckResponse}" | grep "invalid") if [[ "${isSuccess}" != "" ]]; then echo "Notarization done!" xcrun stapler staple -v ksnip-${VERSION}.dmg echo "Stapler done!" exit 0 fi if [[ "${isFailure}" != "" ]]; then echo "Notarization failed!" exit 1 fi echo "Notarization not finished yet, sleep 2min then check again..." sleep 120 doneksnip-1.9.2/.github/scripts/macos/package_dmg.sh000077500000000000000000000004701414701001100215470ustar00rootroot00000000000000#!/bin/bash mv build/src/ksnip*.app ksnip.app cp build/translations/ksnip_*.qm ./ksnip.app/Contents/Resources/ cp kImageAnnotator/build/translations/kImageAnnotator_*.qm ./ksnip.app/Contents/Resources/ macdeployqt ksnip.app -dmg -sign-for-notarization="${APPLE_DEV_IDENTITY}" mv ksnip.dmg ksnip-${VERSION}.dmgksnip-1.9.2/.github/scripts/macos/setup_macos_build_variables.sh000066400000000000000000000001511414701001100250470ustar00rootroot00000000000000#!/bin/bash echo "MAKE_BINARY=make" >> $GITHUB_ENV echo "CMAKE_GENERATOR=Unix Makefiles" >> $GITHUB_ENV ksnip-1.9.2/.github/scripts/setup_build_variables.sh000066400000000000000000000033051414701001100225670ustar00rootroot00000000000000#!/bin/bash VERSION_REGEX="([0-9]{1,}\.)+[0-9]{1,}" BUILD_TIME=$(date +"%a, %d %b %Y %T %z") BUILD_DATE=$(date +"%a %b %d %Y") BUILD_NUMBER=$(git rev-list --count HEAD)-$(git rev-parse --short HEAD) VERSION_NUMBER=$(grep "project.*" CMakeLists.txt | egrep -o "${VERSION_REGEX}") WORKSPACE="$GITHUB_WORKSPACE" INSTALL_PREFIX="$WORKSPACE/tmp" echo "BUILD_TYPE=Release" >> $GITHUB_ENV echo "BUILD_TIME=$BUILD_TIME" >> $GITHUB_ENV echo "BUILD_DATE=$BUILD_DATE" >> $GITHUB_ENV echo "BUILD_NUMBER=$BUILD_NUMBER" >> $GITHUB_ENV echo "VERSION_REGEX=$VERSION_REGEX" >> $GITHUB_ENV echo "WORKSPACE=$WORKSPACE" >> $GITHUB_ENV echo "INSTALL_PREFIX=$INSTALL_PREFIX" >> $GITHUB_ENV echo "VERSION_NUMBER=$VERSION_NUMBER" >> $GITHUB_ENV echo "UPLOADTOOL_ISPRERELEASE=true" >> $GITHUB_ENV echo "BUILD_TESTS=OFF" >> $GITHUB_ENV if [[ "$GITHUB_REF" = refs/tags* ]]; then GITHUB_TAG=${GITHUB_REF#refs/tags/} echo "GitHub Tag is: $GITHUB_TAG" echo "GITHUB_TAG=$GITHUB_TAG" >> $GITHUB_ENV else echo "GitHub Ref is: $GITHUB_REF" fi if [[ -z "${GITHUB_TAG}" ]]; then echo "Build is not tagged this is a continuous build" VERSION_SUFFIX="continuous" echo "VERSION_SUFFIX=$VERSION_SUFFIX" >> $GITHUB_ENV echo "VERSION=${VERSION_NUMBER}-${VERSION_SUFFIX}" >> $GITHUB_ENV else echo "Build is tagged this is not a continues build" echo "Building ksnip version ${VERSION_NUMBER}" echo "VERSION=${VERSION_NUMBER}" >> $GITHUB_ENV fi # Message show on the release page ACTION_LINK_TEXT="GitHub Action build logs: https://github.com/ksnip/ksnip/actions" BUILD_TIME_TEXT="Build Time: $(date +"%a, %d %b %Y %T")" UPLOADTOOL_BODY="${ACTION_LINK_TEXT}\n${BUILD_TIME_TEXT}" echo "UPLOADTOOL_BODY=$UPLOADTOOL_BODY" >> $GITHUB_ENVksnip-1.9.2/.github/scripts/setup_kColorPicker.sh000066400000000000000000000012601414701001100220250ustar00rootroot00000000000000#!/bin/bash if [[ -z "${GITHUB_TAG}" ]]; then echo "Building ksnip with latest version of kColorPicker" git clone --depth 1 git://github.com/ksnip/kColorPicker else KCOLORPICKER_VERSION=$(grep "set.*KCOLORPICKER_MIN_VERSION" CMakeLists.txt | egrep -o "${VERSION_REGEX}") echo "Building ksnip with kColorPicker version ${KCOLORPICKER_VERSION}" git clone --depth 1 --branch "v${KCOLORPICKER_VERSION}" git://github.com/ksnip/kColorPicker fi cd kColorPicker || exit mkdir build && cd build || exit cmake .. -G"${CMAKE_GENERATOR}" -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" -DBUILD_EXAMPLE=OFF -DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" ${MAKE_BINARY} && ${MAKE_BINARY} installksnip-1.9.2/.github/scripts/setup_kImageAnnotator.sh000066400000000000000000000014201414701001100225170ustar00rootroot00000000000000#!/bin/bash if [[ -z "${GITHUB_TAG}" ]]; then echo "Building ksnip with latest version of kImageAnnotator" git clone --depth 1 git://github.com/ksnip/kImageAnnotator else KIMAGEANNOTATOR_VERSION=$(grep "set.*KIMAGEANNOTATOR_MIN_VERSION" CMakeLists.txt | egrep -o "${VERSION_REGEX}") echo "Building ksnip with kImageAnnotator version ${KIMAGEANNOTATOR_VERSION}" git clone --depth 1 --branch "v${KIMAGEANNOTATOR_VERSION}" git://github.com/ksnip/kImageAnnotator fi cd kImageAnnotator || exit mkdir build && cd build || exit cmake .. -G"${CMAKE_GENERATOR}" -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" -DBUILD_EXAMPLE=OFF -DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" -DCMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES="${INSTALL_PREFIX}/include" ${MAKE_BINARY} && ${MAKE_BINARY} installksnip-1.9.2/.github/scripts/windows/000077500000000000000000000000001414701001100173555ustar00rootroot00000000000000ksnip-1.9.2/.github/scripts/windows/msi/000077500000000000000000000000001414701001100201455ustar00rootroot00000000000000ksnip-1.9.2/.github/scripts/windows/msi/package_msi.sh000066400000000000000000000001771414701001100227510ustar00rootroot00000000000000#!/bin/bash cd build "C:\Program Files\CMake\bin\cpack.exe" --verbose mv ksnip*.msi ${GITHUB_WORKSPACE}/ksnip-${VERSION}.msi ksnip-1.9.2/.github/scripts/windows/msi/sign_msi_package.ps1000066400000000000000000000020251414701001100240540ustar00rootroot00000000000000$CERTIFICATE_PFX_ENCODED = $Env:MICROSOFT_CERT_PFX -replace "\\", "" $MICROSOFT_CERT_PFX_PASS = $Env:MICROSOFT_CERT_PFX_PASS -replace "\\", "" $CERTIFICATE_PFX = "certificate.pfx" $CERTIFICATE_PFX_DECODE = [system.convert]::frombase64string($CERTIFICATE_PFX_ENCODED) set-content -Path $CERTIFICATE_PFX -Value $CERTIFICATE_PFX_DECODE -Encoding Byte $MICROSOFT_CERT_PFX_PASS_SECURED = ConvertTo-SecureString -String $MICROSOFT_CERT_PFX_PASS -AsPlainText -Force Write-Host "Import Certificate" Import-PfxCertificate -FilePath $CERTIFICATE_PFX -CertStoreLocation Cert:\LocalMachine\My -Password $MICROSOFT_CERT_PFX_PASS_SECURED Write-Host "Sign package" $KSNIP_VERSION = $Env:VERSION $KSNIP_MSI = "ksnip-$KSNIP_VERSION.msi" $TIMESTAMP_SERVER = "http://timestamp.comodoca.com/authenticode" $SIGNTOOL = 'C:\Program Files (x86)\Windows Kits\10\bin\x64\signtool.exe' & SIGNTOOL sign /v /debug /sm /fd SHA256 /s My /n 'Damir Porobic' /d 'Ksnip - Screenshot Tool' /t $TIMESTAMP_SERVER $KSNIP_MSI rm $CERTIFICATE_PFX Write-Host "Finished signing"ksnip-1.9.2/.github/scripts/windows/package_exe.sh000066400000000000000000000007021414701001100221440ustar00rootroot00000000000000#!/bin/bash mkdir packageDir mv build/src/ksnip*.exe packageDir/ksnip.exe windeployqt.exe --no-opengl-sw --no-system-d3d-compiler --release packageDir/ksnip.exe cp build/translations/ksnip_*.qm ./packageDir/translations/ cp kImageAnnotator/build/translations/kImageAnnotator_*.qm ./packageDir/translations/ cp "${OPENSSL_DIR}"/*.dll ./packageDir/ cp "${COMPILE_RUNTIME_DIR}"/*.dll ./packageDir/ 7z a ksnip-${VERSION}-windows.zip ./packageDir/* ksnip-1.9.2/.github/scripts/windows/setup_windows_build_variables.sh000066400000000000000000000006221414701001100260320ustar00rootroot00000000000000#!/bin/bash echo "MAKE_BINARY=nmake" >> $GITHUB_ENV echo "CMAKE_GENERATOR=NMake Makefiles" >> $GITHUB_ENV echo "LIB=$LIB;$INSTALL_PREFIX/lib" >> $GITHUB_ENV echo "INCLUDE=$INCLUDE;$INSTALL_PREFIX/include" >> $GITHUB_ENV echo "OPENSSL_DIR=$WORKSPACE/OpenSSL" >> $GITHUB_ENV echo "COMPILE_RUNTIME_DIR=$WORKSPACE/CompileRuntime" >> $GITHUB_ENV echo "KIMAGEANNOTATOR_DIR=${INSTALL_PREFIX}" >> $GITHUB_ENVksnip-1.9.2/.github/workflows/000077500000000000000000000000001414701001100162315ustar00rootroot00000000000000ksnip-1.9.2/.github/workflows/linux.yml000066400000000000000000000123711414701001100201170ustar00rootroot00000000000000name: linux on: push: branches: [ master ] tags: - "v*" jobs: test-linux: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Set up build variables run: bash ./.github/scripts/setup_build_variables.sh - name: Set up windows build variables run: bash ./.github/scripts/linux/setup_linux_build_variables.sh - name: Install Qt uses: jurplel/install-qt-action@v2 with: version: '5.15.2' host: 'linux' install-deps: 'true' - name: Install dependencies run: sudo apt-get install extra-cmake-modules libxcb-xfixes0-dev xvfb - name: Set up kColorPicker run: bash ./.github/scripts/setup_kColorPicker.sh - name: Set up kImageAnnotator run: bash ./.github/scripts/setup_kImageAnnotator.sh - name: Build env: BUILD_TESTS: ON run: bash ./.github/scripts/build_ksnip.sh - name: Test working-directory: ${{github.workspace}}/build run: xvfb-run --auto-servernum --server-num=1 --server-args="-screen 0 1024x768x24" make test CTEST_OUTPUT_ON_FAILURE=1 package-appImage: runs-on: ubuntu-18.04 needs: test-linux steps: - name: Checkout uses: actions/checkout@v2 - name: Set up build variables run: bash ./.github/scripts/setup_build_variables.sh - name: Set up windows build variables run: bash ./.github/scripts/linux/setup_linux_build_variables.sh - name: Install Qt uses: jurplel/install-qt-action@v2 with: version: '5.15.2' host: 'linux' install-deps: 'true' - name: Install dependencies run: sudo apt-get install extra-cmake-modules libxcb-xfixes0-dev libssl-dev - name: Set up kColorPicker run: bash ./.github/scripts/setup_kColorPicker.sh - name: Set up kImageAnnotator run: bash ./.github/scripts/setup_kImageAnnotator.sh - name: Download deploy tool run: | wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" chmod a+x linuxdeployqt-continuous-x86_64.AppImage - name: Package AppImage working-directory: ${{github.workspace}} run: bash ./.github/scripts/linux/build_appImage.sh - name: Upload files env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh bash upload.sh ksnip*.AppImage* package-rpm: runs-on: ubuntu-latest needs: test-linux steps: - name: Checkout uses: actions/checkout@v2 - name: Set up build variables run: bash ./.github/scripts/setup_build_variables.sh - name: Set up windows build variables run: bash ./.github/scripts/linux/setup_linux_build_variables.sh - name: Install Qt uses: jurplel/install-qt-action@v2 with: version: '5.12.7' host: 'linux' install-deps: 'true' - name: Install dependencies run: sudo apt-get install extra-cmake-modules libxcb-xfixes0-dev libssl-dev rpm - name: Set up kColorPicker run: bash ./.github/scripts/setup_kColorPicker.sh - name: Set up kImageAnnotator run: bash ./.github/scripts/setup_kImageAnnotator.sh - name: Set up spec file run: bash ./.github/scripts/linux/rpm/setup_spec_file.sh - name: Set up directory structure run: bash ./.github/scripts/linux/rpm/setup_rpm_directory_structure.sh - name: Package rpm run: bash ./.github/scripts/linux/rpm/build_rpm.sh - name: Upload files env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh bash upload.sh ksnip-*.rpm package-deb: runs-on: ubuntu-latest needs: test-linux steps: - name: Checkout uses: actions/checkout@v2 - name: Set up build variables run: bash ./.github/scripts/setup_build_variables.sh - name: Set up windows build variables run: bash ./.github/scripts/linux/setup_linux_build_variables.sh - name: Install Qt uses: jurplel/install-qt-action@v2 with: version: '5.12.7' host: 'linux' install-deps: 'true' - name: Install dependencies run: sudo apt-get install cmake extra-cmake-modules libxcb-xfixes0-dev libssl-dev devscripts debhelper - name: Set up kColorPicker run: bash ./.github/scripts/setup_kColorPicker.sh - name: Set up kImageAnnotator run: bash ./.github/scripts/setup_kImageAnnotator.sh - name: Set up directory structure run: bash ./.github/scripts/linux/deb/setup_deb_directory_structure.sh - name: Set up changelog run: bash ./.github/scripts/linux/deb/setup_changelog_file.sh - name: Package deb run: bash ./.github/scripts/linux/deb/build_deb.sh - name: Upload files env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh bash upload.sh ksnip-*.deb ksnip-1.9.2/.github/workflows/macos.yml000066400000000000000000000050331414701001100200570ustar00rootroot00000000000000name: macOS on: push: branches: [ master ] tags: - "v*" jobs: test-macos: runs-on: macos-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Set up build variables run: bash ./.github/scripts/setup_build_variables.sh - name: Set up windows build variables run: bash ./.github/scripts/macos/setup_macos_build_variables.sh - name: Install Qt uses: jurplel/install-qt-action@v2 with: version: '5.15.2' host: 'mac' install-deps: 'true' - name: Set up kColorPicker run: bash ./.github/scripts/setup_kColorPicker.sh - name: Set up kImageAnnotator run: bash ./.github/scripts/setup_kImageAnnotator.sh - name: Build env: BUILD_TESTS: ON run: bash ./.github/scripts/build_ksnip.sh - name: Test working-directory: ${{github.workspace}}/build run: make test CTEST_OUTPUT_ON_FAILURE=1 package-dmg: runs-on: macos-latest needs: test-macos steps: - name: Checkout uses: actions/checkout@v2 - name: Set up build variables run: bash ./.github/scripts/setup_build_variables.sh - name: Set up windows build variables run: bash ./.github/scripts/macos/setup_macos_build_variables.sh - name: Install Qt uses: jurplel/install-qt-action@v2 with: version: '5.15.2' host: 'mac' install-deps: 'true' - name: Set up kColorPicker run: bash ./.github/scripts/setup_kColorPicker.sh - name: Set up kImageAnnotator run: bash ./.github/scripts/setup_kImageAnnotator.sh - name: Build run: bash ./.github/scripts/build_ksnip.sh - name: Add OSX certificate to key chain env: APPLE_CERT_P12: ${{ secrets.APPLE_CERT_P12 }} APPLE_CERT_P12_PASS: ${{ secrets.APPLE_CERT_P12_PASS }} run: bash ./.github/scripts/macos/add_osx_cert.sh - name: Package dmg env: APPLE_DEV_IDENTITY: ${{ secrets.APPLE_DEV_IDENTITY }} run: bash ./.github/scripts/macos/package_dmg.sh - name: Notarize dmg package env: APPLE_DEV_PASS: ${{ secrets.APPLE_DEV_PASS }} APPLE_DEV_USER: ${{ secrets.APPLE_DEV_USER }} run: bash ./.github/scripts/macos/notarize_osx_dmg_package.sh - name: Upload files env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh bash upload.sh ksnip-*.dmg ksnip-1.9.2/.github/workflows/windows.yml000066400000000000000000000110671414701001100204530ustar00rootroot00000000000000name: windows on: push: branches: [ master ] tags: - "v*" jobs: test-windows: runs-on: windows-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Set up build variables run: bash ./.github/scripts/setup_build_variables.sh - name: Set up windows build variables run: bash ./.github/scripts/windows/setup_windows_build_variables.sh - name: Install Qt uses: jurplel/install-qt-action@v2 with: version: '5.15.2' host: 'windows' install-deps: 'true' arch: 'win64_msvc2019_64' - name: Set up nmake uses: ilammy/msvc-dev-cmd@v1 - name: Set up kColorPicker run: bash ./.github/scripts/setup_kColorPicker.sh - name: Set up kImageAnnotator run: bash ./.github/scripts/setup_kImageAnnotator.sh - name: Build env: BUILD_TESTS: ON run: bash ./.github/scripts/build_ksnip.sh - name: Test working-directory: ${{github.workspace}}/build run: nmake test CTEST_OUTPUT_ON_FAILURE=1 package-exe: runs-on: windows-latest needs: test-windows steps: - name: Checkout uses: actions/checkout@v2 - name: Set up build variables run: bash ./.github/scripts/setup_build_variables.sh - name: Set up windows build variables run: bash ./.github/scripts/windows/setup_windows_build_variables.sh - name: Install Qt uses: jurplel/install-qt-action@v2 with: version: '5.15.2' host: 'windows' install-deps: 'true' arch: 'win64_msvc2019_64' - name: Set up nmake uses: ilammy/msvc-dev-cmd@v1 - name: Set up kColorPicker run: bash ./.github/scripts/setup_kColorPicker.sh - name: Set up kImageAnnotator run: bash ./.github/scripts/setup_kImageAnnotator.sh - name: Build run: bash ./.github/scripts/build_ksnip.sh - name: Download OpenSSL run: | curl -L "https://github.com/ksnip/dependencies/raw/master/windows/openSSL.zip" --output openssl.zip 7z x openssl.zip -o"${{ env.OPENSSL_DIR }}" - name: Download CompileRuntime run: | curl -L "https://github.com/ksnip/dependencies/raw/master/windows/compileRuntime.zip" --output compileruntime.zip 7z x compileruntime.zip -o"${{ env.COMPILE_RUNTIME_DIR }}" - name: Package exe run: bash ./.github/scripts/windows/package_exe.sh - name: Upload files env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | curl -L https://github.com/probonopd/uploadtool/raw/master/upload.sh --output upload.sh bash upload.sh ksnip-*.zip package-msi: runs-on: windows-latest needs: test-windows steps: - name: Checkout uses: actions/checkout@v2 - name: Set up build variables run: bash ./.github/scripts/setup_build_variables.sh - name: Set up windows build variables run: bash ./.github/scripts/windows/setup_windows_build_variables.sh - name: Install Qt uses: jurplel/install-qt-action@v2 with: version: '5.15.2' host: 'windows' install-deps: 'true' arch: 'win64_msvc2019_64' - name: Set up nmake uses: ilammy/msvc-dev-cmd@v1 - name: Set up kColorPicker run: bash ./.github/scripts/setup_kColorPicker.sh - name: Set up kImageAnnotator run: bash ./.github/scripts/setup_kImageAnnotator.sh - name: Download OpenSSL run: | curl -L "https://github.com/ksnip/dependencies/raw/master/windows/openSSL.zip" --output openssl.zip 7z x openssl.zip -o"${{ env.OPENSSL_DIR }}" - name: Download CompileRuntime run: | curl -L "https://github.com/ksnip/dependencies/raw/master/windows/compileRuntime.zip" --output compileruntime.zip 7z x compileruntime.zip -o"${{ env.COMPILE_RUNTIME_DIR }}" - name: Build run: bash ./.github/scripts/build_ksnip.sh - name: Package msi run: bash ./.github/scripts/windows/msi/package_msi.sh - name: Sign msi env: MICROSOFT_CERT_PFX: ${{ secrets.MICROSOFT_CERT_PFX }} MICROSOFT_CERT_PFX_PASS: ${{ secrets.MICROSOFT_CERT_PFX_PASS }} run: powershell ./.github/scripts/windows/msi/sign_msi_package.ps1 - name: Upload files env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | curl -L https://github.com/probonopd/uploadtool/raw/master/upload.sh --output upload.sh bash upload.sh ksnip-*.msi ksnip-1.9.2/.gitignore000066400000000000000000000017051414701001100146270ustar00rootroot00000000000000# C++ objects and libs *.slo *.lo *.o *.a *.la *.lai *.so *.dll *.dylib # Qt-es /.qmake.cache /.qmake.stash *.pro.user *.pro.user.* *.qbs.user *.qbs.user.* *.moc moc_*.cpp qrc_*.cpp ui_*.h Makefile* *build-* # QtCreator *.autosave # QtCtreator Qml *.qmlproject.user *.qmlproject.user.* # QtCtreator CMake CMakeLists.txt.user # kdevelop apidocs .kdev4 build *~ *.kdev4 *.bak *.orig *.rej doxygen.log Doxyfile *.kdevelop *.kdevelop.filelist *.kdevelop.pcs *.kdevses .*kate-swp build/ mem.log.* massif.* callgrind.* perf.data* # from kdiff3 *.BACKUP.* *.BASE.* *.LOCAL.* *.REMOTE.* # visual studio code *.vscode/ # clion *.idea # macos .DS_Store # other .directory # snap /parts/ /stage/ /prime/ /*.snap # Snapcraft global state tracking data(automatically generated) # https://forum.snapcraft.io/t/location-to-save-global-state/768 /snap/.snapcraft/ # Source archive packed by `snapcraft cleanbuild` before pushing to the LXD container /*_source.tar.bz2 ksnip-1.9.2/CHANGELOG.md000066400000000000000000001335531414701001100144570ustar00rootroot00000000000000# Change log ## Release 1.9.2 * Fixed: Version `Qt_5.15' not found (required by /usr/bin/ksnip). ([#712](https://github.com/ksnip/ksnip/issues/712)) * Fixed: CI packages show continuous suffix for tagged build. ([#710](https://github.com/ksnip/ksnip/issues/710)) * Fixed: kImageAnnotator not translated with deb package. ([#359](https://github.com/ksnip/ksnip/issues/359)) * Fixed: Windows packages increased in size. ([#713](https://github.com/ksnip/ksnip/issues/713)) * Fixed: The string 'Actions' is not available for translation. ([#729](https://github.com/ksnip/ksnip/issues/729)) * Fixed: HiDPI issue with multiple screen on Windows. ([#668](https://github.com/ksnip/ksnip/issues/668)) * Fixed: Snipping Area not closing when pressing ESC. ([#735](https://github.com/ksnip/ksnip/issues/735)) * Fixed: Sometimes "Snipping Area Rulers" not shown after starting rectangular selection. ([#684](https://github.com/ksnip/ksnip/issues/684)) * Fixed: Cursor not positioned correctly when snipping area opens. ([#736](https://github.com/ksnip/ksnip/issues/736)) * Fixed: Mouse cursor not captured when triggered via global shortcut. ([#737](https://github.com/ksnip/ksnip/issues/737)) * Fixed: Dual 4K screens get scrambled on X11. ([#734](https://github.com/ksnip/ksnip/issues/734)) * Fixed: VCRUNTIME140_1.dll was not found. ([#743](https://github.com/ksnip/ksnip/issues/743)) * Fixed: Screenshot area issue when monitor count changes on Windows. ([#722](https://github.com/ksnip/ksnip/issues/722)) * Fixed: Wayland does not support QWindow::requestActivate(). ([#656](https://github.com/ksnip/ksnip/issues/656)) * Fixed: Wrong area is captured on a Wayland screen scaling. ([#691](https://github.com/ksnip/ksnip/issues/691)) * Changed: Enforce xdg-desktop-portal screenshots for Gnome >= 41. ([#727](https://github.com/ksnip/ksnip/issues/727)) * Fixed kImageAnnotator: Crash while typing text on wayland. ([#256](https://github.com/ksnip/kImageAnnotator/issues/256)) * Changed kImageAnnotator: Show scrollbar when not all tools visible. ([#258](https://github.com/ksnip/kImageAnnotator/issues/258)) ## Release 1.9.1 * Fixed: MacOS package damaged and not starting. ([#653](https://github.com/ksnip/ksnip/issues/653)) * Fixed: Deb CI build is frequently failing due to docker image pull limit. ([#655](https://github.com/ksnip/ksnip/issues/655)) * Fixed: Dropped temporary images appear in the open recent menu. ([#613](https://github.com/ksnip/ksnip/issues/613)) * Fixed: Resizing window to match content doesn't work on opening first image/screenshot. ([#664](https://github.com/ksnip/ksnip/issues/664)) * Fixed: HiDPI issue with multiple screen on Windows. ([#668](https://github.com/ksnip/ksnip/issues/668)) * Fixed: Cursor not captured in rectangle capture. ([#670](https://github.com/ksnip/ksnip/issues/670)) * Changed: Migrate CI from Travic-CI to GitHub Action. ([#676](https://github.com/ksnip/ksnip/issues/676)) * Fixed kImageAnnotator: Crashes on destruction. ([#242](https://github.com/ksnip/kImageAnnotator/issues/242)) * Fixed kImageAnnotator: Memory leaks caught by ASAN. ([#243](https://github.com/ksnip/kImageAnnotator/issues/243)) * Changed kImageAnnotator: Use system font provided by QGuiApplication as default for text tool. ([#247](https://github.com/ksnip/kImageAnnotator/issues/247)) ## Release 1.9.0 * New: Add option to select the default action for tray icon left click. ([#502](https://github.com/ksnip/ksnip/issues/502)) * New: Open/Paste from clipboard via tray icon. ([#520](https://github.com/ksnip/ksnip/issues/520)) * New: Show/hide toolbar and annotation settings with TAB. ([#476](https://github.com/ksnip/ksnip/issues/476)) * New: Add setting for auto hiding toolbar and annotator settings. ([#527](https://github.com/ksnip/ksnip/issues/527)) * New: Allow setting transparency of not selected snipping area region. ([#517](https://github.com/ksnip/ksnip/issues/517)) * New: Resize selected rect area with arrow keys. ([#515](https://github.com/ksnip/ksnip/issues/515)) * New: Copy a screenshot to clipboard as data URI. ([#474](https://github.com/ksnip/ksnip/issues/474)) * New: Allow disabling tray icon notifications. ([#561](https://github.com/ksnip/ksnip/issues/561)) * New: Provide option to open recent files. ([#272](https://github.com/ksnip/ksnip/issues/272)) * New: Allow disabling auto resizing after first capture. ([#551](https://github.com/ksnip/ksnip/issues/551)) * New: Drag and Drop from ksnip to other applications. ([#377](https://github.com/ksnip/ksnip/issues/377)) * New: Add support for KDE Plasma notification service. ([#592](https://github.com/ksnip/ksnip/issues/592)) * New: ksnip as MSI Package for window. ([#546](https://github.com/ksnip/ksnip/issues/546)) * New: User-defined actions for taking screenshot and post-processing. ([#369](https://github.com/ksnip/ksnip/issues/369)) * New: Add 'hide main window' option to actions. ([#636](https://github.com/ksnip/ksnip/issues/636)) * New: Discord Invite in application. ([#638](https://github.com/ksnip/ksnip/issues/638)) * New kImageAnnotator: Add function for loading translations. ([#173](https://github.com/ksnip/kImageAnnotator/issues/173)) * New kImageAnnotator: Add a new tool for creating resizable movable duplicates of regions. ([#131](https://github.com/ksnip/kImageAnnotator/issues/131)) * New kImageAnnotator: Add support for hiding annotation settings panel. ([#182](https://github.com/ksnip/kImageAnnotator/issues/182)) * New kImageAnnotator: Add config option for numbering tool to only set next number. ([#42](https://github.com/ksnip/kImageAnnotator/issues/42)) * New kImageAnnotator: Allow manually changing canvas size. ([#92](https://github.com/ksnip/kImageAnnotator/issues/92)) * New kImageAnnotator: Canvas background color configurable. ([#91](https://github.com/ksnip/kImageAnnotator/issues/91)) * New kImageAnnotator: Zoom in and out with keyboard shortcuts. ([#192](https://github.com/ksnip/kImageAnnotator/issues/192)) * New kImageAnnotator: Zoom in and out via buttons from UI. ([#197](https://github.com/ksnip/kImageAnnotator/issues/197)) * New kImageAnnotator: Add reset zoom keyboard shortcut with tooltip. ([#209](https://github.com/ksnip/kImageAnnotator/issues/209)) * New kImageAnnotator: Add keyboard shortcut support for text tool. ([#183](https://github.com/ksnip/kImageAnnotator/issues/183)) * New kImageAnnotator: Allow rotating background image. ([#199](https://github.com/ksnip/kImageAnnotator/issues/199)) * New kImageAnnotator: Allow flipping background image horizontally and vertically. ([#221](https://github.com/ksnip/kImageAnnotator/issues/221)) * New kImageAnnotator: Configurable UI with dockable settings widgets. ([#102](https://github.com/ksnip/kImageAnnotator/issues/102)) * New kImageAnnotator: Add invert color image effect. ([#228](https://github.com/ksnip/kImageAnnotator/issues/228)) * New kImageAnnotator: Allow disabling item shadow per item from UI. ([#223](https://github.com/ksnip/kImageAnnotator/issues/223)) * New kImageAnnotator: Add a font selection to UI. ([#130](https://github.com/ksnip/kImageAnnotator/issues/130)) * New kImageAnnotator: Add zoom in/out capability to crop view. ([#212](https://github.com/ksnip/kImageAnnotator/issues/212)) * New kImageAnnotator: Allow to zoom in modify canvas view. ([#229](https://github.com/ksnip/kImageAnnotator/issues/229)) * New kImageAnnotator: Select item after drawing it and allow changing settings. ([#230](https://github.com/ksnip/kImageAnnotator/issues/230)) * Changed kImageAnnotator: Change drop shadow to cover all sites. ([#202](https://github.com/ksnip/kImageAnnotator/issues/202)) * Fixed: Not possible to change adorner color. ([#601](https://github.com/ksnip/ksnip/issues/601)) * Fixed: ksnip --version output printed to stderr. ([#617](https://github.com/ksnip/ksnip/issues/617)) * Fixed kImageAnnotator: Deleting item outside image doesn't decrease canvas size. ([#164](https://github.com/ksnip/kImageAnnotator/issues/164)) * Fixed kImageAnnotator: Duplicate region of grayscale image has color. ([#214](https://github.com/ksnip/kImageAnnotator/issues/214)) * Fixed kImageAnnotator: Marker shows fill and width config when modifying existing item. ([#225](https://github.com/ksnip/kImageAnnotator/issues/225)) * Fixed kImageAnnotator: Highlighter/Marker washed out color and overlapping. ([#227](https://github.com/ksnip/kImageAnnotator/issues/227)) * Fixed kImageAnnotator: Popup menus shown outside screen. ([#226](https://github.com/ksnip/kImageAnnotator/issues/226)) * Fixed kImageAnnotator: Not possible to enter value in the width tool. ([#233](https://github.com/ksnip/kImageAnnotator/issues/233)) * Fixed kImageAnnotator: Obfuscation tool shows fonts settings when switching from tool with font. ([#231](https://github.com/ksnip/kImageAnnotator/issues/231)) * Fixed kImageAnnotator: Annotation tools are not displayed if application starts with docks hidden. ([#237](https://github.com/ksnip/kImageAnnotator/issues/237)) * Fixed kImageAnnotator: Vertical scrollbar missing after using Paste embedded and moving the image. ([#232](https://github.com/ksnip/kImageAnnotator/issues/232)) * Fixed kImageAnnotator: Not possible to disable tool automatically deselected after drawn. ([#238](https://github.com/ksnip/kImageAnnotator/issues/238)) * Fixed kImageAnnotator: Annotation tool shortcuts do not work if the panel is hidden. ([#239](https://github.com/ksnip/kImageAnnotator/issues/239)) ## Release 1.8.2 * Fixed: Add missing includes to build on UNIX. ([#581](https://github.com/ksnip/ksnip/issues/581)) * Fixed: Ksnip starts minimized. ([#593](https://github.com/ksnip/ksnip/issues/593)) * Fixed: Main window still show after screenshot when corresponding option disabled. ([#596](https://github.com/ksnip/ksnip/issues/596)) * Fixed: Cancel screenshot shows main window when window was hidden. ([#607](https://github.com/ksnip/ksnip/issues/607)) * Fixed: HiDPI scaling not handled correctly under windows. ([#590](https://github.com/ksnip/ksnip/issues/590)) * Fixed: Close button hidden after taking screenshot under kwin. ([#588](https://github.com/ksnip/ksnip/issues/588)) * Fixed kImageAnnotator: Fetching image from annotator with HiDPI enabled pixelates image. ([#218](https://github.com/ksnip/kImageAnnotator/issues/218)) * Fixed kImageAnnotator: Keep aspect ratio only work when pressing CTRL before moving resize handle. ([#219](https://github.com/ksnip/kImageAnnotator/issues/219)) ## Release 1.8.1 * Changed: Allow changing adorner color for rect area selection. ([#519](https://github.com/ksnip/ksnip/issues/519)) * Changed: Notarize ksnip for macOS. ([#402](https://github.com/ksnip/ksnip/issues/402)) * Changed: Default font for numbering tool change to Arial. ([#200](https://github.com/ksnip/kImageAnnotator/issues/200)) * Changed kImageAnnotator: Horizontally align text inside spin box. ([#203](https://github.com/ksnip/kImageAnnotator/issues/203)) * Changed kImageAnnotator: Change zoom with mouse wheel to CTRL+Wheel. ([#210](https://github.com/ksnip/kImageAnnotator/issues/210)) * Fixed: If file selection is cancelled during ksnip's file open dialog via tray icon, ksnip closes. ([#503](https://github.com/ksnip/ksnip/issues/503)) * Fixed: Cancel on Quit not work when editor is hidden. ([#342](https://github.com/ksnip/ksnip/issues/342)) * Fixed: Canceling rect area selection activates main window. ([#521](https://github.com/ksnip/ksnip/issues/521)) * Fixed: Enter key doesn't finishes resizing. ([#523](https://github.com/ksnip/ksnip/issues/523)) * Fixed: Missing version number in mac binaries. ([#401](https://github.com/ksnip/ksnip/issues/401)) * Fixed: Canceling save dialog show the option save path in the header. ([#545](https://github.com/ksnip/ksnip/issues/545)) * Fixed: Save-as Window does not get focus when using snap. ([#543](https://github.com/ksnip/ksnip/issues/543)) * Fixed: Editor can not be shown again after click close icon. ([#400](https://github.com/ksnip/ksnip/issues/400)) * Fixed: Icons and text boxes not correctly scaled under gnome with hdpi. ([#549](https://github.com/ksnip/ksnip/issues/549)) * Fixed: Window captures include non-transparent border of background on Gnome. ([#460](https://github.com/ksnip/ksnip/issues/460)) * Fixed: Annotating hidpi image downscales the result after being saved. ([#172](https://github.com/ksnip/kImageAnnotator/issues/172)) * Fixed kImageAnnotator: Brazilian Portuguese translation not loaded. ([#176](https://github.com/ksnip/kImageAnnotator/issues/176)) * Fixed kImageAnnotator: error: control reaches end of non-void function. ([#177](https://github.com/ksnip/kImageAnnotator/issues/177)) * Fixed kImageAnnotator: Cursor in Text tool have too bad visibility. ([#184](https://github.com/ksnip/kImageAnnotator/issues/184)) * Fixed kImageAnnotator: bumped SONAME without name change. ([#185](https://github.com/ksnip/kImageAnnotator/issues/185)) * Fixed kImageAnnotator: Entering multiple characters at once moves the text cursor only for one character. ([#186](https://github.com/ksnip/kImageAnnotator/issues/186)) * Fixed kImageAnnotator: Activating context menu while drawing item leaves item in error state. ([#196](https://github.com/ksnip/kImageAnnotator/issues/196)) * Fixed kImageAnnotator: Icons not scaled on gnome with hdpi enabled. ([#201](https://github.com/ksnip/kImageAnnotator/issues/201)) * Fixed kImageAnnotator: Text/Number Pointer and Text/Number Arrow don't inherit Text/Number Font in Settings. ([#208](https://github.com/ksnip/kImageAnnotator/issues/208)) ## Release 1.8.0 * New: Pin screenshots in frameless windows that stay in foreground. ([#365](https://github.com/ksnip/ksnip/issues/365)) * New: Support for unit tests. ([#80](https://github.com/ksnip/ksnip/issues/80)) * New: Add brew cask package for ksnip. ([#394](https://github.com/ksnip/ksnip/issues/394)) * New: Allow setting image quality when saving images. ([#382](https://github.com/ksnip/ksnip/issues/382)) * New: Add support for cross-platform wayland screenshots using xdg-desktop-portal. ([#243](https://github.com/ksnip/ksnip/issues/243)) * New: Add save and save as tab contextMenu items. ([#332](https://github.com/ksnip/ksnip/issues/332)) * New: Add open directory context menu item on capture tabs. ([#339](https://github.com/ksnip/ksnip/issues/339)) * New: Add copy path to clipboard context menu item on capture tabs. ([#331](https://github.com/ksnip/ksnip/issues/331)) * New: Add option to delete saved images. ([#378](https://github.com/ksnip/ksnip/issues/378)) * New: Add support for loading image from stdin. ([#414](https://github.com/ksnip/ksnip/issues/414)) * New: Add screenshot options as application actions to desktop file. ([#450](https://github.com/ksnip/ksnip/issues/450)) * New: Allow renaming existing images. ([#438](https://github.com/ksnip/ksnip/issues/438)) * New: Make hiding main window during screenshot optional. ([#386](https://github.com/ksnip/ksnip/issues/386)) * New: Open several files at once in tabs. ([#355](https://github.com/ksnip/ksnip/issues/355)) * New: Allow modifying selected rectangle before making screenshot. ([#197](https://github.com/ksnip/ksnip/issues/197)) * New: Option to keep main window hidden after a taking screenshot. ([#409](https://github.com/ksnip/ksnip/issues/409)) * New kImageAnnotator: Add Pixelate image area tool. ([#140](https://github.com/ksnip/kImageAnnotator/issues/140)) * New kImageAnnotator: Zoom in and out. ([#123](https://github.com/ksnip/kImageAnnotator/issues/123)) * New kImageAnnotator: Add interface for adding custom tab context menu actions. ([#96](https://github.com/ksnip/kImageAnnotator/issues/96)) * New kImageAnnotator: Add drop shadow to captured images. ([#133](https://github.com/ksnip/kImageAnnotator/issues/133)) * New kImageAnnotator: Add grayscale image effect. ([#151](https://github.com/ksnip/kImageAnnotator/issues/151)) * New kImageAnnotator: Add numeric pointer with arrow annotation item. ([#152](https://github.com/ksnip/kImageAnnotator/issues/152)) * New kImageAnnotator: Add text pointer annotation item. ([#154](https://github.com/ksnip/kImageAnnotator/issues/154)) * New kImageAnnotator: Add text pointer with arrow annotation item. ([#153](https://github.com/ksnip/kImageAnnotator/issues/153)) * New kImageAnnotator: Add option to automatically switching to select tool after drawing item. ([#161](https://github.com/ksnip/kImageAnnotator/issues/161)) * New kImageAnnotator: Edit Text box with double click. ([#60](https://github.com/ksnip/kImageAnnotator/issues/60)) * New kImageAnnotator: Resize elements while keeping aspect ratio. ([#170](https://github.com/ksnip/kImageAnnotator/issues/170)) * Changed: Show all Screenshot options in System Tray. ([#404](https://github.com/ksnip/ksnip/issues/404)) * Changed: Upload multiple stickers at once. ([#427](https://github.com/ksnip/ksnip/issues/427)) * Changed: Follow pattern for monochromatic systray icon. ([#352](https://github.com/ksnip/ksnip/issues/352)) * Changed: Pin window shows default cursor when mouse over it. ([#465](https://github.com/ksnip/ksnip/issues/465)) * Changed: Cancel snipping area if no selection made after 60 sec. ([#475](https://github.com/ksnip/ksnip/issues/475)) * Changed: Allow removing imgur account. ([#366](https://github.com/ksnip/ksnip/issues/366)) * Changed kImageAnnotator: Draw point when clicking and releasing without moving cursor. ([#136](https://github.com/ksnip/kImageAnnotator/issues/136)) * Changed kImageAnnotator: Zoom out less than 100%. ([#150](https://github.com/ksnip/kImageAnnotator/issues/150)) * Changed kImageAnnotator: Change to select tool after adding new annotation item. ([#155](https://github.com/ksnip/kImageAnnotator/issues/155)) * Changed kImageAnnotator: Move current zoom text to left side config panel. ([#157](https://github.com/ksnip/kImageAnnotator/issues/157)) * Fixed: Snap crashing when trying to take screenshot under Wayland. ([#389](https://github.com/ksnip/ksnip/issues/389)) * Fixed: zh_Hans translation won't load. ([#429](https://github.com/ksnip/ksnip/issues/429)) * Fixed: Ksnip only saves the upper right part of the screenshot with HiDPI. ([#439](https://github.com/ksnip/ksnip/issues/439)) * Fixed: Main window not resized with new captures. ([#446](https://github.com/ksnip/ksnip/issues/446)) * Fixed: Brazilian Portuguese translation not loaded. ([#493](https://github.com/ksnip/ksnip/issues/493)) * Fixed kImageAnnotator: Blur radius not updated when changing current items settings. ([#142](https://github.com/ksnip/kImageAnnotator/issues/142)) * Fixed kImageAnnotator: Text tool opens many unix sockets. ([#144](https://github.com/ksnip/kImageAnnotator/issues/144)) * Fixed kImageAnnotator: Text No Border and No Fill shows shadow beneath text. ([#148](https://github.com/ksnip/kImageAnnotator/issues/148)) * Fixed kImageAnnotator: Item properties remain displayed after item is removed or deselected. ([#168](https://github.com/ksnip/kImageAnnotator/issues/168)) * Fixed kImageAnnotator: Changing text box through editing text doesn't update resize handles. ([#171](https://github.com/ksnip/kImageAnnotator/issues/171)) * Fixed kColorPicker: Border around colors is not centered. ([#6](https://github.com/ksnip/kColorPicker/issues/6)) ## Release 1.7.3 * New: Provide ksnip flatpak. ([#127](https://github.com/ksnip/ksnip/issues/127)) * Changed: Install svg icon file in hicolor theme dir instead of usr/share/pixmaps/. ([#297](https://github.com/ksnip/ksnip/issues/297)) ## Release 1.7.2 * Changed: Stop upload script when process writes to stderr. ([#383](https://github.com/ksnip/ksnip/issues/383)) * Changed: Upload script uses regex to select output for clipboard. ([#384](https://github.com/ksnip/ksnip/issues/384)) * Fixed: Ksnip becomes unresponsive when file dropped into it. ([#373](https://github.com/ksnip/ksnip/issues/373)) * Fixed: Ksnip window always visible on screenshots on Gnome Wayland. ([#375](https://github.com/ksnip/ksnip/issues/375)) * Fixed: Selecting path in Snap via file-chooser sets home directory to /run/user/1000. ([#388](https://github.com/ksnip/ksnip/issues/388)) * Fixed: Snap not able to run custom upload script. ([#380](https://github.com/ksnip/ksnip/issues/380)) * Fixed: kImageAnnotator: Tests fail to build with shared library. ([#128](https://github.com/ksnip/kImageAnnotator/issues/128)) ## Release 1.7.1 * Fixed: User not prompted to save when taking new screenshot without tabs. ([#357](https://github.com/ksnip/ksnip/issues/357)) * Fixed: kImageAnnotator not translated with AppImage. ([#358](https://github.com/ksnip/ksnip/issues/358)) * Fixed kImageAnnotator: Crashes after undoing a number annotation. ([#106](https://github.com/ksnip/kImageAnnotator/issues/114)) * Fixed kImageAnnotator: Text overlapping when resizing text box. ([#53](https://github.com/ksnip/kImageAnnotator/issues/53)) * Fixed kImageAnnotator: Snap lines to degrees not working when CTRL pressed before clicking annotation area. ([#113](https://github.com/ksnip/kImageAnnotator/issues/113)) * Fixed kImageAnnotator: "Border and Fill" submenu cutting off text under windows.. ([#117](https://github.com/ksnip/kImageAnnotator/issues/117)) * Fixed kImageAnnotator: Undo removes several or all items. ([#121](https://github.com/ksnip/kImageAnnotator/issues/121)) * Fixed kImageAnnotator: Marker Rect and Ellipse draw only border but no fill. ([#126](https://github.com/ksnip/kImageAnnotator/issues/126)) ## Release 1.7.0 * New: Provide ksnip snap. ([#147](https://github.com/ksnip/ksnip/issues/147)) * New: Pasting image or path to image from clipboard. ([#275](https://github.com/ksnip/ksnip/issues/275)) * New: Save to same file when editing existing image. ([#271](https://github.com/ksnip/ksnip/issues/271)) * New: Support for PrtScrn hotkey. ([#239](https://github.com/ksnip/ksnip/issues/239)) * New: Auto save new screenshot. ([#291](https://github.com/ksnip/ksnip/issues/291)) * New: Remember file for already saved images. ([#292](https://github.com/ksnip/ksnip/issues/292)) * New: Add support for drag and drop images into ksnip. ([#282](https://github.com/ksnip/ksnip/issues/282)) * New: Insert embedded image into an existing screenshot. ([#293](https://github.com/ksnip/ksnip/issues/293)) * New: Show screenshots in tabs. ([#298](https://github.com/ksnip/ksnip/issues/298)) * New: Add Maximize Window Button in Print Preview. ([#190](https://github.com/ksnip/ksnip/issues/190)) * New: Click on toast message opens content. ([#303](https://github.com/ksnip/ksnip/issues/303)) * New: Remember last used folder in the save file dialog. ([#264](https://github.com/ksnip/ksnip/issues/264)) * New: Custom script for upload images. ([#268](https://github.com/ksnip/ksnip/issues/268)) * New: Disable single global hotkey by clearing the shortcut. ([#316](https://github.com/ksnip/ksnip/issues/316)) * New: Run ksnip as single instance. ([#238](https://github.com/ksnip/ksnip/issues/238)) * New: Add option for disabling tabs. ([#329](https://github.com/ksnip/ksnip/issues/329)) * New: Add count wildcard format for filename. ([#318](https://github.com/ksnip/ksnip/issues/318)) * New: Allow to change upload imgur URI. ([#159](https://github.com/ksnip/ksnip/issues/159)) * New: Support for adding custom stickers. ([#246](https://github.com/ksnip/ksnip/issues/246)) * New kImageAnnotator: Add option to translate UI. ([#54](https://github.com/ksnip/kImageAnnotator/issues/54)) * New kImageAnnotator: Saved image expand to include annotations out of border. ([#90](https://github.com/ksnip/kImageAnnotator/issues/90)) * New kImageAnnotator: Add support for stickers. ([#74](https://github.com/ksnip/kImageAnnotator/issues/74)) * New kImageAnnotator: Add tab context menu for close all tabs and close other tabs. ([#93](https://github.com/ksnip/kImageAnnotator/issues/93)) * New kImageAnnotator: Add Number with Arrow/pointer tool. ([#79](https://github.com/ksnip/kImageAnnotator/issues/79)) * Changed: Save As option was added and useInstantSave config was removed. ([#285](https://github.com/ksnip/ksnip/issues/285)) * Changed: Disable scroll down with zero value in timeout widget. ([#294](https://github.com/ksnip/ksnip/issues/294)) * Changed: Disable unsupported capture modes in settings. ([#322](https://github.com/ksnip/ksnip/issues/322)) * Changed kImageAnnotator: Make dropdown buttons show popup on click. ([#89](https://github.com/ksnip/kImageAnnotator/issues/89)) * Changed kImageAnnotator: Hide unavailable setting widgets. ([#101](https://github.com/ksnip/kImageAnnotator/issues/101)) * Changed kImageAnnotator: Make arrow size decrease with stroke size. ([#84](https://github.com/ksnip/kImageAnnotator/issues/84)) * Fixed: Compilation error with Qt 5.15. ([#279](https://github.com/ksnip/ksnip/issues/279)) * Fixed: Undo and redo translation reverts back to English. ([#209](https://github.com/ksnip/ksnip/issues/209)) * Fixed: When 'Capture Save Location' is not set, ksnip fails to save. ([#263](https://github.com/ksnip/ksnip/issues/263)) * Fixed: Connections that required ssl not working on AppImages. ([#320](https://github.com/ksnip/ksnip/issues/320)) * Fixed: Main window hangs when pressing `Esc` on selecting screenshot area state. ([#330](https://github.com/ksnip/ksnip/issues/330)) * Fixed: Unable to resize ksnip window. ([#335](https://github.com/ksnip/ksnip/issues/335)) * Fixed: Rectangle picker is not closed with -r -s switches when mouse button is released. ([#338](https://github.com/ksnip/ksnip/issues/338)) * Fixed: Not able to use ksnip if multiple screens are connected under windows. ([#261](https://github.com/ksnip/ksnip/issues/261)) * Fixed kImageAnnotator: Using select tool marks image as changed. ([#97](https://github.com/ksnip/kImageAnnotator/issues/97)) * Fixed kImageAnnotator: Emoticon selector shows a half of current emoticon. ([#104](https://github.com/ksnip/kImageAnnotator/issues/104)) * Fixed kImageAnnotator: FillPicker text or icon sometimes not visible. ([#105](https://github.com/ksnip/kImageAnnotator/issues/105)) * Fixed kImageAnnotator: Wrong image scaling on hdpi screen. ([#81](https://github.com/ksnip/kImageAnnotator/issues/81)) * Fixed kImageAnnotator: Copy area size differs from last capture. ([#107](https://github.com/ksnip/kImageAnnotator/issues/107)) * Fixed kImageAnnotator: Number Tool not reset when switching between tabs. ([#106](https://github.com/ksnip/kImageAnnotator/issues/106)) ## Release 1.6.2 * Changed: Add missing plugs to silence snap socket warnings. ([#313](https://github.com/ksnip/ksnip/issues/313)) * Fixed: Window decoration and alt+tab menu show Wayland generic icon on KDE Plasma. ([#269](https://github.com/ksnip/kImageAnnotator/issues/269)) * Fixed: Logout canceled by 'ksnip' under KDE. ([#281](https://github.com/ksnip/kImageAnnotator/issues/281)) * Fixed: Ksnip not displayed on the monitor (off screen). ([#307](https://github.com/ksnip/kImageAnnotator/issues/307)) * Fixed: CTRL+Q to quit Ksnip not working. ([#308](https://github.com/ksnip/kImageAnnotator/issues/308)) * Fixed: Global Hotkeys not working with activatedDefaultAction Num and Caps Lock under X11. ([#310](https://github.com/ksnip/kImageAnnotator/issues/310)) * Fixed: Meta Global Hotkey under X11 not working. ([#311](https://github.com/ksnip/kImageAnnotator/issues/311)) ## Release 1.6.1 * Changed: Allow opening link directly to image without opening in browser. ([#248](https://github.com/ksnip/kImageAnnotator/issues/248)) * Changed: Always use transparent snipping area background for Wayland. ([#176](https://github.com/ksnip/kImageAnnotator/issues/176)) * Changed: Disable unavailable config options. ([#254](https://github.com/ksnip/kImageAnnotator/issues/254)) * Fixed kImageAnnotator: Edit border around text box doesn't disappear when done with editing. ([#71](https://github.com/ksnip/kImageAnnotator/issues/71)) * Fixed kImageAnnotator: Edit border not shown under Windows when NoFillNoBorder selected for Text Tool. ([#72](https://github.com/ksnip/kImageAnnotator/issues/72)) * Fixed kImageAnnotator: When adding text with background under Windows a filled rect is show in top left corner. ([#73](https://github.com/ksnip/kImageAnnotator/issues/73)) * Fixed kImageAnnotator: Drawing text tool rect from right to left and bottom top create no rect. ([#76](https://github.com/ksnip/kImageAnnotator/issues/76)) * Fixed kImageAnnotator: Text Tool FillType selection not saved. ([#75](https://github.com/ksnip/kImageAnnotator/issues/75)) * Fixed kImageAnnotator: Icons not scaled with HiDPI. ([#77](https://github.com/ksnip/kImageAnnotator/issues/77)) * Fixed kImageAnnotator: Text Cursor not show on Linux. ([#70](https://github.com/ksnip/kImageAnnotator/issues/70)) ## Release 1.6.0 * New: Make captured cursor an item which can be moved and deleted. ([#86](https://github.com/ksnip/ksnip/issues/86)) * New: Add watermarks to annotated image. ([#199](https://github.com/ksnip/ksnip/issues/199)) * New: Add crop button to toolbar. ([#90](https://github.com/ksnip/ksnip/issues/90)) * New: Add undo and redo button on toolbar. ([#124](https://github.com/ksnip/ksnip/issues/124)) * New: Make if watermark is rotated a config option. ([#206](https://github.com/ksnip/ksnip/issues/206)) * New: Do not open image uploaded to imgur in browser. ([#211](https://github.com/ksnip/ksnip/issues/211)) * New: Add shortcuts for taking screenshots. ([#161](https://github.com/ksnip/ksnip/issues/161)) * New: Add Global HotKeys for Windows. ([#161](https://github.com/ksnip/ksnip/issues/161)) * New: Add Global HotKeys for X11. ([#221](https://github.com/ksnip/ksnip/issues/221)) * New: Provide option to use previous capture area. ([#150](https://github.com/ksnip/ksnip/issues/150)) * New: Add System Tray Icon. ([#163](https://github.com/ksnip/ksnip/issues/163)) * New: Show tray icon notification after image was uploaded to imgur or saved. ([#220](https://github.com/ksnip/ksnip/issues/220)) * New: Add support for Open-with. ([#195](https://github.com/ksnip/ksnip/issues/195)) * New: Open ksnip minimized to tray. ([#240](https://github.com/ksnip/ksnip/issues/240)) * New kImageAnnotator: Edit text box content. ([#51](https://github.com/ksnip/kImageAnnotator/issues/51)) * New kImageAnnotator: Panning image by holding space or mouse middle button and dragging. ([#9](https://github.com/ksnip/kImageAnnotator/issues/9)) * New kImageAnnotator: Change annotation element config after drawing. ([#44](https://github.com/ksnip/kImageAnnotator/issues/44)) * Changed: Change copy icon. ([#157](https://github.com/ksnip/ksnip/issues/157)) * Changed: Before discarding ask if user want save or not or cancel. ([#215](https://github.com/ksnip/ksnip/issues/215)) * Changed: Shortcut for imgur upload was changed to Shift + i. ([#161](https://github.com/ksnip/ksnip/issues/161)) * Changed kImageAnnotator: Increase blur level so that large text is not visible. ([#62](https://github.com/ksnip/kImageAnnotator/issues/62)) * Changed kImageAnnotator: Crop widget updates shows via cursor if something is movable. ([#64](https://github.com/ksnip/kImageAnnotator/issues/64)) * Changed kImageAnnotator: Multi-tool buttons select current (last) tool on single click. ([#66](https://github.com/ksnip/kImageAnnotator/issues/66)) * Fixed: Translations not working for Windows and MacOS. ([#164](https://github.com/ksnip/ksnip/issues/164)) * Fixed: AppImage update fails with "None of the artifacts matched the pattern in the update information". ([#166](https://github.com/ksnip/ksnip/issues/166)) * Fixed: Wildcards in path are not resolved. ([#168](https://github.com/ksnip/ksnip/issues/168)) * Fixed: CLI arg --rectarea doesn't work. ([#170](https://github.com/ksnip/ksnip/issues/170)) * Fixed: Imgur Uploader on windows issue. ([#173](https://github.com/ksnip/ksnip/issues/173)) * Fixed: Add shortcut for File Menu in Main Menu. ([#192](https://github.com/ksnip/ksnip/issues/192)) * Fixed: Prompt to save before exit enabled now by default. ([#193](https://github.com/ksnip/ksnip/issues/193)) * Fixed: Configuration Window not translated. ([#186](https://github.com/ksnip/ksnip/issues/186)) * Fixed: ksnip opens anyway with -s option specified. ([#213](https://github.com/ksnip/ksnip/issues/213)) * Fixed: Open Image with full size window doesn't resize main window. ([#194](https://github.com/ksnip/ksnip/issues/194)) * Fixed: Can't work correctly when using scaled display. ([#174](https://github.com/ksnip/ksnip/issues/174)) * Fixed: Not able to restore window from tray under Windows 10. ([#227](https://github.com/ksnip/ksnip/issues/227)) * Fixed: ksnip opens outside desktop if last saved position was on no longer available monitor. ([#236](https://github.com/ksnip/ksnip/issues/236)) * Fixed: Window demaximize when taking a new screenshot. ([#223](https://github.com/ksnip/ksnip/issues/223)) * Fixed: Add support for Chinese Text Input. ([#208](https://github.com/ksnip/ksnip/issues/208)) * Fixed kImageAnnotator: Unable to select number annotation when clicking on the number without background. ([#46](https://github.com/ksnip/kImageAnnotator/issues/46)) * Fixed kImageAnnotator: Ctrl Modifier stuck on second or third screenshot with Ctrl-N. ([#58](https://github.com/ksnip/kImageAnnotator/issues/58)) * Fixed kImageAnnotator: Undo/Redo is now disabled during crop and scale operation. ([#56](https://github.com/ksnip/kImageAnnotator/issues/56)) * Fixed kImageAnnotator: Mess with russian letters in text tool when typing in Russian. ([#59](https://github.com/ksnip/kImageAnnotator/issues/59)) * Fixed kImageAnnotator: Text tool does not allow me to type accents. ([#57](https://github.com/ksnip/ksnip/issues/57)) * Fixed kImageAnnotator: Highlighter rect and ellipse have only border but no fill. ([#65](https://github.com/ksnip/kImageAnnotator/issues/65)) * Fixed kImageAnnotator: Saved tool selection not loaded on startup. ([#67](https://github.com/ksnip/ksnip/issues/67)) * Fixed kImageAnnotator: On startup does not highlight tool, when this tool not the first item in the list. ([#63](https://github.com/ksnip/kImageAnnotator/issues/63)) * Fixed kImageAnnotator: Cursor image cannot be grabbed for moving. ([#69](https://github.com/ksnip/kImageAnnotator/issues/69)) * Fixed kImageAnnotator: Accents still not work in text tool on Linux. ([#61](https://github.com/ksnip/kImageAnnotator/issues/61)) ## Release 1.5.0 * New: Added Continues Build with Travis-CI that creates AppImages for every commit. ([#63](https://github.com/ksnip/ksnip/issues/63)) * New: Added option to open image from file via GUI. ([#60](https://github.com/ksnip/ksnip/issues/60)) * New: Added option to set next number for Numbering Paint Items via popup settings. ([#59](https://github.com/ksnip/ksnip/issues/59)) * New: Added experimental Wayland support for KDE and Gnome DEs. ([#56](https://github.com/ksnip/ksnip/issues/56)) * New: Metadata info for ksnip is now installed in the /usr/share/metainfo directory. ([#66](https://github.com/ksnip/ksnip/issues/66)) * New: Added option to open image from file via CLI. ([#71](https://github.com/ksnip/ksnip/issues/71)) * New: Instant saving captures without prompting for save location. ([#61](https://github.com/ksnip/ksnip/issues/61)) * New: Scaling/resizing screenshots and items. ([#79](https://github.com/ksnip/ksnip/issues/79)) * New: Added translation support. ([#94](https://github.com/ksnip/ksnip/issues/94)) * New: Added Spanish, German, Dutch Norwegian and Polish translation. ([#94](https://github.com/ksnip/ksnip/issues/94)) * New: Option to switch between dynamic and default painter cursor size. ([#77](https://github.com/ksnip/ksnip/issues/77)) * New: Added RPM and DEB binaries to continues build. * New: Added blur annotation tool. ([#109](https://github.com/ksnip/ksnip/issues/109)) * New: Added Windows support. ([#113](https://github.com/ksnip/ksnip/issues/113)) * New: Added Continues build for Windows binaries. ([#114](https://github.com/ksnip/ksnip/issues/114)) * New: Place time delay settings on Toolbar. ([#91](https://github.com/ksnip/ksnip/issues/91)) * New: Add qt style switcher to configuration. ([#137](https://github.com/ksnip/ksnip/issues/137)) * New: Add icons for dark theme. ([#142](https://github.com/ksnip/ksnip/issues/142)) * New: Store imgur delete links. ([#74](https://github.com/ksnip/ksnip/issues/74)) * New: Freeze image while selecting rectangular area. ([#136](https://github.com/ksnip/ksnip/issues/136)) * New: Magnifying glass for snipping area. ([#62](https://github.com/ksnip/ksnip/issues/62)) * New: Add MacOS support. ([#125](https://github.com/ksnip/ksnip/issues/125)) * New: CI support for MacOS. ([#126](https://github.com/ksnip/ksnip/issues/126)) * New kImageAnnotator: Keep number tool sequence consecutive after deleting item. ([#7](https://github.com/ksnip/kImageAnnotator/issues/7)) * New kImageAnnotator: Added control for setting first number for numbering tool. ([#7](https://github.com/ksnip/kImageAnnotator/issues/7)) * New kImageAnnotator: Text and Number tool have now noBorderAndNoFill type. ([#22](https://github.com/ksnip/kImageAnnotator/issues/22)) * New kImageAnnotator: Double Arrow annotation tool. ([#23](https://github.com/ksnip/kImageAnnotator/issues/23)) * New kImageAnnotator: Marker Rectangle and Ellipse annotation tool. ([#26](https://github.com/ksnip/kImageAnnotator/issues/26)) * New kImageAnnotator: Add config option to setup blur radius. ([#25](https://github.com/ksnip/kImageAnnotator/issues/25)) * Changed: Move and select operation are now combined under single tool. ([#72](https://github.com/ksnip/ksnip/issues/72)) * Changed: Item selection is now based on item shape and not on item bounding rect. ([#83](https://github.com/ksnip/ksnip/issues/83)) * Changed: Imgur upload now asks for confirmation before uploading. This can be disabled in setting. ([#73](https://github.com/ksnip/ksnip/issues/73)) * Changed: CLI screenshots open now in editor when triggered without -s flag. ([#103](https://github.com/ksnip/ksnip/issues/103)) * Changed: Default filename features now a more fine-grained time placeholder. ([#110](https://github.com/ksnip/ksnip/issues/110)) * Changed: Console version output doesn't show build. ([#121](https://github.com/ksnip/ksnip/issues/121)) * Changed kImageAnnotator: Blur tool is now preciser and fits the rect. ([#28](https://github.com/ksnip/kImageAnnotator/issues/28)) * Changed kImageAnnotator: Enter finishes text input and shift-enter adds new line in Text Tool. ([#30](https://github.com/ksnip/kImageAnnotator/issues/30)) * Changed kImageAnnotator: Text item draws border around the text when in text edit mode. ([#34](https://github.com/ksnip/kImageAnnotator/issues/34)) * Fixed: Crash on Ubuntu 17.10 caused by null painterPath pointer in smoothOut method. ([#67](https://github.com/ksnip/ksnip/issues/67)) * Fixed: Default filename for screenshot had one $ sign too many. ([#68](https://github.com/ksnip/ksnip/issues/68)) * Fixed: Cancel on browse to save directory in settings dialog clears save path. ([#69](https://github.com/ksnip/ksnip/issues/69)) * Fixed: About dialog not closing when close button is clicked. ([#76](https://github.com/ksnip/ksnip/issues/76)) * Fixed: Undo move operation returns item to wrong location. ([#84](https://github.com/ksnip/ksnip/issues/84)) * Fixed: Crash when adding an item after another item was moved and undone ([#85](https://github.com/ksnip/ksnip/issues/85)) * Fixed: Crop tool not marking screenshot as unsaved after cropping ([#99](https://github.com/ksnip/ksnip/issues/99)) * Fixed: Scale tool not marking screenshot as unsaved after scaling ([#100](https://github.com/ksnip/ksnip/issues/100)) * Fixed: Running ksnip with -e flag and enabled capture screenshot on startup starts new screenshot. ([#105](https://github.com/ksnip/ksnip/issues/105)) * Fixed: Triggering new capture discards unsaved changes. ([#89](https://github.com/ksnip/ksnip/issues/89)) * Fixed: Text tool cannot be resized. ([#111](https://github.com/ksnip/ksnip/issues/111)) * Fixed: Exe file not showing icon on windows. ([#122](https://github.com/ksnip/ksnip/issues/122)) * Fixed: Buttons for text bold, italic and underlined are not correctly shown under windows. ([#118](https://github.com/ksnip/ksnip/issues/118)) * Fixed: ksnip not running on windows when qt not installed. ([#145](https://github.com/ksnip/ksnip/issues/145)) * Fixed: Imgur upload not working under windows. ([#144](https://github.com/ksnip/ksnip/issues/144)) * Fixed: Snipping area with freezed background image not working. ([#149](https://github.com/ksnip/ksnip/issues/149)) * Fixed: Snipping area cursor included in screenshot. ([#148](https://github.com/ksnip/ksnip/issues/148)) * Fixed kImageAnnotator: Double-click on annotation area causes SIGSEGV crash. ([#29](https://github.com/ksnip/kImageAnnotator/issues/29)) * Fixed kImageAnnotator: CAPS LOCK doesnt work on image editor. ([#27](https://github.com/ksnip/kImageAnnotator/issues/27)) * Fixed kImageAnnotator: Unable to select text item when clicking on text. ([#32](https://github.com/ksnip/kImageAnnotator/issues/32)) * Fixed kImageAnnotator: Some blurs get removed when losing focus. ([#35](https://github.com/ksnip/kImageAnnotator/issues/35)) * Fixed kImageAnnotator: Right click on annotation items selects item but doesn't switch tool. ([#40](https://github.com/ksnip/kImageAnnotator/issues/40)) * Fixed kImageAnnotator: Copy number annotation item doesn't increment number. ([#41](https://github.com/ksnip/kImageAnnotator/issues/41)) * Fixed kImageAnnotator: Crash on startup after adding Blur Radius Picker. ([#43](https://github.com/ksnip/kImageAnnotator/issues/43)) ## Release 1.4.0 * New: Info text (cursor position and selection area size) for snipping area cursor, can be enabled and disabled via settings.([#49](https://github.com/ksnip/ksnip/issues/49)) * New: Horizontal vertical guiding lines for snipping area cursor, can be enabled and disabled via settings. ([#48](https://github.com/ksnip/ksnip/issues/48)) * New: Drop shadow for paint items, can be enabled and disabled via settings ([#47](https://github.com/ksnip/ksnip/issues/47)) * New: Copy/past paint items. ([#46](https://github.com/ksnip/ksnip/issues/46)) * New: Numbering paint item. ([#45](https://github.com/ksnip/ksnip/issues/45)) * New: Arrow paint item. ([#44](https://github.com/ksnip/ksnip/issues/44)) * New: Select multiple paint items and perform operation on all selected at once. ([#42](https://github.com/ksnip/ksnip/issues/42)) * New: Run last or default capture on startup. ([#40](https://github.com/ksnip/ksnip/issues/40)) * New: Run rect capture from command line. ([#39](https://github.com/ksnip/ksnip/issues/39)) * New: Select between default and custom filename for saving screenshots. ([#36](https://github.com/ksnip/ksnip/issues/36)) * New: Keyboard shortcuts for paint tools. ([#43](https://github.com/ksnip/ksnip/issues/43)) * New: Bring to front and send to back paint items. ([#31](https://github.com/ksnip/ksnip/issues/31)) * New: Configurable snipping cursor thickness and color. ([#54](https://github.com/ksnip/ksnip/issues/54)) * Changed: Moving Ksnip from Qt4 to Qt5. ([#22](https://github.com/ksnip/ksnip/issues/22)) * Fixed: Settings window left hand side menu is not correctly selected when opening first time. ([#37](https://github.com/ksnip/ksnip/issues/37)) * Fixed: Snipping area not correctly shown when started on non-primary screen. ([#52](https://github.com/ksnip/ksnip/issues/52)) * Fixed: Active window screenshot ignores delay. ([#53](https://github.com/ksnip/ksnip/issues/53)) * Fixed: Rectangular area screenshot is shifted to the right of actual selected area. ([#51](https://github.com/ksnip/ksnip/issues/51)) * Fixed: Snipping area not closing when pressing Esc on Ubuntu 16.04. ([#57](https://github.com/ksnip/ksnip/issues/57)) ## Release 1.3.2 * Fixed: When compositor is disabled, rect are capture shows only black screen. Fix for Qt4 Ksnip version ([#35](https://github.com/ksnip/ksnip/issues/35)) ## Release 1.3.1 * Fixed: Ksnip 1.3.0 fails to build - due to missing cmath library ([#29](https://github.com/ksnip/ksnip/issues/29)) ## Release 1.3.0 * New: Drawing two shapes, ellipse and rectangle, with and without fill. ([#21](https://github.com/ksnip/ksnip/issues/21)) * New: Customizable color and size (thickness) for drawing tools via button on main tool bar. ([#25](https://github.com/ksnip/ksnip/issues/25)) * New: Writing text on screenshots, with customizable font, size, color etc. ([#8](https://github.com/ksnip/ksnip/issues/8)) * New: Undo/Redo for paint and crop operations. ([#5](https://github.com/ksnip/ksnip/issues/5)) * New: Smooth out free hand pen and marker lines (can be disabled in settings). ([#16](https://github.com/ksnip/ksnip/issues/16)) * New: Print screenshot or save is to prf/ps. ([#23](https://github.com/ksnip/ksnip/issues/23)) * Fixed: Second and subsequent crops don't move painter items correctly ([#27](https://github.com/ksnip/ksnip/issues/27)) * Fixed: Confirming crop via keyboard doesn't close crop panel ([28](https://github.com/ksnip/ksnip/issues/28)) ## Release 1.2.1 * Fixed: Ksnip 1.2.0 binary segfaults when compiled in x86_64 with -fPIC in gcc-5.4.0 ([#20](https://github.com/ksnip/ksnip/issues/20)) * Fixed: Incorrect version number in "About" dialog. ## Release 1.2.0 * New: Added functionality to upload screenshots to Imgur.com in anonymous or account mode. ([#14](https://github.com/ksnip/ksnip/issues/14)) * New: Capture mouse cursor on screenshot (feature can be enabled or disabled in settings). ([#18](https://github.com/ksnip/ksnip/issues/18)) * New: In crop window the crop position, width and height can be entered in numeric values, to provide a more precise crop. ([#17](https://github.com/ksnip/ksnip/issues/17)) * Changed: Settings Window Layout was changed and reorganized. * Fixed: Paint cursor was visible when capturing new screenshot. * Fixed: Crop could leave scene area. ## Release 1.1.0 * New: Cropping captured image to desired size. ([#4](https://github.com/ksnip/ksnip/issues/4)) * New: Command line support, screenshotsa can be taken now from command line too. ([#11](https://github.com/ksnip/ksnip/issues/11)) * New: Moving drawn lines to desired position by dragging. ([#2](https://github.com/ksnip/ksnip/issues/2)) * New: Setting default save location, filename and format from settings window. ([#9](https://github.com/ksnip/ksnip/issues/9)) * Changed: Capturing current screen captures now the screen where the mouse cursor is located. ## Release 1.0.0 * New: Screenshots from a custom drawn rectangular area. * New: Screenshots from the screen where ksnip is currently located (for multi monitor environments). * New: Screenshots from the whole screen, including all monitors. * New: Screenshot of currently active (on top) window. * New: Delayed captures. * New: Drawing on the captured screenshot with Pen or Marker with changeable color and size. * New: Saving ksnip location and selected tool and loading on startup. ksnip-1.9.2/CMakeLists.txt000066400000000000000000000042471414701001100154030ustar00rootroot00000000000000cmake_minimum_required(VERSION 3.5) project(ksnip LANGUAGES CXX VERSION 1.9.2) if (DEFINED VERSION_SUFIX AND NOT "${VERSION_SUFIX}" STREQUAL "") set(KSNIP_VERSION_SUFIX "-${VERSION_SUFIX}") endif() set(KSNIP_VERSION "${PROJECT_VERSION}${KSNIP_VERSION_SUFIX}") include(GNUInstallDirs) if (WIN32) set(KSNIP_LANG_INSTALL_DIR "translations") set(KIMAGEANNOTATOR_LANG_INSTALL_DIR "translations") elseif (APPLE) set(KSNIP_LANG_INSTALL_DIR "../Resources") set(KIMAGEANNOTATOR_LANG_INSTALL_DIR "../Resources") elseif (UNIX) set(KSNIP_LANG_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/ksnip/translations") set(KIMAGEANNOTATOR_LANG_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/kImageAnnotator/translations") endif () configure_file(src/BuildConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/src/BuildConfig.h) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) option(BUILD_TESTS "Build Unit Tests" OFF) if (UNIX AND NOT APPLE) # Without ECM we're unable to load XCB find_package(ECM REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) find_package(X11 REQUIRED) find_package(XCB COMPONENTS XFIXES) endif () set(QT_COMPONENTS Core Widgets Network Xml PrintSupport DBus Svg) set(QT_MIN_VERSION 5.9.4) if (UNIX AND NOT APPLE) list(APPEND QT_COMPONENTS Concurrent) endif() if (X11_FOUND) list(APPEND QT_COMPONENTS X11Extras) elseif (WIN32) list(APPEND QT_COMPONENTS WinExtras) endif() if (BUILD_TESTS) list(APPEND QT_COMPONENTS Test) endif() find_package(Qt5 ${QT_MIN_VERSION} REQUIRED ${QT_COMPONENTS}) set(KIMAGEANNOTATOR_MIN_VERSION 0.5.3) find_package(kImageAnnotator ${KIMAGEANNOTATOR_MIN_VERSION} REQUIRED) set(KCOLORPICKER_MIN_VERSION 0.1.6) find_package(kColorPicker ${KCOLORPICKER_MIN_VERSION} REQUIRED) set(BASEPATH "${CMAKE_SOURCE_DIR}") include_directories("${BASEPATH}") add_subdirectory(src) add_subdirectory(translations) add_subdirectory(desktop) if (BUILD_TESTS) configure_file(src/BuildConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/tests/BuildConfig.h) enable_testing() add_subdirectory(tests) endif (BUILD_TESTS) ksnip-1.9.2/CODINGSTYLE.md000066400000000000000000000027451414701001100147520ustar00rootroot00000000000000Ksnip follows the KDELibs (see https://community.kde.org/Policies/Kdelibs_Coding_Style) coding style, with a few exceptions: 1. The access modifier ordering is: public, public slots, signals, protected, protected slots, private, private slots. Member variables come at beginning, before all member functions. This is not strictly enforced, but is a good rule to follow. 2. Headers are cumulative, i.e., all headers that a particular class requires, are #include-ed in the class's header file, not the .cpp code file. The .cpp code file includes only one header, which is its own .h file. E.g., a class Foo, defined in Foo.h, will have its code in Foo.cpp, and Foo.cpp will #include only a single header Foo.h 3. Member variables follow the format mCamelCase, and not m_camelCase which is more common throughout the rest of the KDE Applications 4. Source files are mixed case, named the same as the class they contain. i.e., SomeClass will be defined in SomeClass.cpp, not someclass.cpp 5. Function parameters, if classes, should be past as const references, if basic types like bool, int, float, enum, can be passed by value. Functions that do not change anything on the class (like getters), should be const. 6. Use single TAB instead of four spaces to indent. 7. UnitTest should have following naming convention: `_Should__When_` Example: `StoreImagesPath_Should_NotSavePath_When_PathAlreadyStored` ksnip-1.9.2/CONTACT.md000066400000000000000000000003731414701001100142540ustar00rootroot00000000000000Welcome to the ksnip community. Give and grant anyone constrictive criticism and their desired privacy. Settle conflicts within these bounds. Finding yourselves unable to do so, e-mail [Damir Porobić](email@damirporobic.me), the project maintainer. ksnip-1.9.2/LICENSE.txt000066400000000000000000000431761414701001100144720ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) 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 this service 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 make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. 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. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), 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 distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the 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 a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE 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. 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 convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. {description} Copyright (C) {year} {fullname} 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 2 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision 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, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. {signature of Ty Coon}, 1 April 1989 Ty Coon, President of Vice This 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. ksnip-1.9.2/README.md000066400000000000000000000432401414701001100141160ustar00rootroot00000000000000# [ksnip](http://ksnip.org/) [![Linux build status][github-linux-badge]][github-linux-url] [![Windows build status][github-windows-badge]][github-windows-url] [![MacOS build status][github-macos-badge]][github-macos-url] [![GitHub commits (since latest release)][gh-comm-since-badge]][gh-comm-since-url] [![Translation status][weblate-badge]][weblate-url] [![GitHub total downloads][gh-dl-badge]][gh-dl-url] [![SourceForge total downloads][sf-dt-badge]][sf-dt-badge-url] [![Discord][discord-badge]][discord-badge-url] [![IRC: #ksnip on libera.chat][libera-badge]][libera-badge-url] Version v1.9.2 Ksnip is a Qt-based cross-platform screenshot tool that provides many annotation features for your screenshots. ![ksnip](https://i.imgur.com/0oP6i1H.png "Ksnip with annotations") # Features Latest ksnip version contains following features: * Supports Linux (X11, Plasma Wayland, GNOME Wayland and xdg-desktop-portal Wayland), Windows and macOS. * Screenshot of a custom rectangular area that can be drawn with mouse cursor. * Screenshot of last selected rectangular area without selecting again. * Screenshot of the screen/monitor where the mouse cursor is currently located. * Screenshot of full-screen, including all screens/monitors. * Screenshot of window that currently has focus. * Screenshot of window under mouse cursor. * Screenshot with or without mouse cursor. * Capture mouse cursor as annotation item that can be moved and deleted. * Customizable capture delay for all capture options. * Upload screenshots directly to imgur.com in anonymous or user mode. * Upload screenshots via custom user defined scripts. * Command-line support, for capturing screenshots and saving to default location, filename and format. * Filename wildcards for Year ($Y), Month ($M), Day ($D), Time ($T) and Counter (multiple # characters for number with zero-leading padding). * Print screenshot or save it to PDF/PS. * Annotate screenshots with pen, marker, rectangles, ellipses, texts and other tools. * Annotate screenshots with stickers and add custom stickers. * Obfuscate image regions with blur and pixelate. * Add effects to image (Drop Shadow, Grayscale, invert color or Border). * Add watermarks to captured images. * Global hotkeys for capturing screenshots (currently only for Windows and X11). * Tabs for screenshots and images. * Open existing images via dialog, drag-and-drop or paste from clipboard. * Run as single instance application (secondary instances send cli parameter to primary instance). * Pin screenshots in frameless windows that stay atop other windows. * User-defined actions for taking screenshot and post-processing. * Many configuration options. # Supported Screenshot Types | | Rect Area | Last Rect Area | Full Screen | Current Screen | Active Window | Window Under Cursor | Without Mouse Cursor | Screenshot Portal | | -------------------|:---------:|:--------------:|:-----------:|:--------------:|:-------------:|:-------------------:|:--------------------:|:-----------------:| | X11 | X | X | X | X | X | | X | | | Plasma Wayland | | | X | X | | X | | | | Gnome Wayland | X | X | X | X | X | | X | | | xdg-desktop-portal | | | | | | | | X | | Windows | X | X | X | X | X | | X | | | macOS | X | X | X | X | | | | | # Installing Binaries Binaries can be downloaded from the [Releases page](https://github.com/ksnip/ksnip/releases). Currently RPM, DEB, APT, Snap, Flatpak and AppImage for Linux, zipped EXE for Windows and APP for macOS in a DMG package are available. ### Continuous build All supported binaries are built for every pushed commit, to be found at the top of the release page. Continuous build artifacts are not fully tested and in most cases they are work in progress, so use them with caution. ## Linux ### AppImage To use AppImages, make them executable and run them, no installation required. ``` $ chmod a+x ksnip*.AppImage $ ./ksnip*.AppImage ``` More info about setting to executable can be found [here](https://discourse.appimage.org/t/how-to-make-an-appimage-executable/80). ### RPM Just install them via RPM and use. ``` $ rpm -Uvh ksnip*.rpm $ ksnip ``` ### DEB Just install them via apt and start using. ``` $ sudo apt install ./ksnip*.deb $ ksnip ``` ### APT Starting with Ubuntu 21.04 Hirsute Hippo, you can install from the [official package](https://launchpad.net/ubuntu/+source/ksnip): ``` $ sudo apt install ksnip ``` For older Ubuntu versions, you can use [@nemonein](https://github.com/nemonein)'s unofficial [PPA](url): ``` sudo add-apt-repository ppa:nemonein/ksnip sudo apt update sudo apt install ksnip ``` For Debian 11 and later releases, you can install from the [official package](https://tracker.debian.org/pkg/ksnip): ``` $ sudo apt install ksnip ``` For Debian 10 and Debian 9, ksnip is available via [Debian Backports](https://backports.debian.org/). Please enable `bullseye-backports` and `buster-backports` repo for Debian 10 and Debian 9 respectively before installing using `sudo apt install ksnip`. ### Archlinux Ksnip is in the [Community repository](https://archlinux.org/packages/community/x86_64/ksnip/), so you can install it directly via pacman. ``` $ sudo pacman -S ksnip ``` If you want to build from the GIT repository, you can use the [AUR package](https://aur.archlinux.org/packages/ksnip-git/) (make sure you build the necessary dependencies too). ``` $ yay -S ksnip-git kimageannotator-git kcolorpicker-git ``` ### Snap The usual method for Snaps, will install the latest version: ``` $ sudo snap install ksnip ``` The continuous build version is also available as edge, in order to install it you need to provide the edge flag: ``` $ sudo snap install ksnip --edge ``` Snap startup time can be sped up and console output cleaned up from following error `Could not create AF_NETLINK socket (Permission denied)` by running the following commands: ``` $ snap connect ksnip:network-observe $ snap connect ksnip:network-manager-observe ``` If you need to save screenshots to a removable media, the following additional connection is required: ``` $ snap connect ksnip:removable-media ``` This only needs to be done once and connects some Snap plugs which are currently not auto-connected. [![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-black.svg)](https://snapcraft.io/ksnip) ### Flatpak The usual method for Flatpaks will install the latest version: ``` $ flatpak install flathub org.ksnip.ksnip ``` Then just start it: ``` $ flatpak run org.ksnip.ksnip ``` Download on Flathub ## Windows ### MSI The MSI installer installs ksnip on your system and is the preferred way for installing ksnip under Windows. ### EXE The EXE file with all required dependencies comes in a zipped package, which just need to be unzipped with your favorite unpacking tool. Ksnip can then be started by just double-clicking ksnip.exe. ## macOS ### APP The app file comes in a DMG package which needs to be opened and the ksnip.app file needs to be dragged and dropped into the "Application" folder. After that the application can be started by double clicking ksnip.app ### Homebrew Cask Just install via Homebrew and start using from your "Applications" folder. ``` $ brew install --cask ksnip ``` # Dependencies ksnip depends on [kImageAnnotator](https://github.com/ksnip/kImageAnnotator) and [kColorPicker](https://github.com/DamirPorobic/kColorPicker) which needs to be installed before building ksnip from source. Installation instructions can be found on the Github pages. # Building from source 1. Get latest release from GitHub by cloning the repo: `$ git clone https://github.com/ksnip/ksnip` 2. Change to repo directory: `$ cd ksnip` 3. Make new build directory and enter it: `$ mkdir build && cd build` 4. Create the makefile and build the project: `$ cmake .. && make` 5. Now install the application, eventually you need to run it with sudo: `$ sudo make install` 6. Run the application: `$ ksnip` If you are using Archlinux, you may prefer to [build ksnip through AUR](https://github.com/ksnip/ksnip#archlinux). # Translations As with all continuous translations, contributors are always welcome! For translations [Weblate](https://hosted.weblate.org/projects/ksnip/translations/) is used. [![Translation status](https://hosted.weblate.org/widgets/ksnip/-/translations/multi-green.svg)](https://hosted.weblate.org/engage/ksnip/?utm_source=widget) For translations of annotator-related texts, please refer to [kImageAnnotator](https://github.com/ksnip/kImageAnnotator) # Known Issues ### X11 1. Snipping area with transparent background doesn't work when compositor is turned off, freeze background is used in that case. ### macOS 1. Snipping area with transparent background doesn't work, freeze background is always used. Issue [#151](https://github.com/ksnip/ksnip/issues/151) 2. Second activation of snipping area doesn't get focus, you need to switch to the right side in order to see the snipping area. Issue [#152](https://github.com/ksnip/ksnip/issues/152) 3. Mouse cursor is always captured. Issue [#153](https://github.com/ksnip/ksnip/issues/153) ### Wayland 1. Portal and Native Screenshots not working under KDE Plasma `>= 5.80`. The issue is coming from a recent change in KDE Plasma that prevents access to DBUS Interfaces responsible for taking screenshots. This issue is going to be fixed in future Plasma releases for the Portal Screenshots. Workaround for making the Portal Screenshots work is adding the string `X-KDE-DBUS-Restricted-Interfaces=org.kde.kwin.Screenshot` to the `/usr/share/applications/org.freedesktop.impl.portal.desktop.kde.desktop` file and then restarting. Don't forget to enforce Portal screenshots in settings. Issue [#424](https://github.com/ksnip/ksnip/issues/424) 2. Under Gnome Wayland copying images to clipboard and then pasting them somewhere might not work. This happens currently with native Wayland. A workaround is using XWayland by starting ksnip like this `QT_QPA_PLATFORM=xcb /usr/bin/ksnip` or switch to XWayland completely by exporting that variable `export QT_QPA_PLATFORM=xcb`. Issue [#416](https://github.com/ksnip/ksnip/issues/416) 3. Native Wayland screenshots are no longer possible with Gnome 41 and higher. The Gnome developers have forbidden access to the DBus interface that provides Screenshots under Wayland and leave non Gnome application only the possibility to use xdg-desktop-portal screenshots. Security comes before usability for the Gnome developers. There is an open feature request to only grant screenshot permission once instead of for every screenshot, help us raise awareness for such feature [here](https://github.com/flatpak/xdg-desktop-portal/issues/649). 4. Global Hotkeys don't work under Wayland, this is due to the secure nature of Wayland. As long as compositor developers don't provide an interface for us to work with Global Hotkeys, does won't be supported. # Discussion & Community If you have general questions, ideas or just want to talk about ksnip, please join our [Discord](http://discord.ksnip.org) server. # Bug report Please report any bugs or feature requests related to the annotation editor on the [kImageAnnotator](https://github.com/ksnip/kImageAnnotator/issues) GitHub page under the "Issue" section. All other bugs or feature requests can be reported on the [ksnip](https://github.com/ksnip/ksnip/issues) GitHub page under the "Issue" section. # Contribution Any contribution welcome, be it code, translations or other things. Currently, this is needed: * Write code and fix bugs for linux, windows and macOS. * Write wiki entries and documentation for ksnip. * Package ksnip for different operating systems and distros. # Donation ksnip is a non-profitable copylefted libre software project, and still has some costs that need to be covered, like domain costs or hardware costs for cross-platform support. If you want to help or just want to appreciate the work being done by treating developers to a beer or coffee, you can do that [here](https://www.paypal.me/damirporobic), donations are always welcome :) [github-linux-badge]: https://github.com/ksnip/ksnip/actions/workflows/linux.yml/badge.svg [github-linux-url]: https://github.com/ksnip/ksnip/actions/workflows/linux.yml [github-windows-badge]:https://github.com/ksnip/ksnip/actions/workflows/windows.yml/badge.svg [github-windows-url]: https://github.com/ksnip/ksnip/actions/workflows/windows.yml [github-macos-badge]: https://github.com/ksnip/ksnip/actions/workflows/macos.yml/badge.svg [github-macos-url]: https://github.com/ksnip/ksnip/actions/workflows/macos.yml [weblate-badge]: https://hosted.weblate.org/widgets/ksnip/-/translations/svg-badge.svg [weblate-url]: https://hosted.weblate.org/engage/ksnip/?utm_source=widget [gh-dl-badge]: https://img.shields.io/github/downloads/damirporobic/ksnip/total.svg?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMTIgMTIgNDAgNDAiPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0zMiwxMy40Yy0xMC41LDAtMTksOC41LTE5LDE5YzAsOC40LDUuNSwxNS41LDEzLDE4YzEsMC4yLDEuMy0wLjQsMS4zLTAuOWMwLTAuNSwwLTEuNywwLTMuMiBjLTUuMywxLjEtNi40LTIuNi02LjQtMi42QzIwLDQxLjYsMTguOCw0MSwxOC44LDQxYy0xLjctMS4yLDAuMS0xLjEsMC4xLTEuMWMxLjksMC4xLDIuOSwyLDIuOSwyYzEuNywyLjksNC41LDIuMSw1LjUsMS42IGMwLjItMS4yLDAuNy0yLjEsMS4yLTIuNmMtNC4yLTAuNS04LjctMi4xLTguNy05LjRjMC0yLjEsMC43LTMuNywyLTUuMWMtMC4yLTAuNS0wLjgtMi40LDAuMi01YzAsMCwxLjYtMC41LDUuMiwyIGMxLjUtMC40LDMuMS0wLjcsNC44LTAuN2MxLjYsMCwzLjMsMC4yLDQuNywwLjdjMy42LTIuNCw1LjItMiw1LjItMmMxLDIuNiwwLjQsNC42LDAuMiw1YzEuMiwxLjMsMiwzLDIsNS4xYzAsNy4zLTQuNSw4LjktOC43LDkuNCBjMC43LDAuNiwxLjMsMS43LDEuMywzLjVjMCwyLjYsMCw0LjYsMCw1LjJjMCwwLjUsMC40LDEuMSwxLjMsMC45YzcuNS0yLjYsMTMtOS43LDEzLTE4LjFDNTEsMjEuOSw0Mi41LDEzLjQsMzIsMTMuNHoiLz48L3N2Zz4= [gh-dl-url]: https://github.com/ksnip/ksnip/releases [sf-dt-badge]: https://img.shields.io/sourceforge/dt/ksnip.svg?logo=data:image/svg+xml;base64,PCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAyMDAxMDkwNC8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy1TVkctMjAwMTA5MDQvRFREL3N2ZzEwLmR0ZCI+PHN2ZyB2ZXJzaW9uPSIxLjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjMzMHB4IiBoZWlnaHQ9IjMzMHB4IiB2aWV3Qm94PSIwIDAgMzMwMCAzMzAwIiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCBtZWV0Ij48ZyBpZD0ibGF5ZXIxMDEiIGZpbGw9IiNmZmYiIHN0cm9rZT0ibm9uZSI+IDxwYXRoIGQ9Ik0xNTI4IDMwMTkgYy0xMCAtNSAtMTggLTIwIC0xOCAtMzIgMCAtMTYgMTczIC0xOTUgNjA3IC02MjkgNTYyIC01NjIgNjA2IC02MDkgNjA1IC02MzkgLTEgLTI5IC00OSAtODEgLTQ4MSAtNTEzIC0zMjMgLTMyMyAtNDgxIC00ODggLTQ4MSAtNTAyIDAgLTIzIDE5OCAtMjI0IDIyMSAtMjI0IDE5IDAgMTIzOSAxMjIxIDEyMzkgMTI0MCAwIDggLTI5MSAzMDYgLTY0NyA2NjIgbC02NDggNjQ4IC0xOTAgMCBjLTExMCAwIC0xOTcgLTUgLTIwNyAtMTF6Ii8+IDxwYXRoIGQ9Ik02ODIgMjIwNiBjLTQwMSAtNDAwIC02MTMgLTYxOSAtNjExIC02MjkgNCAtMTggMTI2MiAtMTI4MiAxMjkxIC0xMjk4IDIzIC0xMyAzNzUgLTEyIDM5OSAxIDEwIDYgMTkgMjEgMTkgMzMgMCAxNSAtMTcyIDE5NCAtNjA0IDYyNyAtMzMzIDMzMyAtNjA1IDYxMiAtNjA2IDYyMCAtMiA4IC0yIDI0IC0xIDM1IDEgMTIgMTkzIDIxMiA0ODEgNTAwIDMwOCAzMDggNDgwIDQ4NyA0ODAgNTAwIDAgMjMgLTE5NyAyMjUgLTIyMCAyMjUgLTggMCAtMjkxIC0yNzYgLTYyOCAtNjE0eiIvPiA8cGF0aCBkPSJNMTU5MiAyMjM5IGMtMTM5IC0yMyAtMjY5IC0xMjMgLTMzNiAtMjYwIC00NiAtOTUgLTYwIC0xNjkgLTUyIC0yODkgMTAgLTE2MiA1MSAtMjU4IDE4NiAtNDMxIDEwOCAtMTM4IDEzOCAtMTk2IDE1MyAtMjg4IDEyIC04MyAyNiAtOTAgNzMgLTM4IDgxIDg2IDEzNyAxODYgMTc5IDMxNyA0MCAxMjYgNTUgMjE2IDY2IDQwMCA2IDkxIDE2IDE3NiAyMiAxOTAgMTggMzcgNTEgMzcgNzYgMSA0OCAtNjYgNTUgLTEwNiA1NSAtMjg0IDAgLTEwOSA0IC0xNjYgMTEgLTE2NCAxNiA1IDUzIDkxIDgwIDE4NCA5MSAzMTIgLTg3IDYyMCAtMzgxIDY2MyAtMzggNSAtNzEgOSAtNzQgOSAtMyAtMSAtMjkgLTUgLTU4IC0xMHoiLz4gPC9nPjwvc3ZnPg== [sf-dt-badge-url]: https://sourceforge.net/projects/ksnip [gh-comm-since-badge]: https://img.shields.io/github/commits-since/damirporobic/ksnip/latest.svg?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMTIgMTIgNDAgNDAiPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0zMiwxMy40Yy0xMC41LDAtMTksOC41LTE5LDE5YzAsOC40LDUuNSwxNS41LDEzLDE4YzEsMC4yLDEuMy0wLjQsMS4zLTAuOWMwLTAuNSwwLTEuNywwLTMuMiBjLTUuMywxLjEtNi40LTIuNi02LjQtMi42QzIwLDQxLjYsMTguOCw0MSwxOC44LDQxYy0xLjctMS4yLDAuMS0xLjEsMC4xLTEuMWMxLjksMC4xLDIuOSwyLDIuOSwyYzEuNywyLjksNC41LDIuMSw1LjUsMS42IGMwLjItMS4yLDAuNy0yLjEsMS4yLTIuNmMtNC4yLTAuNS04LjctMi4xLTguNy05LjRjMC0yLjEsMC43LTMuNywyLTUuMWMtMC4yLTAuNS0wLjgtMi40LDAuMi01YzAsMCwxLjYtMC41LDUuMiwyIGMxLjUtMC40LDMuMS0wLjcsNC44LTAuN2MxLjYsMCwzLjMsMC4yLDQuNywwLjdjMy42LTIuNCw1LjItMiw1LjItMmMxLDIuNiwwLjQsNC42LDAuMiw1YzEuMiwxLjMsMiwzLDIsNS4xYzAsNy4zLTQuNSw4LjktOC43LDkuNCBjMC43LDAuNiwxLjMsMS43LDEuMywzLjVjMCwyLjYsMCw0LjYsMCw1LjJjMCwwLjUsMC40LDEuMSwxLjMsMC45YzcuNS0yLjYsMTMtOS43LDEzLTE4LjFDNTEsMjEuOSw0Mi41LDEzLjQsMzIsMTMuNHoiLz48L3N2Zz4= [gh-comm-since-url]: https://github.com/ksnip/ksnip/releases/tag/continuous [discord-badge]: https://img.shields.io/discord/812295724837371955.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2 [discord-badge-url]: http://discord.ksnip.org [libera-badge]: https://img.shields.io/badge/libera.chat-%23ksnip-brightgreen.svg [libera-badge-url]: https://web.libera.chat/?channels=#ksnip ksnip-1.9.2/cmake/000077500000000000000000000000001414701001100137145ustar00rootroot00000000000000ksnip-1.9.2/cmake/cmake_uninstall.cmake.in000066400000000000000000000017551414701001100205040ustar00rootroot00000000000000if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt") endif(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files) string(REGEX REPLACE "\n" ";" files "${files}") foreach(file ${files}) message(STATUS "Uninstalling $ENV{DESTDIR}${file}") if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") exec_program( "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" OUTPUT_VARIABLE rm_out RETURN_VALUE rm_retval ) if(NOT "${rm_retval}" STREQUAL 0) message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") endif(NOT "${rm_retval}" STREQUAL 0) else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") message(STATUS "File $ENV{DESTDIR}${file} does not exist.") endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") endforeach(file) ksnip-1.9.2/desktop/000077500000000000000000000000001414701001100143055ustar00rootroot00000000000000ksnip-1.9.2/desktop/CMakeLists.txt000066400000000000000000000006101414701001100170420ustar00rootroot00000000000000# Add desktop file and desktop icon to target machine # Add metadata file if(UNIX AND NOT APPLE) install(PROGRAMS org.ksnip.ksnip.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications) install(FILES ksnip.svg DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps) install(FILES org.ksnip.ksnip.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo) endif() ksnip-1.9.2/desktop/ksnip.svg000066400000000000000000000124261414701001100161570ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/desktop/org.ksnip.ksnip.appdata.xml000066400000000000000000000515661414701001100215120ustar00rootroot00000000000000 org.ksnip.ksnip FSFAP GPL-2.0+ Damir Porobic ksnip Cross-Platform Screenshot tool with annotation features

​ Ksnip is a Qt based cross-platform screenshot tool that provides many annotation features for your screenshots. ​

Features:

  • Supports Linux (X11, Plasma Wayland, GNOME Wayland and xdg-desktop-portal Wayland), Windows and macOS.
  • Taking screenshot of a custom rectangular area that can be drawn with mouse cursor.
  • Taking screenshot of last selected rectangular area without selecting again.
  • Taking screenshot of the screen/monitor where the mouse cursor is currently located.
  • Taking screenshot of full screen, including all screens/monitors.
  • Taking screenshot of window that currently has focus.
  • Taking screenshot of window under mouse cursor.
  • Take screenshot with or without mouse cursor.
  • Capture mouse cursor as annotation item that can be moved and deleted.
  • Customizable capture delay for all capture options.
  • Upload screenshots directly to imgur.com in anonymous or user mode.
  • Upload screenshots via custom user defined scripts.
  • Command line support, for taking screenshot and saving it to default location, filename and format.
  • Filename wildcards for Year ($Y), Month ($M), Day ($D), Time ($T) and Counter (multiple # characters for number with zero leading padding).
  • Print screenshot or save is to pdf/ps.
  • Annotate screenshots with pen, marker, rectangles, ellipses, texts and other tools.
  • Annotate screenshots with stickers and add custom stickers.
  • Obfuscate image regions with blur and pixelate.
  • Add effects to image (Drop Shadow, Grayscale, invert color or Border).
  • Add watermarks to captured images.
  • Global HotKeys for taking Screenshots (Currently only for Windows and X11).
  • Tabs for Screenshots and images.
  • Open existing images via dialog, drag-and-drop or paste from clipboard.
  • Run as single instance application (secondary instances send cli parameter to primary instance).
  • Pin Screenshots in Frameless windows that stay on top of other windows.
  • User-defined actions for taking screenshot and post-processing.
  • Many configuration options.
org.ksnip.ksnip.desktop http://ksnip.org Main Window https://i.imgur.com/4nMcbnF.png Crop Window https://i.imgur.com/1aQZID6.png Snipping Window 1 https://i.imgur.com/gXolSAI.png Snipping Window 2 https://i.imgur.com/ATGeYvI.png Snipping Window 3 https://i.imgur.com/dMrqJpq.png Settings Dialog https://i.imgur.com/5YaVTV4.png Sticker Settings https://i.imgur.com/PCLxIUo.png Imgur History Links https://i.imgur.com/AQuHhDR.png ksnip org.ksnip.ksnip.desktop damir.porobic@gmx.com
  • Fixed: Version `Qt_5.15' not found (required by /usr/bin/ksnip).
  • Fixed: CI packages show continuous suffix for tagged build.
  • Fixed: kImageAnnotator not translated with deb package.
  • Fixed: Windows packages increased in size.
  • Fixed: The string 'Actions' is not available for translation.
  • Fixed: HiDPI issue with multiple screen on Windows.
  • Fixed: Snipping Area not closing when pressing ESC.
  • Fixed: Sometimes "Snipping Area Rulers" not shown after starting rectangular selection.
  • Fixed: Cursor not positioned correctly when snipping area opens.
  • Fixed: Mouse cursor not captured when triggered via global shortcut.
  • Fixed: Dual 4K screens get scrambled on X11.
  • Fixed: VCRUNTIME140_1.dll was not found.
  • Fixed: Screenshot area issues when monitor count changes on Windows.
  • Fixed: Wayland does not support QWindow::requestActivate().
  • Fixed: Wrong area is captured on a Wayland screen scaling.
  • Changed: Enforce xdg-desktop-portal screenshots for Gnome >= 41.
  • Fixed kImageAnnotator: Crash while typing text on wayland.
  • Changed kImageAnnotator: Show scrollbar when not all tools visible.
  • Fixed: MacOS package damaged and not starting.
  • Fixed: Deb CI build is frequently failing due to docker image pull limit.
  • Fixed: Dropped temporary images appear in the open recent menu.
  • Fixed: Resizing window to match content doesn't work on opening first image/screenshot.
  • Fixed: HiDPI issue with multiple screen on Windows.
  • Fixed: Cursor not captured in rectangle capture.
  • Changed: Migrate CI from Travic-CI to GitHub Action.
  • Fixed kImageAnnotator: Crashes on destruction.
  • Fixed kImageAnnotator: Memory leaks caught by ASAN.
  • Changed kImageAnnotator: Use system font provided by QGuiApplication as default for text tool.
  • New: Add option to select the default action for tray icon left click.
  • New: Open/Paste from clipboard via tray icon.
  • New: Show/hide toolbar and annotation settings with TAB.
  • New: Add setting for auto hiding toolbar and annotator settings.
  • New: Allow setting transparency of not selected snipping area region.
  • New: Resize selected rect area with arrow keys.
  • New: Copy a screenshot to clipboard as data URI.
  • New: Provide option to open recent files.
  • New: Allow disabling auto resizing after first capture .
  • New: Drag and Drop from ksnip to other applications.
  • New: Add support for KDE Plasma notification service.
  • New: ksnip as MSI Package for window.
  • New: User-defined actions for taking screenshot and post-processing.
  • New: Add 'hide main window' option to actions.
  • New: Discord Invite in application.
  • New kImageAnnotator: Add function for loading translations.
  • New kImageAnnotator: Add a new tool for creating resizable movable duplicates of regions.
  • New kImageAnnotator: Add support for hiding annotation settings panel.
  • New kImageAnnotator: Add config option for numbering tool to only set next number.
  • New kImageAnnotator: Allow manually changing canvas size.
  • New kImageAnnotator: Canvas background color configurable.
  • New kImageAnnotator: Zoom in and out with keyboard shortcuts.
  • New kImageAnnotator: Zoom in and out via buttons from UI.
  • New kImageAnnotator: Add reset zoom keyboard shortcut with tooltip.
  • New kImageAnnotator: Add keyboard shortcut support for text tool.
  • New kImageAnnotator: Allow rotating background image.
  • New kImageAnnotator: Allow flipping background image horizontally and vertically.
  • New kImageAnnotator: Configurable UI with dockable settings widgets.
  • New kImageAnnotator: Add invert color image effect.
  • New kImageAnnotator: Allow disabling item shadow per item from UI.
  • New kImageAnnotator: Add a font selection to UI.
  • New kImageAnnotator: Add zoom in/out capability to crop view.
  • New kImageAnnotator: Allow to zoom in modify canvas view.
  • New kImageAnnotator: Select item after drawing it and allow changing settings.
  • Changed kImageAnnotator: Change drop shadow to cover all sites.
  • Fixed: Not possible to change adorner color.
  • Fixed: ksnip --version output printed to stderr.
  • Fixed kImageAnnotator: Deleting item outside image doesn't decrease canvas size.
  • Fixed kImageAnnotator: Duplicate region of grayscale image has color.
  • Fixed kImageAnnotator: Marker shows fill and width config when modifying existing item.
  • Fixed kImageAnnotator: Highlighter/Marker washed out color and overlapping.
  • Fixed kImageAnnotator: Popup menus shown outside screen.
  • Fixed kImageAnnotator: Not possible to enter value in the width tool.
  • Fixed kImageAnnotator: Obfuscation tool shows fonts settings when switching from tool with font.
  • Fixed kImageAnnotator: Annotation tools are not displayed if application starts with docks hidden.
  • Fixed kImageAnnotator: Vertical scrollbar missing after using Paste embedded and moving the image.
  • Fixed kImageAnnotator: Not possible to disable tool automatically deselected after drawn.
  • Fixed kImageAnnotator: Annotation tool shortcuts do not work if the panel is hidden.
  • Fixed: Add missing includes to build on UNIX.
  • Fixed: Ksnip starts minimized.
  • Fixed: Main window still show after screenshot when corresponding option disabled.
  • Fixed: Cancel screenshot shows main window when window was hidden.
  • Fixed: HiDPI scaling not handled correctly under windows.
  • Fixed: Close button hidden after taking screenshot under kwin.
  • Fixed kImageAnnotator: Fetching image from annotator with HiDPI enabled pixelates image.
  • Fixed kImageAnnotator: Keep aspect ratio only work when pressing CTRL before moving resize handle.
  • Changed: Allow changing adorner color for rect area selection.
  • Changed: Notarize ksnip for macOS.
  • Changed: Default font for numbering tool change to Arial.
  • Changed kImageAnnotator: Horizontally align text inside spin box.
  • Changed kImageAnnotator: Change zoom with mouse wheel to CTRL+Wheel.
  • Fixed: If file selection is cancelled during ksnip's file open dialog via tray icon, ksnip closes.
  • Fixed: Cancel on Quit not work when editor is hidden.
  • Fixed: Canceling rect area selection activates main window.
  • Fixed: Enter key doesn't finishes resizing.
  • Fixed: Missing version number in mac binaries.
  • Fixed: Canceling save dialog show the option save path in the header.
  • Fixed: Save-as Window does not get focus when using snap.
  • Fixed: Editor can not be shown again after click close icon.
  • Fixed: Icons and text boxes not correctly scaled under gnome with hdpi.
  • Fixed: Window captures include non-transparent border of background on Gnome.
  • Fixed: Annotating hidpi image downscales the result after being saved.
  • Fixed kImageAnnotator: Brazilian Portuguese translation not loaded.
  • Fixed kImageAnnotator: error: control reaches end of non-void function.
  • Fixed kImageAnnotator: Cursor in Text tool have too bad visibility.
  • Fixed kImageAnnotator: bumped SONAME without name change.
  • Fixed kImageAnnotator: Entering multiple characters at once moves the text cursor only for one character.
  • Fixed kImageAnnotator: Activating context menu while drawing item leaves item in error state.
  • Fixed kImageAnnotator: Icons not scaled on gnome with hdpi enabled.
  • Fixed kImageAnnotator: Text/Number Pointer and Text/Number Arrow don't inherit Text/Number Font in Settings.
  • New: Pin screenshots in frameless windows that stay in foreground.
  • New: Support for unit tests.
  • New: Add brew cask package for ksnip.
  • New: Allow setting image quality when saving images.
  • New: Add support for cross-platform wayland screenshots using xdg-desktop-portal.
  • New: Add save and save as tab contextMenu items.
  • New: Add open directory context menu item on capture tabs.
  • New: Add copy path to clipboard context menu item on capture tabs.
  • New: Add option to delete saved images.
  • New: Add support for loading image from stdin.
  • New: Add screenshot options as application actions to desktop file.
  • New: Allow renaming existing images.
  • New: Make hiding main window during screenshot optional.
  • New: Open several files at once in tabs.
  • New: Allow modifying selected rectangle before making screenshot.
  • New: Option to keep main window hidden after a taking screenshot.
  • New kImageAnnotator: Add Pixelate image area tool.
  • New kImageAnnotator: Zoom in and out.
  • New kImageAnnotator: Add interface for adding custom tab context menu actions.
  • New kImageAnnotator: Add drop shadow to captured images.
  • New kImageAnnotator: Add grayscale image effect.
  • New kImageAnnotator: Add numeric pointer with arrow annotation item.
  • New kImageAnnotator: Add text pointer annotation item.
  • New kImageAnnotator: Add text pointer with arrow annotation item.
  • New kImageAnnotator: Add option to automatically switching to select tool after drawing item.
  • New kImageAnnotator: Edit Text box with double click.
  • New kImageAnnotator: Resize elements while keeping aspect ratio.
  • Changed: Show all Screenshot options in System Tray.
  • Changed: Upload multiple stickers at once.
  • Changed: Follow pattern for monochromatic systray icon.
  • Changed: Pin window shows default cursor when mouse over it.
  • Changed: Cancel snipping area if no selection made after 60 sec.
  • Changed: Allow removing imgur account.
  • Changed kImageAnnotator: Draw point when clicking and releasing without moving cursor.
  • Changed kImageAnnotator: Zoom out less than 100%.
  • Changed kImageAnnotator: Change to select tool after adding new annotation item.
  • Changed kImageAnnotator: Move current zoom text to left side config panel.
  • Fixed: Snap crashing when trying to take screenshot under Wayland.
  • Fixed: zh_Hans translation won't load.
  • Fixed: Ksnip only saves the upper right part of the screenshot with HiDPI.
  • Fixed: Main window not resized with new captures.
  • Fixed: Brazilian Portuguese translation not loaded.
  • Fixed kImageAnnotator: Blur radius not updated when changing current items settings.
  • Fixed kImageAnnotator: Text tool opens many unix sockets.
  • Fixed kImageAnnotator: Text No Border and No Fill shows shadow beneath text.
  • Fixed kImageAnnotator: Item properties remain displayed after item is removed or deselected.
  • Fixed kImageAnnotator: Changing text box through editing text doesn't update resize handles.
  • Fixed kColorPicker: Border around colors is not centered.
  • Provide ksnip flatpak.
  • Changed: Install svg icon file in hicolor theme dir instead of usr/share/pixmaps/.
  • Changed: Stop upload script when process writes to stderr.
  • Changed: Upload script uses regex to select output for clipboard.
  • Fixed: Ksnip becomes unresponsive when file dropped into it.
  • Fixed: Ksnip window always visible on screenshots on Gnome Wayland.
  • Fixed: Selecting path in Snap via file-chooser sets home directory to /run/user/1000.
  • Fixed: Snap not able to run custom upload script.
  • Fixed: kImageAnnotator: Tests fail to build with shared library.
ksnip-1.9.2/desktop/org.ksnip.ksnip.desktop000066400000000000000000000013301414701001100207320ustar00rootroot00000000000000[Desktop Entry] Type=Application Exec=ksnip Icon=ksnip Terminal=false StartupNotify=false Name=ksnip GenericName=ksnip Screenshot Tool Comment=Cross-platform screenshot tool that provides many annotation features for your screenshots. Categories=Utility; Actions=Area;LastArea;FullScreen;Window; X-KDE-DBUS-Restricted-Interfaces=org.kde.kwin.Screenshot,org.kde.KWin.ScreenShot2 [Desktop Action Area] Exec=ksnip -r -c Icon=ksnip Name=Capture a rectangular area [Desktop Action LastArea] Exec=ksnip -l -c Icon=ksnip Name=Capture last selected rectangular area [Desktop Action FullScreen] Exec=ksnip -m -c Icon=ksnip Name=Capture a fullscreen [Desktop Action Window] Exec=ksnip -a -c Icon=ksnip Name=Capture the focused window ksnip-1.9.2/icons/000077500000000000000000000000001414701001100137475ustar00rootroot00000000000000ksnip-1.9.2/icons/dark/000077500000000000000000000000001414701001100146705ustar00rootroot00000000000000ksnip-1.9.2/icons/dark/action.svg000066400000000000000000000044041414701001100166700ustar00rootroot00000000000000 image/svg+xmlksnip-1.9.2/icons/dark/activeWindow.svg000066400000000000000000000055301414701001100200570ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/dark/clock.svg000066400000000000000000000053461414701001100165140ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/dark/copy.svg000066400000000000000000000112361414701001100163660ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/dark/crop.svg000066400000000000000000000123171414701001100163600ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/dark/currentScreen.svg000066400000000000000000000125561414701001100202440ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/dark/delete.svg000066400000000000000000000057001414701001100166550ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/dark/drawRect.svg000066400000000000000000000132361414701001100171710ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/dark/fullScreen.svg000066400000000000000000000146461414701001100175260ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/dark/ksnip.svg000066400000000000000000000127341414701001100165440ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/dark/lastRect.svg000066400000000000000000000135321414701001100171760ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/dark/paste.svg000066400000000000000000000076401414701001100165340ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/dark/pasteEmbedded.svg000066400000000000000000000053161414701001100201440ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/dark/pin.svg000066400000000000000000000046731414701001100162110ustar00rootroot00000000000000 image/svg+xmlksnip-1.9.2/icons/dark/redo.svg000066400000000000000000000075561414701001100163570ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/dark/save.svg000066400000000000000000000066151414701001100163570ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/dark/saveAs.svg000066400000000000000000000204351414701001100166370ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/dark/undo.svg000066400000000000000000000076221414701001100163650ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/dark/wayland.svg000066400000000000000000000201001414701001100170410ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/dark/windowUnderCursor.svg000066400000000000000000000106641414701001100211230ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/ksnip.icns000066400000000000000000002532061414701001100157610ustar00rootroot00000000000000icnsVis32HGITU THGHHGEHGGHF:;?@GHGHGHGGHGHFLtmmnmnkJGHGHGGIFHGHCTDHGHGGM"6KGHGHH:TDHHGHGGM$9KGHGHI:TDHGHGGM#8KGHGHI:TDHHGGM#8KGHGHI:TDHGGM#8KGHGHI>?GHGHGIKHGHGHIHGHGHGH76787676776767600101676767767676:VQQRQRP86767758673|ź@476771]H37677-x@476771[F37678-x·@4776771[F37678-x·@476771[~F37 678-x·@472^G37678-u·@4773Rieegd=57678&rö@480cwNSTQ94767672#r¹@51_rRXU<57676670/#qů@.`rSU<57676670-/#t;^uQ<57676670-./'chl767676670-./)PH:<=:KB38676670-/&\:3561Mm?38676670.'Z<5783Kqh@3867671&[<5773Lomj@4867678)Z<5773Kkfie;37676771]<5782RA476771_<5782TQ1876771_<5782TO1876770_<5781T{O1876770_<5781T|O1874b<5781U}Q18768KH G86775576766: 37675?j~H376766: 37675BPhF376766; 37675ATNhF3766; 37675ASRNhF37668 37675BTRSNkH37675)+*+676769<;9676797676765667676767676767l8mk'kbddddddddddddddddddddddddbk'ddbbddddddddddddddddddddddddddddddddddddddddddddddddbbdd'kbddddddddddddddddddddddddbk'ih32LGGHGHGGHGGHGHGHGHHGHGHGHGHGHGHHGGHIHGHGHGGHGHGHGHGHJABGHGH GHGGJGHHGHGHGHI@ӉREH GHGGJ1FHGGHGHGHCTDHGHGGM JGHG HGHGHH9TDHGHGGM$JGHG HGHHGHI;TDH GHGGM#IGHGHGH GHI;TDH GHGGM#IGHGHGH GHI;TDH GHGGM#IGHGHGHGHI;TDHGHGGM#IGHGHGHGHI;TDHHGHGGL#IGHGHGHGHJ9TDHGHGGM%JGHGHGHGK=TDHHGGM$ CIGHGHGHGHJ< TDHGGM#  DJGHHGHGHGHJ<TDHGM# DJFHGHGHGHGH J576774M8673Ƚ@476771_u47677,x@476771Zo47 678-y·@476771[o57 678-y·@47 6771[~p57 678-y·@47 6771[~p57678-y·@47 6771[~~o57678-x·@47 6773_s57678.v·@4776772Qrmmnnmq`57679'q·@476770clNSRTM66767 683#r·@47 1_hSWVVXQ96767672.$r·@4771`hRVUWP85767671-/#r·@481`hRVWP85767671-./#q¹@51`hRXP86767671-../#qį@.`gTQ86767671-.-./#t;_kM96767 671-..-./'ch_47767 671-..-./)PH:<;N<4767 671-.-./&\:36561Yg85767 671-../'Z<5783Urb95767 671-./'Z<573Vnnc95767 671-/'Z<57 3Vojoc95767 671.'Z<57 3Vokjoc95767672&[<57 3Wplmkpd:5767 678+Z<57 3Ujfggfj^767676771^<5781dy376771_<57 82b476771_<57 82b37 6771_<57 82c{37 6771_<57 82b|37 6771_<57 82b~|476770^<57 82b~|374c=57 81e373P|vwxs;573Xsnonpn67678467676754376676767676767676676677676777767677667667676767767669876767747767669%  37676774M86766838676771_u4767;37676771Zo476766:38676771[o576766:3867 6771[~p576766:3867 6771[~p576766:38677671[o576766:386767673[q576766; 38667683Q}~|i37676:386766<N}~s;576766:376 :N~~s:476766:3866:N~~s:486766:376:N|s:486766:27:Ns:486766:2<Mq:486766:6S|8486766:@A376766:-430R>486766:49792hy9486766:27671ar:486766:3867 82cs:486766:3867 82b}s:486766:3867 82b~~s:486766:3867 82b~~s:4767676:3867 81d~~s;57676766;38672Y}~|j376766:3867 5Djq576766:38675GPgo576766:3867 5GTNhp576766:3867 5GTRNh~p576766:3867 5GSQRNhp5766;3767 5GSQQRNgo4766838675HURSOmt47669&  37675CMKT7676587676764776767676767667667767677h8mk \\\\it327CFIIHIHIHIHIIFIGGHGHGGIHIGGHGHGGIHGGHGHGHGGHIGGHGHGHGGIIGGHGHGHGGIIGGHGHGHGGIIGGHGHGHGGIIGGHGHGHGGIIGGHGHGHGGIIGGHGHGHGGIIGGHGHGHGHGHGHGGIIGGHGHGGIHGHGHGGHGHGGIIGGHGHGHI?@A@AGHGHGHGGJGHGHGGIIGGHGHI@ѣREHGHGHI2FHGHGHGGIIGGHGHEUDH GHGGM JGGHGHGGIIGGHGHGHG:UDH GHGGL$IGGHGHGGIIGGHGH GHI<UDH GHGGL#IGGHGHGGIIGGHGH GHI<UDH GHGGL#IGGHGHGGIIGGHGH GHI<UDH GHGGL#IGGHGHGGIIGGHGH GHI<UDHGHGGL#IGGHGHGGIIGGHGH GHI<UDHGHGGL#IGGHGHGGIIGGHGH GHI<UDHGHGGL#IGGHGHGGIIGGHGH GHI<UDHGHGGL#IGGHGHGGIIGGHGH GHI<UDHGHGGL#IGGHGHGGIIGGHGH GHI<UDHGHGGL#IGGHGHGGIIGGHGH GHI<UDHGHGGL#IGGHGHGGIIGGHGH GHI<UDHGHGGL#IGGHGHGGIIGGHGH GHI<UDHGHGGL#IGGHGHGGIIGGHGH GHI<UDHGHGGL#IGGHGHGGIIGGHGH GHI<UDHGHGGL#IGGHGHGGIIGGHGH GHI<UDHGHGGL#IGGHGHGGIIGGHGH GHI<UDHGHGGL"IGGHGHGGIIGGHGH GHI<UDHGHGGL"IGGHGHGGIIGGHGH GHI<UDHGHGGL"IGGHGHGGIIGGHGH GHI<UDHGHGGL"IGGHGHGGIIGGHGH GIFHUDHGHGGL'JGGHGHGGIIGGHGHFPUDHGHGGL$CIGHGHGGIIGGHGH FNUDHGHGGL# CJGHGHGGIIGGHGH FNUDHGHGGL# DJFHGHGHGGIIGGHGH FNUDHGHGGL# DJFHGHGHGGIIGGHGH FNUDH GHGGL# DJFHGHGHGGIIGGHGH FNUDHGHGGL# DJFHGHGHGGIIGGHGHFNUDHGHGGL#DJFHGHGHGGIIGGHGHFNUDHGHGGL#DJFHGHGHGGIIGGHGHFNUDHGHGGL#DJFHGHGHGGIIGGHGHFNUDHGHGGL#DJFHGHGHGGIIGGHGHFN UDHGHGGL#DJFHGHGHGGIIGGHGHFNUDHGHGGL#DJFHGHGHGGIIGGHGHFNUDHHGHGGL#DJFHGHGHGGIIGGHGHFNUDHGHGGL#DJFHGHGHGGIIGGHGHFNUDHHGGL#DJFHGHGHGGIIGGHGHFNUDHGGL#DJFHGHGHGGIIGGHGHFNUDHGL# DJFHGHGHGGIIGGHGHFNUDHL# DJFHGHGHGGIIGGHGHFNUCM#DJFHGHGHGGIIGGHGHFN UI$DJFHGHGHGGIIGGHGHFNYDJFHGHGHGGIIGGHGHFN4EIGHGHGHGGIIGGHGHFNM@DCE*@JGHGHGHGGIIGGHGHFN WEJIHNEJFHGHGHGGIIGGHGHFN UDHG FLCJFHGHGHGGIIGGHGHFN UDH GGL CJFHGHGHGGIIGGHGHFN UDH GGL CJFHGHGHGGIIGGHGHFN UDH GGL CJFHGHGHGGIIGGHGHFN UDHGGL CJFHGHGHGGIIGGHGHFNUDHGGL CJFHGHGHGGIIGGHGHFNUDHGGL CJFHGHGHGGIIGGHGHFNUDHGGL CJFHGHGHGGIIGGHGHFNUDHGGL CJFHGHGHGGIIGGHGHFN UDHGGL CJFHGHGHGGIIGGHGHFNUDHGGL CJFHGHGHGGIIGGHGHFNUDHGGL CJFHGHGHGGIIGGHGHFNUDHGGL CJFHGHGHGGIIGGHGHFNUDHGGL CJFHGHGHGGIIGGHGH FNUDHGGL CJFHGHGHGGIIGGHGH FNUDHGGL CJFHGHGHGGIIGGHGH FNUDHGGL CJFHGHGHGGIIGGHGH FNUDHGGL CJFHGHGHGGIIGGHGH FNUDHGGL CJGHGHGGIIGGHGHFPUDHGGL BIGHGHGGIIGGHGH GIFGUDHGGK JGGHGHGGIIGGHGH GHI;UDHGGLIGGHGHGGIIGGHGH GHI;UDHGGLIGGHGHGGIIGGHGH GHI;UDHGGLIGGHGHGGIIGGHGH GHI;UDHGGLIGGHGHGGIIGGHGH GHI;UDHGGLIGGHGHGGIIGGHGH GHI;UDHGGLIGGHGHGGIIGGHGH GHI;UDHGGLIGGHGHGGIIGGHGH GHI;UDHGGLIGGHGHGGIIGGHGH GHI;UDHGGLIGGHGHGGIIGGHGH GHI;UDHGGLIGGHGHGGIIGGHGH GHI;UDHGGLIGGHGHGGIIGGHGH GHI;UDHGGLIGGHGHGGIIGGHGH GHI;UDHGGLIGGHGHGGIIGGHGH GHI;UDHGGLIGGHGHGGIIGGHGH GHI;UDHGGLIGGHGHGGIIGGHGH GHI;UDHGGLIGGHGHGGIIGGHGH GHI;UDHGGLIGGHGHGGIIGGHGH GHI;UDHGGLIGGHGHGGIIGGHGH GHI;UDHGGLIGGHGHGGIIGGHGHGHH9UDHGGLIGGHGHGGIIGGHGHGHHCUDHGGLIGGHGHGGIIGGHGHI@֣REHGGK' IGGHGHGGIIGGHGHGHKCDGHGHGIKJGHGHGGIIGGHGHFHGHGHGHGHGGIIGGHGHGHGHGHGHGGIIGGHGHGHGGIIGGHGHGHGGIIGGHGHGHGGIIGGHGHGHGGIIGGHGHGHGGIIGGHGHGHGGIIGGHGHGHGGIHGGHGHGHGGHIGGHGHGGIHIGGHGHGGIFIIHIHIHIHIIF96676767669677676776766767676676776767767777777776776678776767767767811212676767747767781_>576775M86774ȾA476771_t477676-z@476772Zo577 677.{·@476772[o577 677.{·@47 6772[~p577 677.{·@47 6772[~o577 677.{·@476772[o577 677.{·@47 6772[o577 677.z·@47 6772[o577 678.z·@476772[o577 678.z·@476772[o577 678.z·@47 6772[o577 678.z·@47 6772[o577 678.z·@47 6772[o577 678.z·@47 6772\o577 678.z·@47 6772\o577 678.z·@47 6772\o577 678.z·@47 6772\o577 678.z·@47 6772\o577 678.z·@47 6772\o577 678.z·@476771\~~o577 678.z·@476774_r577 678-r@476772Opklkp^577 677%p·@476770bhOSRTM667677 6770$p·@476771_dSWVXQ967677 676//$p·@476771_dSVUWP867677 676../$p·@47 6771`eSVUVUWP867677 676.-./$p·@47 6771`eSVUVUWP867677676.--./$p·@476771`eSVUVUWP867677676.-.-./$p·@47 6771`eSVUVUWP867677676.-..-./$p·@47 6771`eSVUVUWP867677676.-. -./$p@476771`eSVUVUWP867677676.-. -./$o@476771`eSVUVUWP867677676.-. -./$o@476771`eSVUVUWP867677676.-.-./$o@47 6771`eSVUVUWP867677676.-.-./$o@47 6771`eSVUVUWP867677676.-.-./$o@4776771`eSVVUVUWP867677676.-.-./$o@476771`eSVUVUWP867677676.-.-./$n@471` eSVVUWP867677676.-.-./$n@4771` eSVUWP867677676.-.-./$n@481` eSVWP867677676.-.-./$n@52` eRXP867677676.-. -./$nð@.`dTP867677676.-. -./#q<_gM867677676.-.-./'ai\477677676.-.-./)OG:<;N<47677676.-.-./'[;36561Yf857677676.-.-./'Y=5784Urb957677676.-. -./'Y=573Vnnc:57677676.-. -./'Y=57 3Vojoc:57677676.-. -./'Y=57 3Vokjoc:57677676.-.-./'Y=57 3Vokljoc:57677676.-. -./'Y=57 3Vokkljoc:57677676.-.-./'Y=57 3Voklkljoc957677676.-.-./'Y=573Vokllkljoc957677676.-.-./'Y=573Voklkljoc957677676.-. -./'Y=573Voklkljoc957677676.-. -./'Y=573Voklkljoc957677676.-. -./'Y=573Voklkljoc957677676.-..-..'Y=573Voklkljoc957677676.-.-./'Y=573Voklkljoc957677676.-../'Y=573Voklkljoc:57677 676.-./'Y=573Voklkljoc:57677 676../'Y=573Voklkljoc:57677 676/.'Y=573Vokljoc:57677 676/'Z=573Wplmkod;57677 677(Z=573Ukfgfj^767677 6780[=5782bx477 6771^=5782b477 6771^=572c477 6771_=57 82c{477 6771_=57 82c|477 6771^=57 82c~|477 6771^=57 82c~|477 6771^=5782c~|477 6771_=5782c~|477 6771_=5782c~|477 6771_=5782c~ |477 6771_=5782c~ |477 6771_=5782c~|477 6771_=5782c~|477 6771_=5782c~ |477 6771_=5782c~ |477 6771_=5782c~ |477 6771_=5782c~ |477 6771_=5782c~ |477 6771_=5782c~|4776770^=5782b~{4774c=5782e4773O|vvwvxs;573Wplmnj6677678445676767532776776767676776767777777776776767767667676766767767677696676767669966767676696776767767667676766767767677677777777767767767676776776698767677477677669%  37676775M867766728676771_t47767;28676772Zo5776766:28676772[o5776766:2867 6772[~p5776766:2867 6772[~o5776766:28676772[o5776766:2867 6772[o5776766:2867 6772[o5776766:28676772[o5776766:28676772[o5776766:2867 6772[o5776766:2867 6772[o5776766:2867 6772[o5776766:2867 6772\o5776766:2867 6772\o5776766:2867 6772\o5776766:2867 6772\o5776766:2867 6772\o5776766:2867 6772\o5776766:2867672\o5776766:286767674\q57767676286767674Pz{yg477667428676766<Q}}r;576776742867 6766:Q~~s:476776742867 6766:Q~~r:486776742867 6766:Q~~r:486776742867 6766:Q~~r:4867767428676766:Q~~r:4867767428676766:Q~~r:4867767428676766:Q~~r:4867767428676766:Q~~r:4867767428676766:Q~~r:4867767428676766:Q~~r:48677674 286776766:Q~~r:48677674 28676766:Q~~r:48677674 2866766:Q~~r:48677674286766: Q~~r:48677674286: Q~~r:486776742866: Q~~r:48677674276: Q|r:4867767427: Qr:486776742;Op:486776745Uz848677674 A@37677674-431R>4767767449792hx94867767427672ar:486776742867 82cs;486776742867 82c}s;486776742867 82c~s;486776742867 82c~~s;486776742867 82c~~s;48677674286782c~~s;48677674286782c~~s;48677674286782c~~s;48677674286782c~~s;48677674286782c~~s;48677674286782c~~s;48677674286782c~~s;48677674286782c~~s;48677674286782c~~s;48677674286782c~~s;48677674286782c~~s;48677674286782c~~s;48677674286782b~t;476776674286782d~~s<576776767628673Wz{yh4776766:28675Diq5776766:28675GPfo5776766:2867 5GTNgo5776766:2867 5GSRNgo5776766:2867 5GSQRNgo5776766:2867 5GSQRRNgo5776766:2867 5GSQQRRNgo5776766:28675GSQRQRRNgo5776766:28675GSQRRQRRNgo5776766:28675GSQR QRRNgo5776766:28675GSQR QRRNgo5776766:28675GSQRQRRNgo5776766:28675GSQRQRRNgo5776766:28675GSQR QRRNgo5776766:28675GSQR QRRNgo5776766:28675GSQRQRRNgo5776766:28675GSQR QRRNgo5776766:28675GSQR QRRNg~p5776766:28675GSQRQRRNfo57766;28675FSQRNeo57766828675HUSTOks577669&  37675CLJKJR7677658767676547767767676767767777777776776767767667676766767767677696676767669t8mk@ZZZZic08E jP ftypjp2 jp2 Ojp2hihdrcolr"cdefjp2cOQ2d#Creator: JasPer Version 1.900.1R \@@HHPHHPHHPHHPHHP]@@HHPHHPHHPHHPHHP]@@HHPHHPHHPHHPHHP]@@HHPHHPHHPHHPHHP DQ߂(#[5h^q6Ve*O㕪x] %;V({o(K_ϵU"ovA懡(?eYkg* Hؔ إ9Ժ=:i߂"5a;q6 W3M:y.* BYnXPǍ߁ ɌU c"ZM" _<(ÏJguTOstCfY"o7O5y?}e<|i>I6eꮟ?.'+c)R6:#Xaf;/R8 ڧoVcdlͲskg zUnB$9.Ҟ,RZDӭ n?j14%E߿DC &VV*bişVrU>o*+h9YL\Fdxu?>P#YBPʻR[!5%tN.4ɜme"gT@&yX0P Ϯ8|$N5nJPV|^xdj_-gsiXi?\kN{2Wkd ~!? ʗsx˼2V%gisX#Q]mip2O6P-,_d*#5*+DdM |u$fkh.Z*#6d{—hH%LEf'ErdjFsP.j_@&w=[> uI#$'Zvwnvm[ATnR~B6VAҡj9f!Tipk"Ի>G/zhj3!?SOœ8̒~wg9- +LD>x^֗(ֽ4:zbk x\d4Ԅ0|̫, ʰ(;\")Hf=zf*0Bs 3?W߱ @,V'se+9rY͕jbš_ۊ0 #u>妿w!ioSS _:}[ֽQa54w0.߇IjgeZHHpofFs]ćfOp:!v~']C5!@ }68]EGRM箹Rw_1nϔR3V!Zട"ݖax.Y)JL&vty臦 ` SUS0yZiSzF3iMP+].绵1X5/RMCz8o~zE|0KAkr5meWM? J D_gKll)WmZ/%z[;hjSEɲ&R] A̪ wmӌ-H݅T4Ύ&j#fmՠdԺz'vH6 $0T3#^8QU=az IФYF ƾʿ~vv`oEn`SM=0 sBmWIi:#.L4o #}H| pj=[c`H;̬!rLu&v 65,'nW5ëdT~Uد-hx_bKk'k7O1o8 p$ӹ={ē^A 1H+̨tqa13=)B+#e7XT0vief?n~ۙMCW/HWX C>3J}ҀVtmh;9s B Nkvzk9{)MCAK. 5븐|o B?1й!UՐꃄR㠌ӊ>2ǖ wPcc"/8ho(?ё$3覕3"VVY>:?.$K0 .gJ짱-;ŀcɠar41\%88a %$50^6I𘶖DOzѱ##`ݓ Y" = Xww{WP$"t1SaZQlɖ |CWg_PiFĚ6zߙMOP`Uq$mNamXQZf$t'R(_4p Ğ"hkGn@}" Ja& ^uЅ/1_۩>,l~twa36+ZrP-o}c{ Zp?pj"̕lk]L% /xO:/GWiC<ӜQH(cToSxԯc%Lr(khb|rXѧm'k=хV"z[`$V(ƚXRY}U20޻kScƞaG'R Rx~7r#=O\-:"W,`^;:MOM -՟m"9mGQӧc`5H' qPfԍmtZ~cV TcߙьI=ZOA72&ѥ VmȆG##jG=J|&"."8 &w'@]I*)EHm.LJ{[1 F;j> ST#((*]*췒z9:{ݠ-Ff)Ag hBj QsÎa:c/wol# }=J/]o(,VOLf ,@h%ғ~sIWS90e<Ţ`_&[|јeRc۪$>H?lK  7$ecBN"ٖaС߷0GZt-Z:WFY%R))s7ޓ\t~VK~HDE_6WN$,.oȺ 29Ȫ,C-H9*By8GjhF$_]/&8816reTؕY[ꩌml1 ^\X,|pb3_wzl~:^eˋ3ɺ! ~g=Vt!0 |.ԛDy9P6]edBPH8Ljt|&`*N(#.'!%7!Qz$@Z*v#1*:@nZr* LS,ݳ@a^u>|Cs;@]>g1ЂgYG-I [Ln9r#ҁgWE9Sqx J@7QO-baUL lިw#֒{EgDt9tMtOmndP-P63F Kd=s|ݞCN= zYP1P氣`wbob<dzx;lQ5GNL%}ET񗲡 *.MLNMӛ=%|EdbPC1( +y h/cG+BSi1FBT&cn< Wb{wN$d Tqd'Uo]7cBf_0I~Q3y>u1kl(}W>"Gêʐw~X"*:B Qq+ WADA}bb4 mńntbIxbC W|$Y"祬/!eӂX5dB* Q lڏXtYo1+,Xʞ {qw7'z|mf?N7j#*a*dL>*NQfB7PM5܈BZ27pq5C5_ŧA_kzoQX(ߒ~>~='i{dۘbl® tKo @$<,7pl) ;%RޒS.|N|Nn?J2DUخq'YDn};b]NTahjQ? õ%;^ f>xlsc5Bw6.[L4%ȹSpη/;I( P&U[NCxqb1,҇HU6әt.X'G~Lo}$;L1@׿t];Cᨃ!i㫋eC~m: SBB=$wS$e5(Ce#:>r2j9 =vSyVd 61y4ARm`ی)uhOR֤,h1Hx\p']"joJ^~ F@mAۥQ/v(9^mC_fnj@fL&|3S.PLPMkj-v=H!UlP#HqJaГ ᰒ&&"黡}s !sB0/L@*lK]n#2\X-Du+̵Lb3`UٮĈBͷ~=cR $}>7,bf,,& coJ}b V(!6mfA{ 99L 2r%0)H)]`&IIˬ 8'&Exɵ/pfG(BF{5MB7Tnah4]#v{O~/ G<|G=W (˽螚`F]S ^םhԖӵJ \[dnڻ„mɷfA,NI.q=ԣjzV[`g-[^)5 O`*ąW(Ϫk\/XѻopDg>KeFsJ8{" rB̮3 ]dՔYQ}qѠ(2PڞQa{'YJ~ІV$^lVE'&sbdC*(T5q@ TPP FsA *YeJIʭr1H5 |DqkNq.ʢ4{7)Z#DبIm2@q3[Ӌ0w70Y ;#3rSg)Bst)-&6WOpԌJۙOpچwQɵJ8*% ?~iPx.x",S'~Z?hP:7}'X6o?O쯡^=kfNCx)7Z\lq>sxHn(M'w@7>"FǢhB,;A@ -a=,Vy`47cԮIkhۿ^sJRNkWӁyL4þ7ɷ5t|'y93Fl$ 8k;+{R>D"`]_XƅYvDd@k:1c1c/hK785V0%_|%;$<zq VMu@0 CcZ;1P>O8:S҉%8 $%Ս*QB|T›>`8j[E !q *| [4 + H7"p5(5ԕ+OQL}C^jP pΌ6+AݤLyIOs2ޑ\DB=w|! +}M5Ⱥ]Wkf[ͫ!Gʄsߢd[K Y͉4e j'caAf}'2ȧdev+񽐩?ެxl륤H {UD3H~Th#_QjD֓iODZxcq6>@ADhUOAiNܻ@buagW?T>>&/xMF%z ^GU0h"[If:xd HjΙpg`?yI FPnj)b4slGC$bObn=%7+!nQDa] pq#ݹ܆*zddEB5Z/LgƟA6;}}b ?CE/AOo񪵕K. 35%b5J|vk[s@CBkC:<҂S_z%^@P)˗`3:#Qeߝ6ln5#/pPȭU$ )J-3 /BP }18@G]5wؓ>\[]bܰ-K]\(pR q-Q0b `]v)ZeaM)C{2&Ad%xk$̿OKr+Π|oI+Ig<ʯAr?!ڛ^Bx54w*Vw"&[+9k;("`\H?W/8 zHDŽ7RʯJ{<u8p 3kwdxz3럀7`6mY(vF܈t/(m|CK]r}; ?.|o~$'9>ʿ栌BfBQn|>݇ۤ@EsOdq2cYC*Y|nc$)_ RϓV^ PCT;e.{0tF`D6mdtR=/LZ~2󽖨k5R#uN\A6ΩW!ˇ:!d$޲)FMC` "~GۮFE9S9ckUɶHucm 8{*8?gj>iplMT$7_o!sS%׵I@hjP n d(a ܶdJ?݊rGbtHpds"f$y1:M2Wn-|Ia6qJT鲽PB:S)87nTE\jsR %ockZm*5?X!H_]?lJ 4jY;z|/V1 hd 6N z8mñاFJĩ'_(/~}&K.&}9b.`"_7OWM d&d4sBNyWQc(,j忨9>K*qm RCO\ Mkm=4WLMg/ ~0Ĕ`?Ƞ<f.Dx)u3voJrv>4oUoEoZ/?NXeoOϦ I."_7{*/|{pl/X%LfRFb>Kj&sx|" lPWQ ]Tʙj[=[i4en0RI$I$I$I$,UiN/Lu; #5N6ԂFtWúpmQ3mW.zZmn&!*jČ@gRWX&mmmmmQp'){.LJǔ a1a`XVt0'r+ڗ/ĿWڞ=WPOkEht ɈUݞ@X]%jۼOY.`s9`◱7R+.0`wjQs0ߟ[\f:OFG#[7lI%]ٺ7ܽy 3ʙ\ bboގHk$w?{1%NHViAnbŝL1,"MPM8F !xYRw{45LT2q]q 5G4pH[ cۤx7m ӎ/[$Ÿ0ˣW*@;<WOY~M8E 歘 6%20NHe\e&bf&bf&bf%7+}m.մV][Kium.շ 0{#auV][Kium.մVJwp:VleD0X,5^gg dT$)pVnF* Yg*2T.B\$)^,j>4+{o _[z_UۣG7@mkSwd~ڶ@ݘSWGVsbkt ;ɸv .,;_{6e !?tSCkE(N0ZL[:/#[e8YYk&Z s햗:mpE:TSNmupoմ!V5sTJ_U*;;ݼY6+b/ C!spN< U[O2x Q}&V!`t;'hC]ηL~(w.L6j"K~#l+_&"\ȓɱ&d m$^, آVX9YBހEG7Wt[6HUS!o^ixa 8:xT٫C9ujC@p 5:؊-(Q v/3yLOhqTn1qk:<6Gڻo[kcXp>3 G`%VX+ fr3*}Q%Y%KCs<_ܲȣss61\<6 DW'h3k@K F ;;Ħf ozBa_

DŽ1xS)iˣK;e`mSaŃ &bvה%fF.}ŋ(<A!@ukyGi0= ǜ8iK~tJPk"_Q $!$`ɸ7~I@Ab oVY:DWo8mvܠ)ʒb3Q۳fې3ʘ1ޛo`Z5ָ,o-#X9s3`9v;B8|<z_~ :xmzjoπ VUoJ: ȣHMls~Ury^΁'tda/%J[lt~r#y^JcNUl7٧$>q_d+Y>ә)u㍖܆\)~BN"pBU/LvEd]G?z+W3Գz uכ*Խ.| Jy.;(űHsG#o+K#0*qH,'\}{7 R`d287x\ %@:J}7jApFޜB&.JR$bZmlSW}}]xm3d_r43+] ߚ9=2S]H> R@<@G 껵bqgr7k3܏sŻJW2upΚ9)J&QFLU4܇Pc<6x`{.!B ZE\|>1!ޓ,!˄+Ć=rO$ d4Y0|!&aaՀkDo!)뛭$?zs.:'w+H??WoZw:?s$nLWyJ%ͳ$s!/25&͒Јq`%^zwض3w萖u:pG틇r|ߥ<)j'apHc,al2T3̉6 1>.^Z 2%E=꒱~f.gnvK]<̭j 8iWKbD,K8! wpF>B 4H uf9kُERl~te";*57y-׺8LxoDHѧKTF2)x=~SrmxKJVFJʵ!acm 4z s:ɜ!c$>$ w&p'*L3= G43> ex̛/*6TV:lEYĝxޠ@[A}ՇΗ!(18O8ϊR q^g*uV̈dBnٮ7бӺ@O _5$NQ_95C!SUdrR "BOW#9P3Y82)m12eq哘"c${1"0 xj- Mog-.3'dnsp"H'v)緰\˂llPHGف,a=6tXx}]SRu?X5"~GhW܅T.VgϛG.̩­A. f,0 v>ϞմGwSUzU$enxnϯTnHFf5U 4s'^6(MZ?BW)cb:y0s^}vj\d#w,I-A/ $ ;%? ۯ -p[)Ѧ\kcӍӪYK1BuwasǛH}6CXF w"齃;*ˍjj Jׁv}0w"PG ]$\}"44u^#"}s z'w 3iq7H% R [@'(;_?g5!olbʈ0 K6jN5joipǃ+i1 ECWWA&giwՄ)CrKDł"&V偪hZXf÷׿Ҡ,"`RTk"&$x*D%)E]xq(] 8D΋z‰-ަ9t2BuGJrcjčDS'm)o$nG7/prZ WHɑ40"7}FƚN eo`q+pBUⶮXI9 $%H`jEsBjɤh>Zx6F*h'0-G\=iNUˣ7 љ|6O0!XCFAv\1 @'3@Qy<%bi&Bw|er>JsGQ>Uq5+Io+/071d<9 :PhZ}naz^\y1]7?#+ϡ0PG |uFQOU1/NvDؚr) AU' H>:`nvL[;QHnEHK.&a3'¼^J'NmZ0 eU4Bpn|? MhHtᨕ(,q>׋W}Ge~wJeq/;lF b˻ii2WtY? 2F6"*#$"X p@a!.#o.wNC*gi~t)&f[k)Pa ԩ#+_jjTeC##6fIE0R %@E+>b_P[pc,CV*gt94hz,0}yև6UiaH(n**q}KcX.1z~'7Zյݛ:Ϟރ\\G.Lc*P)1̵ӗN}:Lz{Z5.dXf1$S6y:ζCoFz9:>S9c` ꤔҒAm}`nvJOI.-K%&T~)Q1>LނV'ZeH6w|7A΄:uw`_j}!jFld@r86#^`P 5Q{S Ǚܽy߱3W,_ZJа"(М!~YsAD aX>c{j^y&q E@(1 = CI~G!ʛ)'(5`gjѧdGI<6;:X쬎8C!78%S`|^3=1e2RXLJᕶ-3k?7ʮnId\դ}Ck aȿֱ܇bĩt L wvWӻNjR~7-5(ޢB Z'2+~m{Doo}'|[|_X~h*_ϸC:oUGrj󇽢 8[ 0n^[VaI"Y.F}EH )TvAfsV b9d!W Æ5KΔ;D`HV\}R\[VBؐi{}m.F7ic7l6 ^xdnRVk>d(-½3`O*Rc(uި? 3_teabȇ>k3kS!OnjCU''Fߋ`v9[&)pb&2nPq w\{gMwR)da7&pGBmY} ݪ G@ QT7'#@Frή> [i̜%<?W+48+?Ab ^r#Q(&eT`!3NNk \Q[u|ܷ.a?-a{ aD&蜖5G,B>Nv <9=PL27p@RnHHX4<7u~]C 2 z?Ʀ#T݁p.)* p FF^Lw ۇ_Jyf̸zeʁ#:G=㢎m5 b!_A ;>3"O`ߞed2Yqxo;ۺj~i- tr N6)jC߽ 0oBM錄_C©p0O뒧4}\f9O-R)+^gpc:f8C7s5˺Wcߓ(Zo}p_6QRIwe6ky8u j}Z@Al^-`^zb%@SgIX$/er@ߜ2/H%@m5e i6u hq}|# AY4\gOo+KO:m8W0$/MJzMPҿ(v1spaҠBҐPUŽ1Iؽk->$Vl|'4GKAzV#d[?c?a@:0Q  tWIQ~JZx ˜ZP`0H?uYWVGd=Gh!8Z {eҏ^ƖhP+GT\| viQ<@?(mPbҞ~xSwVc>΢;ֆxtj^y&q E@(1OS ٖ5_gT M]DV裹䳰`0b#Il ApϦ(5`a@PU6mOxTU%Ն 枫NcN!ck\V7MKZ!˵Sd,)=Y\T&w{;pl49•\J5heZKK]ar/%P蛘2DӢzR3MFR&q| ɨ _#N,$KlЁ->)Gҥp_쉓bW7(01,ӣSpX"X AP Jyasrd5x*-{Ew kIqL4<"_8 Qs_O1O+1/` $d63 i< wIRxfMZl6F*&|.@!x$@Fކ "#W̍d=opՊtw0 M 5pX+LصE6R4$ Hqo7Jfk,<9`xUp|"==B"DSۚ ̟oZe')%s  7C&'%P?.>ك7>߅ ֟v,]$f7fX> P׬Fh`uE- WT]8ɃQ0u3 W7\h p?E7~3ё= W#,Jaw$A91:WM4\uUKvy5 ]ۧq34JԷlc!+؎at@ckG;QU 7z9/d=\vq*ow (e.߅ ֝1 ~Zͪ`J:]1\s5fmSFT+G!RwEXVg$[pΈ*>b.;րU?'okN&޼#R_gdkn`k+~a dvwN"Ѐ kiG? Hq0߅@[3 Bl-pe~[VZ@]9v݄N߅ ֟v,]JJ@ClH@Zlͅ?wJNsDP8 5/=ms៪>! WYo%(lRrq`yS DvkKSԳ7xAMbRs:3Sœ8̒W]ɽG,;jrQ/e7Ǔt\*d]#Lg^36oޗf|Ә(ny2G\o7PL8>,*R{Ge4Hi2T'<ۀpa'9B)$qYA#calp&0RӴ38[ǰ*/hB O[G_[5ʬ)֦恺\ t״KI`zCԕ# *_D71m;l7 +rI+4/s;jQ^[eQV_1rSY#3E3kdzVD< ekbXQS|G쁃y%sNk (Ҽk28BQC✍^8;jc_m[ SNCy 9x.gqb̸u&!3JDŽ"a<=hѐU tڼ,KtPD+yV#<KfoCdښbsH~BOo0'(V`[) F]YxVS@r `A#^8Q VaV+JIj|+ 2|_&]" ]. p@gem2x>b 8}G2oTo;w͖ B (@ ZnGfzW\$8SU d^b̃ Bx2/;و427yXckEhq|@v ]Uruwc7oY$ș;b@kuM|3eSF΁v*0s5L!W. ] d9~SXɷEN `68<:O9ZcX:3ujTwyHWT}j=ʷ'|nc? [J!"wGt}OPM|Vdp$=a-c)Vծc "tS#tuk-F p8Xea9;,!գIX#( D]f_M>G2F@#T0R̨. I0Ge) 6ֺ oQmwH*UΙ͖hjT0O Bm9<+TjmadbG-oi`&ρLHrߙ]OP`Uq$lЀ #a+鄗_ $\^_\@aFrH=aGG˥2*U' ;5PR ww۪\>8l~twacsJ, q!N55,rj[zTIj#tE?sf뽗 ڪ*8#,ka'χ!a u<ف+7?|ŭTuQyVo~$ičP9r;L8͸Dd0M[(Aw$Nh#IzRƻJ+U ;I_Rٮ:1R٭.'kQ#t%z٩6siM9ۂ͸n%~%鰩LuL0V?4 3=%,ӭȎRz’'mѮu1.sIeV D+B(fsk,sxH;1~oK`=2pq+G@ڸ~Ҝ4}DEeIQs2}pP]jI9)[UmQ7,g}O_zmY5T)O3D铟YRr1IҒ_{uvN h$&f$|WMejf/x1D(Q%*mtA*fյ.Ib BUnp[}3Dș<|'0~9i V7GѢeD_.;p;#OLlɊ}tkus I{kP,n3M( ˪۫$U7 C_ǽhUՇ,cś=J5ٶn3/SMKeLeGhMjVJS)QGw+M-dS;92C¦?$ð{MuRU*g,ܕ]yQpGAʜxUŒ(mqÐW $O=ta%2#PPeJ .FmK Bso*wlQaU,Ѐ*Qvaʋx0%AO( 5x-&}މt}sJFP.nT@W$}3/U[avnŤ^&)Rz]f&W穚8i 9-e;Uo}ÔږS*=<>/g1_~1!"; (0@Mq٫ lfeދm dK 7v4PtV|w!EQnjϤ#^xy(BE΅7̍M:bZ^]%\#LdKc~)u[䊨DEvF1~}~>~=*1dO$d2T_g})_R?[E61kbfT|'F6eи?xP)#jDw=cՀ\T2pn) 5IHG?iQl:uš0'/Pk.& 򲵽8%Es[x:~~QAujhwlA(a݌Ͱfd&̓*6(I\ůE #r+I>c`A@l_҇H5\., 2֍sJt`#IAIn'+5NmIm`OhW)c[UgE]l2}1g}4y3Ge$Ux"o;'$[穜MIR.o9|1'?LXxkATdstmN|θ͠w%]Ӕ2'>>mA5%G \&x^FjܷL&T̓/)yLH#Use`Y^(^>Rt3h,7viRfX$a ľ w B G#"V*' FK=}%@Ls$8sn h"Hs~VUI$Zz竤>IsMU"<|}Cՠ>,ƛt\My_&&0_3I)tϦ+g.4SFzM-CB*tZ&"5M|YNwKkSw zi=gK=m.*3a~_gJE8 2YLhA#fO=f|FUJì#՝4DE)ZHga/%NEO|ErꤤXӊmfeð~OXQduj$z5PU?!̓kDXXbJIDU5]L E*Pw59>aؐ-=d!ۊĘaf{-b"ۿs'):fpD[a2ۊ֌g=] Ep 7K.GSpM7ZN5B,xiBw. AD MI;5Pr({ Sbz1!usT&/n"w_S"1+,#je i(^%~,i2^I pv䟡F4VMje_Uy81"2.Qib*3@3+U$9+D_EU}yE{eǮZผcEZ(HEWjBD YwK?|~$3 $ NS^]ZCA3zdY D#Dy/ZО 7]xN %d$cm}d>Q̭Y cҸv 4Ս)_vj/&QEU+ʌnS59-R蕛]Qp/"֓:C ItKaCn4"OvSûD8! kUh@cfD(Qg (:<1^iOTRapq$ DuRPb[k&B,L >A4W o&$-W55= U>@v9J^3t霙΂pu28q Ea o*!2uéWFR|R3="`S苲k4iR~ZyF3Vgl%Y#rhÎ' l$'FCMUJWTbɔ'Yµ?ɜ3wJ+5TmK 5teday覅8s*s;rZ Hs9 r;0Yg1e 4)ǟY#`SZN⺱3jCjA wg:e# {TKH/Ui]cتE):Lg+VHhXskCgk'0RN9 vH^.[ôƗќ(bC<>!>W04k@O@id$r<qqQ͘P2#}_Ax"EKW#pRiJsa=5Vm+ Xu$ fN\:#n5'!$G0傕x`,ݠ8%هۦ`mS-Z=~q J9ڜZף̘vMYL?:F\}3 & J | IE9 3T&hq&$u/usc~ MޭH;*_P| ~Xb1iSH0,"m" ` C̓`Ex9W= \V,QSwH3܌/OjSa  "˃$ he] {ďj"*t3,"azOFo)Ze6Wn`򋃒^7iN^bT)JVa?՛T0Apk6#v߃e ~VK6Ž7'@\^9ZC= p>kY: Ukp֭q[{u`aN&--H"ӥ^a!a 64/,]YuXdh*i+I$9"Ky$ -:+|o@`HF-Y5َ{LX]R`!Sr;I-O)*LJMQuK5T^d/<@*r +Y%,sOKt\J+-mY=-lwp֠_UX+*ug(rf} 0 ([<>Ԍ|=J4=~7S %b #W4d ]!TK_v|M*-4K(`ց-7̑ٲ{FDvmyTBYʄ$M,LC=4}RҤ`TWWu]T*.5|-b"Czu]-&SE>IT8)2ÂP!ނ - L*m LNVf0{SY O^ /n^^0g+_qlgR–>ѐgwd8BuU d%qZT%%oMmI 2<Y@lwooooNi){w/noooooooCAhmɩ|/)yK^R򗔼/))"N7!~jr %W 0 $ F-hL2 :1_6eP2yp# ȇJNgB|KK$a$)⧒ X!QZw{ˎi'k]лgZhyT_ŽShݘ9+n[mR^<;!=!mk*ȥ5@`xBJFy`cMj=Ei_` =kI ̈y[{|\R6G؊9`@F*nȧHgǨFXc;޷sDT% P*t4ԨpK .8V*O Dn/>Ce%d< (*E]?5R 7̒5&4WblT>/I| ±Yf'x)APa9Lŗ8IW(I: x%)OVl4K$rHzɹ-1t`&o)ute&tB1?0)"# _䢴k9&ƥnV߈瀅2@*’(O<,>Nk/ )+*d{Zc*Ә.4ʟO2"(\ն`uP^С`} j$H A%'JױK eoCL"+6˔?W2eqh|;ĩҗr+<>Y-+a=g sg>]bFP4Ľ՞Jvĉew*21=1Մ6{%Z^,X_{D !n a|󤻒TP5 `3~@[wFmjwafC%@Dbʿ CJ_~ƻt)D`D5fwkDXtab5?>pHE6s~.;*[E21>Juk-)w 1Lgz1 ͓I#QΎkf,#ڧnU}R]ٍ3LGw7>kܨȀl: $Х蛘ӽbhXbfk9zi@.%0x,g~=8hᗃ,VzhC'Z۪֫F~]l" +LI i?mi_VUo}V@~گ_Sݙ `&0q:R𵤪GVJT xi9QHxqD0ݥfa妼lxNCmJV<_?/'R8`>OA=*拴b9ҧij7 U/xz2ywv5{N"i{r f7KUN6 O-3۽g&,OOMU<`މ )ٿ%~)'e_ s6Xiuy:`?꡷K5a8LzؽQRmr9B@@CY˄xτVt` WzIx]=}m.մZp@FLNǺgI8G}(Qe;̏?RL2wV>ݎqpC񚢺+!R4'h6pVBF;i$$!ϖVp(u0wݶ]3,Kt4:NK:L/ o׾bVԫQ'HX\s]JA;=B8:` m߭1j("v Vr dLt-傿L3*JIZ^?_[YPSh&)'f2ʠ"#<#i4trkw^-PR:btv]y6!K-gmpT" z/¸zˡ}o$7R\)^KD9Y ڜn _,U"HN9 Ͳ[F! %Q^\ r@FHҧ. %zmHerN%#"8+ &N.; 8[0x. H [2! cs40 J#OOC qo lˏ/اQg^$=^[ -%w"^j5(p>VaRw=kLBZh55cHf8 `st]Uvٗf̛ጕ':jo'vǢs ύ4lg]*Rrk-Hh.L([IGzKXzVaku_M8٘/*'zqvIL50 `!^fxVm2*.TBCC{4A6Pe9#}eO%P蛘݄R;v0qOA6:V,V R (pDs古@CA>G@1- ղt>oz9bxm/ oۦ`_U݇V~ 6`~Ia=8d<1?O#^wgb|VT Hr2RoմI\F_{6=1+ѹ][KepIJ+ ʀ:\Ad5Ndeۈ'*CҌc=̍*)q?PJVeၦVLWB!WcУ8uAPSZ`')lQX到G\DFJi8LYAJn!lT#K80ƛ0ӎ@d@@@R@|Ȟ? B繧 t G VV)|0=3Ң_)ő&LNMG#ԸS'h$_ړQ󂡚ŒTK:@t&W~Dt!wFÛi>NA j ,epYj!woEͨ 7 IOhC#dqE[-k%/c~ Iބ`r6*;>^ȞG0K @a_xm 4:[KNW/@JH"si5f-^>p`8360\/@+xUkUkfOɩ_yj^ O̱˶fZ/OӐxm$(kvӉO$/atP輳E.R[8QtY ,Kp|8 FU6xdك&+< 翅&B__֙%%ǿ0Gije&p],=+ͫklʯΘI5AlS_a;ygI<8h d1% †iPF/W5Y/ާC_="JFM S@#0;a~)hj~*:f2H뎧>PO=|! ]ˊ|Q0IXkf"4 ι/^ ,Q"!"y0io~<ɀ0JicÂ"H^HB2Q\BCT2vՇ|l3c*#ށpÆ՜+'LOohn@%1dQnO)Lj*1=>cn%AE{.; a5. ੇuMЦaE3 ߣ$<C$2nyzd5lُ$N =Z{h-&K 0oʒD`c`nl.U8|" a ZM-hX}BSa[$kz@_Yz#Qs6^=(5#i4  #PH?߄ b'3 lb 7M{=ҜJho<Ԅ|QHKƃs&XyȂ(C2!,PR1= FѲ#A2h(b+L|dTG"|§}MX=(Kwi.:I +S@:Eb¯tgɫ༧jr).cU# !dUd/RKVʭVAN (;Fe=(QP;}+k<ʍUm%P蛘ӽbcl/>'ap1(`zP_n@W(G^Fi\£1PS[ 2 4͝$b{u?/&6K:H@>@JƤ(ְBPk K܂%Oy GO[(@lp ]oO$$ oܭW-9#l1O=oi;JCO_q8 ފ |WfWF%_~@^OȰBFGS7smUhz SHB)e o0ɐd14$HDa!/o0\CH&Ou˟u3`B_-FqXy EFĭ?-/)Q ߩwk~YCa}T'/QZ7NL?>H|ᯝd~'R~_Gg~vߨO8h d"<&nv@l1@19!Y0~bb9~W`-3SubV-%WJ3sjC ɷk%La=w(2[0 2EWG-/+&# I Kx6LJ珉ajhH`m7e~O|)cTd) FBPC-uuj"g`HIa!+m"b!/rgc' ׊7n;NICeO:#jǶ E|7{9Hj\L$+X*q*D$R76@HK:F*yn7F< $$/:: Gn4;a  dbɻqv ՏFR  UղH>"7IkP_{Ui:&*Ka?޷AU9ژ R5_D"B!JCn=J6ћ–[#04?DkP@Y%L&C|Uj QP*o)BXE/>KzFq^cla!/ v/0c%BJhMí#tBj jBZ,NHMoػ~Pxl%BZ#BQeWAX*M0Q^o. ꗾẉ%ʒ k^>4 QB!7Kj'?#IzScs!%`PmMR.6@xUm;Y&`ĹH̟qor utshS~X~#Y Ϋ87y+cqF/x ^иn<‹&u',W#sPc8WB$"@fp@rI;T8(60A 7y/Fr.Њ#P S?؛2򈊾ea/b\//hol^×cA]#)b&w[yu\:Wxy@ҙLۀhjާB@W.'Q"_J PȔv0-zT! P=D;R?;R?/'D !n '(a\3{x+STW ⻓ KL?OߩlMq88Fn]*)Di5!E:Iׇ Dg1XzX5J:q=&4-! `0 Ყ|DBAªseVc:]ZaƜS{SP/G ̺8/HUd& ]gѰ/2AíKH A'vBL]G㡚+EHIΔNf{ ĉDok2oJHm(@UuI8Fn]*)T4g}r$^ڙSnc7N{R|q'҅Tq}:"ZZ4KxQmLOj\r):L0yp񾦏)+էg?֟4+T|'>Bq=P>/|MQ_m8o~a8Osߞ~v7:?t9Gࢸ*"Dܖ$MjXKH0v |,zPkPئz-%q$mFg:J/59{DF xuldLwPcym0av3_?;bHZ|b\$_7׮0$ 1VdG6E5F?oKl] Ӟ9K^RSPC-u'Nmhg#o2o"C7ع ߆ َ硸BI ӠKCt(YNnzerJ|Scq&]Qށu{kNG)VC縿z;yw:g|*"'wk-G-k,Mqz%kS0Aøʣ7B4WIl (4vGdvGdvGdv>: hV|D27l  [͓>ꙸǔ^rP{5:껣53hӉU.([\E<.xGh5HXrk/oht97-:x}TDp cLǜ*quWͪRw#qKsHϟ#sY~A\Røy 5s%5ǛE KVǴ D_ G2nsV@=c#r;tWOJe!9TPC/oM{C˓0A1W9s̈;&̈́Bؤ !#s2ЫQA j'Փ㖡](XP%+ \}W]mG4㜿„deA2 1^U^[3(b.fEs&;y 79c臉ƆL*ƒk'c0ԡXgH qb |P=~Zj:]FBaU P' dGs޽ԖٽA;] SFn`P $˳R<: {Cܮk6) ڂ\b1rP2yn X%baQAOrd{GPC@HTdCBOtlINJ]4@˛ %%у{R#Dvr[Mp]3 \k~h;.ó#1N{~D#x'Z|IB#0O Ex/+HD\Ydᶼ 0?*<)WDEp{ͫ 0O)$K4:27#%xF&I"xCh<=vlXѬ-a-˃":DJhA>p""k녢iTE*u潴xWS/kR6 $#_9%@:mpHG :yp9'ySF9V-7d/g)Vle z $%ʭb&hB`XAjקּp?BE( -caK?wZǝ%U-6`n&IH 3*#@t[!$0 #ڗPj LX] Ҍ²T< zϹL3hW~GR-*LKP@*|l}S8ed\01ln00aA0`5͹쓅>&$⊾XئӺ~8&@:l(dcQCJe>3Ҿ!Z*{ 81f[$ǪeAu1O{:3jvedlu& "1CVP̘[.7=znFw<}6Y`rQiu;~$ll*T*NC%{[a>; p-e#fT>԰0H !n CgƑa=-Sw+Zȴ^H WzVaÇN" bFGI ᙽ*L7RRܵ&<8[l^# &g%M;Ir@3V&VQ(JL}1%YNoaѨ<#\(Х/G!)V~3qihYZ8QAUრ(U:dCB'EHIcg_Ic뭠{bv0` 茑܅~OcR?OUuI8Fn]*)T4g}rGX˕s{kvc"}Tq}:NgT%P mJ'O/f\JhAM$4[9uΓBP6pgo)W_9{ɫ?=~r?Zoay!lLη~rߞ>JO^/=~s?~wp~zQ־@=O/,EG`9Gݔ .G*v$磗 "6YZkEd d;PZcM.3R!O ?wUpbEIt%;bHZ|b\$_7׮0$ 1VdG6E5F?oKl] Ӟ9K^RSPC,p8Q0KoFsw-{ Z|7|7:%/YD 7YsIO(;Qǫb_7|7/59w8_T`L\i,Ȭўf545kE5j*+S˼,{ʤɵ3\Qqr<9S79dS4B,y<<:MgaQW8 % tE:0gCZպ JJ|D6{GYmώ.&lNL0uku|7a`/{S7 $TrÙ;g<˒2NuAøyRFLmE -{Zjs; a)b- ~#-EZn1Tatdm ~/QQbid& ~dF6?PC/oM{i芅ߣKel6 a#ӝ}FP2u̔(3Tݫcv)y7|}-wiOR[YpE4,AKhAwD,M /$jdz;i̬i̬i̬i̬i̬i̬i,BE%'DHX9C.fr`#RC޶ƽ{ i(^NѤY~}ߣGsplo9z$hb601OFMf'k'ޥ G0ZaC;,o\oxQ4$/øy>ZdˀOq[>.w[U)%MWKt./fy ^ h$%@* K,"rVasdb֤6>E4)S,.`ݿr:-,'*хa!O'׃uMT?+:{n"@ $$o:yp9'ySF9V-7d/g)Vle z $%ʭb&hB`XAj\oEP_{UiGbVlLojP))b[/{*dr]cRSA2P*> n,F DW%d .t&-Bm>0H,җ"06]d6291=W_nS sU]WE+2f0(FEN ZLQ`Nluxm jƶG0&[͖^0F$i-AUvɫVv]v7Uh;'gmjx/:3 ȻtI)lmm4*%.S͌-qn #CXϼ Rp3MյJc=]?b X^]4!c wpUʮ}awd<%1/`g5gGT¦x #oqNoW0SBv8[x6c0"}!? =WXȦsWa!/l*<3HNq!=Ra!/m`^ê:/8ڌ )+톃W]l˒~79{_`|@eHjM|ue(@ $# ~>%-g!(f3HA]o Ɓ)o{?C:n,vw}'bwP,?*B!~~IΟA6!}pxz1u|pY1*nT7/bV9?|8_%t%Y .L5\& YUEQTUH(*yHF#!; },?ތ8tі$اQ6%)6 Ů $6o5b Y!c ޡUPյC?a!, $% Bv%eAdUH?(Х[22Sefb&-'ǣx7#LLVmtb" q%п~#7>iGIB'EHIΔNf{ ĉDo~gI`&Ŷy\>NͪjTǜzW^FrW|ZEQ ?7`Y{z!_ ?|TM=H9@jgU|6tC9B`܏]t BvKόeP?8yT3_ڡ3qrA'~oF|E?$" 5}O( uuU5# V|7|7!w_7|7|7qbuooR ?O.k $#p ig@PN9l/ Z|7|7|70ooooooo ?O.k $#p ig@PN9l/ Z|7|7|70ooooooo ?O`ʕ@0{_fn('  X¶oiOB$w_7|7|7,8V|7|7v~TLΚWI(ݻzk~OHKݻzk~OHKݻzb9aF4B rH=} ސR!"S$6F*(RwoĪpH.X6t$Jsl2T@I/ĪpH.X6t$Jsl2T@I/Ī-^D MM 1A@1A@1A@1A@1A@1A@1A@1A@1A@1A@1A@1A@1A@1A@1A@1A@1A@1A@1A@1A?PN*C?=66I77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77G26Y /...................-1 ceA| @\C:>67I77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77G26Y /..................-1q.K]`"PgoMA;>67I77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77G26Y /.................-1p0G_68Ea$OgUmNA;>67I77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77G26Y /................-1p0G_86G59F`$OgUVmNA;>67I77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77G26Y /...............-1p0G_76G77H69F`$OgUVVmNA;>67I77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77G26Y /..............-1p0G_76G77H77H69F`$OgUVVVmNA;>67I77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77G26Y /.............-1p0G_76G77H77H77H69F`$OgUVVVVnNA;>67I77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77G26Y /............-1p0G_76G77H77H77H77H69F`$OgUVVVVVnNA;>67I77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77G26Y /...........-1p0G_76G77H77H77H77H77H59F`$OgUVVVVVVnNA;>67I77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77G26Y /..........-1p0G_76G77H77H77H77H77H77H69F`$OgUVVVVVVVmNA;>67I77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77G26Y /.........-1p0G_76G77H77H77H77H77H77H77H69F`$OgUVVVVVVVVmNA;>67I77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77G26Y /........-1p0G_76G77H77H77H77H77H77H77H77H69F`$OgUVVVVVVVVVmNA;>67I77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77G26Y /.......-1p0G_76G77H77H77H77H77H77H77H77H77H69F`$OgUVVVVVVVVVVmNA;>67I77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77G26Y /......-1p0G_76G77H77H77H77H77H77H77H77H77H77H69F`$OgUVVVVVVVVVVVmNA;>67I77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77G26Y /.....-1q0G_76G77H77H77H77H77H77H77H77H77H77H77H69F`$OgUVVVVVVVVVVVVmNA;>67I77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77G26Y /....-1q0G_76G77H77H77H77H77H77H77H77H77H77H77H77H69F`$OgUVVVVVVVVVVVVVmNA;>67I77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77G26Y /...-1q0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H69F`$OgUVVVVVVVVVVVVVVmNA;>67I77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77G26Y /..-1q0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H69F`$OgUVVVVVVVVVVVVVVVmNA;>67I77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77G26Y /.-1q0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H69F`$OgUVVVVVVVVVVVVVVVVnNA;>67I77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77G26Y /-1q0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H69F`$OgUVVVVVVVVVVVVVVVVVnNA;>67I77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77G26Y /1q0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H69F`$OgUVVVVVVVVVVVVVVVVVVnNA;>67I77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77G25Y 2q0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H59F_%QdUVVVVVVVVVVVVVVVVVVVmNA;>77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H86F1:Z s0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H59FPP'{k|m|m|m|m|m|m|m|m|m|m|m|m|m|m|m|m|m|m|m}md\88G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H76G5;Mz0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H::F\]#~nn99F77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H76G5;Nz0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H99F\\#~~nn99F77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H76G5;Mz0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H99F\\#~~nn99F77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H76G5;Mz0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H99F\\#~~nn99F77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H76G5;Nz0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H99F\\#~~nn99F77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H76G5;Nz0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H99F\\#~~nn99F77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H76G5;Nz0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H99F\\$~~nn99F77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H76G5;Nz0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H99F\\$~~nn99F77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H76G5;Nz0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H99F\\$~~nn99F77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H76G5;Nz0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H99F\\$~~nn99F77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H76G5;Nz0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H99F\\$~~nn99F77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H76G5;Nz0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H99F\\$~~nn99F77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H76G5;Nz0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H99F\\$~~nn99F77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H76G5;Nz0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H99F\\$~~nn99F77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H76G5;Nz0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H99F\\$~~nn99F77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H76G5;Nz0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H99F\\$~~nn99F77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H76G5;N{0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H99F\\$~~nn99F77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H76G5;N{0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H99F\\$~~nn99F77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H76G5;N{0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H99F\\$~~nn99F77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H76G5;N{0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H99F\\$nn99F77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77G4=Q}0H_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H99F]]#ll::E77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77G'\|2CY76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H::ELL499F77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H6:M5;N5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M5;M6:L77I77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77HY77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77HY77H????????????????????????????????????????????????????????????????????????????????????????????????????????????????????(@ @77H77H77H77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H 77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H 77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H86E86E86E86E86E86E86E86E86E86E86E86E86E86E86E86E86E86E86E86E86E86E77H77H77H77H77H77H77H77H77H77H77H76I76I76I76I76I76I76I76I76I76I66I76H77H77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77G2>W"V Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y#U4;Q77G77H77H77H77H77H77H77H77H78G?L3BT+BS,BS,BS,BS,BS,BS,BS,AS,CU,?F=76H77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H5:N`0A_76G77H77H77H77H77H77H77H77H8:EKnRRRRRRRRSiSe+65I77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77G69L`0A_76G77H77H77H77H77H77H77H77H8:EKnRRRRRRRShUf*65I77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77G69L`0A_76G77H77H77H77H77H77H77H77H8:EKnRRRRRRShUf*65I77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77G69L`0A_76G77H77H77H77H77H77H77H77H8:EKnRRRRRShUf*65I77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77H77G69L`0A_76G77H77H77H77H77H77H77H77H8:EKnRRRRShUf*65I77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77H77H77G69L`0A_76G77H77H77H77H77H77H77H77H8:EKnRRRShUf*65I77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77H77H77H77G69L`0A_76G77H77H77H77H77H77H77H77H8:EKnRRShUf*65I77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77H77H77H77H77G69L`0A_76G77H77H77H77H77H77H77H77H8:EKnRShUf*65I77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77H77H77H77H77H77G69L`0A_76G77H77H77H77H77H77H77H77H8:EKnShUf*65I77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77H77H77H77H77H77H77G69L`0A_76G77H77H77H77H77H77H77H77H8:ELoiUg*65I77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77G69L_0A_76G77H77H77H77H77H77H77H77H89E_t}~~~~~~~~Q].65I77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H87E5[0A_76G77H77H77H77H77H77H77H77H:9En`onnnnnnnne[<0A?0A?0A?0A?0A?0A?0A?0A?4C=SN)=;B67I77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H87F3........-1deA|        } IT=8C67I77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H87F3.......-1s.J\`"bagJ<9C67I77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H87F3......-1r0G_68E`$baUeK<9C67I77H77H77H77H77H77H77H77H77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H87F3.....-1r0G_86G69F`$baUVeK<9C67I77H77H77H77H77H77H77H77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H87F3....-1r0G_76G77H69F`$baUVVeK<9C67I77H77H77H77H77H77H77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H87F3...-1r0G_76G77H77H69F`$baUVVVeJ<9C67I77H77H77H77H77H77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H87F3..-1r0G_76G77H77H77H69F`$baUVVVVeJ<9C67I77H77H77H77H77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H87F3.-1r0G_76G77H77H77H77H69F`$baUVVVVVeJ<9C67I77H77H77H77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H87F3-1r0G_76G77H77H77H77H77H69F`$baUVVVVVVeJ<9C67I77H77H77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H87F21r0G_76G77H77H77H77H77H77H69F`$baUVVVVVVVeJ<9C67I77H77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H86E6r0G_76G77H77H77H77H77H77H77H59F!]%c`WWWWWWWWWdL<:C77H77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H76G6:Mw0G_76G77H77H77H77H77H77H77H77H68FWS%}su~u~u~u~u~u~u~u~uQO.66I77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77H77H77H77H77H77H76G6:My0G_76G77H77H77H77H77H77H77H77H77H99F\]#~UU*66I77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77H77H77H77H77H76G6:My0G_76G77H77H77H77H77H77H77H77H77H77H99F\\$~~UU*66I77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77H77H77H77H76G6:My0G_76G77H77H77H77H77H77H77H77H77H77H77H99F\\$~~UU*66I77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77H77H77H76G6:My0G_76G77H77H77H77H77H77H77H77H77H77H77H77H99F\\$~~UU*66I77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77H77H76G6:My0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H99F\\$~~UU*66I77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H77H76G6:My0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H99F\\$~~UU*66I77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H77H76G6:My0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H99F\\$~~UU*66I77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H77H76G6:My0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H99F\\$~~UU*66I77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H76G6;Mz0G_76G77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H77H99F\\$UU*66I77H77H77H77H77H77H 77H77H77H 77H77H77H77H77H77H5 image/svg+xml ksnip-1.9.2/icons/ksnip_icons.qrc000066400000000000000000000027331414701001100170020ustar00rootroot00000000000000 ksnip.svg light/ksnip.svg light/clock.svg light/crop.svg light/save.svg light/saveAs.svg light/copy.svg light/paste.svg light/pasteEmbedded.svg light/undo.svg light/redo.svg light/currentScreen.svg light/drawRect.svg light/lastRect.svg light/activeWindow.svg light/windowUnderCursor.svg light/fullScreen.svg light/pin.svg light/wayland.svg light/delete.svg light/action.svg dark/ksnip.svg dark/clock.svg dark/crop.svg dark/save.svg dark/saveAs.svg dark/copy.svg dark/paste.svg dark/pasteEmbedded.svg dark/undo.svg dark/redo.svg dark/currentScreen.svg dark/drawRect.svg dark/lastRect.svg dark/activeWindow.svg dark/windowUnderCursor.svg dark/fullScreen.svg dark/pin.svg dark/wayland.svg dark/delete.svg dark/action.svg ksnip-1.9.2/icons/ksnip_windows_icon.rc000066400000000000000000000000731414701001100202030ustar00rootroot00000000000000IDI_ICON1 ICON DISCARDABLE "ksnip.ico"ksnip-1.9.2/icons/light/000077500000000000000000000000001414701001100150565ustar00rootroot00000000000000ksnip-1.9.2/icons/light/action.svg000066400000000000000000000043741414701001100170640ustar00rootroot00000000000000 image/svg+xmlksnip-1.9.2/icons/light/activeWindow.svg000066400000000000000000000053771414701001100202560ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/light/clock.svg000066400000000000000000000054071414701001100167000ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/light/copy.svg000066400000000000000000000114321414701001100165520ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/light/crop.svg000066400000000000000000000123331414701001100165440ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/light/currentScreen.svg000066400000000000000000000120051414701001100204170ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/light/delete.svg000066400000000000000000000057671414701001100170600ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/light/drawRect.svg000066400000000000000000000133071414701001100173560ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/light/fullScreen.svg000066400000000000000000000146311414701001100177060ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/light/ksnip.svg000066400000000000000000000116551414701001100167330ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/light/lastRect.svg000066400000000000000000000135311414701001100173630ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/light/paste.svg000066400000000000000000000076241414701001100167240ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/light/pasteEmbedded.svg000066400000000000000000000053161414701001100203320ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/light/pin.svg000066400000000000000000000045341414701001100163730ustar00rootroot00000000000000 image/svg+xmlksnip-1.9.2/icons/light/redo.svg000066400000000000000000000075071414701001100165410ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/light/save.svg000066400000000000000000000066131414701001100165430ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/light/saveAs.svg000066400000000000000000000212601414701001100170220ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/light/undo.svg000066400000000000000000000075131414701001100165520ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/light/wayland.svg000066400000000000000000000201001414701001100172270ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/icons/light/windowUnderCursor.svg000066400000000000000000000107141414701001100213050ustar00rootroot00000000000000 image/svg+xml ksnip-1.9.2/snap/000077500000000000000000000000001414701001100135755ustar00rootroot00000000000000ksnip-1.9.2/snap/snapcraft.yaml000066400000000000000000000041601414701001100164430ustar00rootroot00000000000000name: ksnip base: core18 adopt-info: ksnip icon: desktop/ksnip.svg grade: stable confinement: strict summary: Screenshot and Annotation Tool description: | Qt based cross-platform screenshot tool that provides many annotation features for your screenshots. apps: ksnip: command: ksnip common-id: org.ksnip.ksnip environment: # Set theme fix on gnome/gtk XDG_CURRENT_DESKTOP: $XDG_CURRENT_DESKTOP:Unity:Unity7 QT_QPA_PLATFORMTHEME: gtk3 desktop: share/applications/org.ksnip.ksnip.desktop extensions: [kde-neon] plugs: - home - removable-media - unity7 - network - network-manager-observe - network-observe - opengl architectures: - build-on: amd64 parts: ksnip: source: . plugin: cmake parse-info: [share/metainfo/org.ksnip.ksnip.appdata.xml] after: - kimageannotator build-snaps: - kde-frameworks-5-core18-sdk build-packages: - libglvnd-dev - libx11-dev stage-packages: - curl - ftp configflags: - -DCMAKE_FIND_ROOT_PATH=/snap/kde-frameworks-5-core18-sdk/current;/snap/kimageannotator/current override-pull: | snapcraftctl pull sed -i 's|Icon=.*|Icon=share/icons/hicolor/scalable/apps/ksnip.svg|g' desktop/org.ksnip.ksnip.desktop snapcraftctl set-version $(cat CMakeLists.txt | grep project\(ksnip | cut -d" " -f5 | cut -d")" -f1) kimageannotator: source: https://github.com/ksnip/kImageAnnotator.git source-tag: v0.5.3 plugin: cmake after: - kcolorpicker configflags: - -DCMAKE_FIND_ROOT_PATH=/snap/kde-frameworks-5-core18-sdk/current;/snap/kcolorpicker/current kcolorpicker: source: https://github.com/ksnip/kColorPicker.git source-tag: v0.1.6 plugin: cmake configflags: - -DCMAKE_FIND_ROOT_PATH=/snap/kde-frameworks-5-core18-sdk/current cleanup: after: [kcolorpicker, kimageannotator, ksnip] plugin: nil build-snaps: [ kde-frameworks-5-core18 ] override-prime: | set -eux cd /snap/kde-frameworks-5-core18/current find . -type f,l -exec rm -f $SNAPCRAFT_PRIME/{} \; ksnip-1.9.2/src/000077500000000000000000000000001414701001100134235ustar00rootroot00000000000000ksnip-1.9.2/src/BuildConfig.h.in000066400000000000000000000005001414701001100163610ustar00rootroot00000000000000#ifndef KSNIP_BUILDCONFIG_H #define KSNIP_BUILDCONFIG_H // Variables passed from CMAKE #define KSNIP_VERSION "@KSNIP_VERSION@" #define KSNIP_BUILD_NUMBER "@BUILD_NUMBER@" #define KSNIP_LANG_INSTALL_DIR "@KSNIP_LANG_INSTALL_DIR@" #define KIMAGEANNOTATOR_LANG_INSTALL_DIR "@KIMAGEANNOTATOR_LANG_INSTALL_DIR@" #endif ksnip-1.9.2/src/CMakeLists.txt000066400000000000000000000367741414701001100162040ustar00rootroot00000000000000set(KSNIP_SRCS ${CMAKE_SOURCE_DIR}/src/main.cpp ${CMAKE_SOURCE_DIR}/src/backend/config/KsnipConfig.cpp ${CMAKE_SOURCE_DIR}/src/backend/config/KsnipConfigOptions.cpp ${CMAKE_SOURCE_DIR}/src/backend/config/KsnipConfigProvider.cpp ${CMAKE_SOURCE_DIR}/src/backend/imageGrabber/AbstractImageGrabber.cpp ${CMAKE_SOURCE_DIR}/src/backend/imageGrabber/AbstractRectAreaImageGrabber.cpp ${CMAKE_SOURCE_DIR}/src/backend/imageGrabber/ImageGrabberFactory.cpp ${CMAKE_SOURCE_DIR}/src/backend/uploader/imgur/ImgurWrapper.cpp ${CMAKE_SOURCE_DIR}/src/backend/uploader/imgur/ImgurResponse.cpp ${CMAKE_SOURCE_DIR}/src/backend/uploader/imgur/ImgurUploader.cpp ${CMAKE_SOURCE_DIR}/src/backend/uploader/imgur/ImgurResponseLogger.cpp ${CMAKE_SOURCE_DIR}/src/backend/uploader/script/ScriptUploader.cpp ${CMAKE_SOURCE_DIR}/src/backend/uploader/UploaderProvider.cpp ${CMAKE_SOURCE_DIR}/src/backend/saver/SavePathProvider.cpp ${CMAKE_SOURCE_DIR}/src/backend/saver/ImageSaver.cpp ${CMAKE_SOURCE_DIR}/src/backend/saver/WildcardResolver.cpp ${CMAKE_SOURCE_DIR}/src/backend/saver/UniqueNameProvider.cpp ${CMAKE_SOURCE_DIR}/src/backend/CapturePrinter.cpp ${CMAKE_SOURCE_DIR}/src/backend/TranslationLoader.cpp ${CMAKE_SOURCE_DIR}/src/backend/KsnipCommandLine.cpp ${CMAKE_SOURCE_DIR}/src/backend/WatermarkImageLoader.cpp ${CMAKE_SOURCE_DIR}/src/backend/recentImages/RecentImagesPathStore.cpp ${CMAKE_SOURCE_DIR}/src/backend/recentImages/ImagePathStorage.cpp ${CMAKE_SOURCE_DIR}/src/backend/ipc/IpcServer.cpp ${CMAKE_SOURCE_DIR}/src/backend/ipc/IpcClient.cpp ${CMAKE_SOURCE_DIR}/src/common/adapter/fileDialog/FileDialogAdapter.cpp ${CMAKE_SOURCE_DIR}/src/common/adapter/fileDialog/FileDialogAdapterFactory.cpp ${CMAKE_SOURCE_DIR}/src/common/helper/MathHelper.cpp ${CMAKE_SOURCE_DIR}/src/common/helper/PathHelper.cpp ${CMAKE_SOURCE_DIR}/src/common/helper/FileUrlHelper.cpp ${CMAKE_SOURCE_DIR}/src/common/helper/RectHelper.cpp ${CMAKE_SOURCE_DIR}/src/common/helper/EnumTranslator.cpp ${CMAKE_SOURCE_DIR}/src/common/loader/IconLoader.cpp ${CMAKE_SOURCE_DIR}/src/common/handler/DelayHandler.cpp ${CMAKE_SOURCE_DIR}/src/common/provider/ApplicationTitleProvider.cpp ${CMAKE_SOURCE_DIR}/src/common/provider/NewCaptureNameProvider.cpp ${CMAKE_SOURCE_DIR}/src/common/provider/PathFromCaptureProvider.cpp ${CMAKE_SOURCE_DIR}/src/common/provider/DirectoryPathProvider.cpp ${CMAKE_SOURCE_DIR}/src/common/provider/ScaledSizeProvider.cpp ${CMAKE_SOURCE_DIR}/src/common/provider/TempFileProvider.cpp ${CMAKE_SOURCE_DIR}/src/widgets/CustomToolButton.cpp ${CMAKE_SOURCE_DIR}/src/widgets/CustomCursor.cpp ${CMAKE_SOURCE_DIR}/src/widgets/CursorFactory.cpp ${CMAKE_SOURCE_DIR}/src/widgets/NumericComboBox.cpp ${CMAKE_SOURCE_DIR}/src/widgets/CustomSpinBox.cpp ${CMAKE_SOURCE_DIR}/src/widgets/CaptureModePicker.cpp ${CMAKE_SOURCE_DIR}/src/widgets/ColorButton.cpp ${CMAKE_SOURCE_DIR}/src/widgets/MainToolBar.cpp ${CMAKE_SOURCE_DIR}/src/widgets/KeySequenceLineEdit.cpp ${CMAKE_SOURCE_DIR}/src/widgets/CustomLineEdit.cpp ${CMAKE_SOURCE_DIR}/src/gui/MainWindow.cpp ${CMAKE_SOURCE_DIR}/src/gui/RecentImagesMenu.cpp ${CMAKE_SOURCE_DIR}/src/gui/ImgurHistoryDialog.cpp ${CMAKE_SOURCE_DIR}/src/gui/TrayIcon.cpp ${CMAKE_SOURCE_DIR}/src/gui/actions/Action.cpp ${CMAKE_SOURCE_DIR}/src/gui/actions/ActionProcessor.cpp ${CMAKE_SOURCE_DIR}/src/gui/actions/ActionsMenu.cpp ${CMAKE_SOURCE_DIR}/src/gui/clipboard/ClipboardAdapter.cpp ${CMAKE_SOURCE_DIR}/src/gui/clipboard/IClipboard.h ${CMAKE_SOURCE_DIR}/src/gui/imageAnnotator/KImageAnnotatorAdapter.cpp ${CMAKE_SOURCE_DIR}/src/gui/imageAnnotator/IImageAnnotator.h ${CMAKE_SOURCE_DIR}/src/gui/desktopService/DesktopServiceAdapter.cpp ${CMAKE_SOURCE_DIR}/src/gui/fileService/FileService.cpp ${CMAKE_SOURCE_DIR}/src/gui/widgetVisibilityHandler/WidgetVisibilityHandler.cpp ${CMAKE_SOURCE_DIR}/src/gui/widgetVisibilityHandler/GnomeWaylandWidgetVisibilityHandler.cpp ${CMAKE_SOURCE_DIR}/src/gui/widgetVisibilityHandler/WidgetVisibilityHandlerFactory.cpp ${CMAKE_SOURCE_DIR}/src/gui/snippingArea/AbstractSnippingArea.cpp ${CMAKE_SOURCE_DIR}/src/gui/snippingArea/SnippingAreaAdorner.cpp ${CMAKE_SOURCE_DIR}/src/gui/snippingArea/AdornerMagnifyingGlass.cpp ${CMAKE_SOURCE_DIR}/src/gui/snippingArea/AdornerRulers.cpp ${CMAKE_SOURCE_DIR}/src/gui/snippingArea/AdornerPositionInfo.cpp ${CMAKE_SOURCE_DIR}/src/gui/snippingArea/AdornerSizeInfo.cpp ${CMAKE_SOURCE_DIR}/src/gui/snippingArea/SnippingAreaResizer.cpp ${CMAKE_SOURCE_DIR}/src/gui/snippingArea/SnippingAreaSelector.cpp ${CMAKE_SOURCE_DIR}/src/gui/snippingArea/SnippingAreaSelectorInfoText.cpp ${CMAKE_SOURCE_DIR}/src/gui/snippingArea/SnippingAreaResizerInfoText.cpp ${CMAKE_SOURCE_DIR}/src/gui/snippingArea/AbstractSnippingAreaInfoText.cpp ${CMAKE_SOURCE_DIR}/src/gui/settingsDialog/AnnotationSettings.cpp ${CMAKE_SOURCE_DIR}/src/gui/settingsDialog/ApplicationSettings.cpp ${CMAKE_SOURCE_DIR}/src/gui/settingsDialog/ImageGrabberSettings.cpp ${CMAKE_SOURCE_DIR}/src/gui/settingsDialog/ImgurUploaderSettings.cpp ${CMAKE_SOURCE_DIR}/src/gui/settingsDialog/ScriptUploaderSettings.cpp ${CMAKE_SOURCE_DIR}/src/gui/settingsDialog/HotKeySettings.cpp ${CMAKE_SOURCE_DIR}/src/gui/settingsDialog/UploaderSettings.cpp ${CMAKE_SOURCE_DIR}/src/gui/settingsDialog/SaverSettings.cpp ${CMAKE_SOURCE_DIR}/src/gui/settingsDialog/StickerSettings.cpp ${CMAKE_SOURCE_DIR}/src/gui/settingsDialog/SnippingAreaSettings.cpp ${CMAKE_SOURCE_DIR}/src/gui/settingsDialog/SettingsDialog.cpp ${CMAKE_SOURCE_DIR}/src/gui/settingsDialog/TrayIconSettings.cpp ${CMAKE_SOURCE_DIR}/src/gui/settingsDialog/WatermarkSettings.cpp ${CMAKE_SOURCE_DIR}/src/gui/settingsDialog/actions/ActionsSettings.cpp ${CMAKE_SOURCE_DIR}/src/gui/settingsDialog/actions/ActionSettingTab.cpp ${CMAKE_SOURCE_DIR}/src/gui/settingsDialog/actions/EmptyActionSettingTab.cpp ${CMAKE_SOURCE_DIR}/src/gui/aboutDialog/AboutDialog.cpp ${CMAKE_SOURCE_DIR}/src/gui/aboutDialog/AboutTab.cpp ${CMAKE_SOURCE_DIR}/src/gui/aboutDialog/VersionTab.cpp ${CMAKE_SOURCE_DIR}/src/gui/aboutDialog/AuthorTab.cpp ${CMAKE_SOURCE_DIR}/src/gui/aboutDialog/DonateTab.cpp ${CMAKE_SOURCE_DIR}/src/gui/aboutDialog/ContactTab.cpp ${CMAKE_SOURCE_DIR}/src/gui/globalHotKeys/GlobalHotKey.cpp ${CMAKE_SOURCE_DIR}/src/gui/globalHotKeys/NativeKeyEventFilter.cpp ${CMAKE_SOURCE_DIR}/src/gui/globalHotKeys/AbstractKeyHandler.cpp ${CMAKE_SOURCE_DIR}/src/gui/globalHotKeys/KeyHandlerFactory.cpp ${CMAKE_SOURCE_DIR}/src/gui/globalHotKeys/GlobalHotKeyHandler.cpp ${CMAKE_SOURCE_DIR}/src/gui/globalHotKeys/HotKeyMap.cpp ${CMAKE_SOURCE_DIR}/src/gui/globalHotKeys/DummyKeyHandler.cpp ${CMAKE_SOURCE_DIR}/src/gui/notificationService/NotificationServiceFactory.cpp ${CMAKE_SOURCE_DIR}/src/gui/operations/SaveOperation.cpp ${CMAKE_SOURCE_DIR}/src/gui/operations/RenameOperation.cpp ${CMAKE_SOURCE_DIR}/src/gui/operations/AddWatermarkOperation.cpp ${CMAKE_SOURCE_DIR}/src/gui/operations/UpdateWatermarkOperation.cpp ${CMAKE_SOURCE_DIR}/src/gui/operations/WatermarkImagePreparer.cpp ${CMAKE_SOURCE_DIR}/src/gui/operations/CanDiscardOperation.cpp ${CMAKE_SOURCE_DIR}/src/gui/operations/UploadOperation.cpp ${CMAKE_SOURCE_DIR}/src/gui/operations/HandleUploadResultOperation.cpp ${CMAKE_SOURCE_DIR}/src/gui/operations/NotifyOperation.cpp ${CMAKE_SOURCE_DIR}/src/gui/operations/DeleteImageOperation.cpp ${CMAKE_SOURCE_DIR}/src/gui/operations/CopyAsDataUriOperation.cpp ${CMAKE_SOURCE_DIR}/src/gui/operations/LoadImageFromFileOperation.cpp ${CMAKE_SOURCE_DIR}/src/gui/captureHandler/CaptureTabStateHandler.cpp ${CMAKE_SOURCE_DIR}/src/gui/captureHandler/ICaptureTabStateHandler.h ${CMAKE_SOURCE_DIR}/src/gui/captureHandler/CaptureHandlerFactory.cpp ${CMAKE_SOURCE_DIR}/src/gui/captureHandler/SingleCaptureHandler.cpp ${CMAKE_SOURCE_DIR}/src/gui/captureHandler/MultiCaptureHandler.cpp ${CMAKE_SOURCE_DIR}/src/gui/captureHandler/TabContextMenuAction.cpp ${CMAKE_SOURCE_DIR}/src/gui/pinWindow/PinWindow.cpp ${CMAKE_SOURCE_DIR}/src/gui/pinWindow/PinWindowHandler.cpp ${CMAKE_SOURCE_DIR}/src/gui/messageBoxService/MessageBoxService.cpp ${CMAKE_SOURCE_DIR}/src/gui/serviceLocator/ServiceLocator.cpp ${CMAKE_SOURCE_DIR}/src/gui/windowResizer/WindowResizer.cpp ${CMAKE_SOURCE_DIR}/src/gui/dragAndDrop/DragAndDropProcessor.cpp ${CMAKE_SOURCE_DIR}/src/logging/LogOutputHandler.cpp ${CMAKE_SOURCE_DIR}/src/bootstrapper/BootstrapperFactory.cpp ${CMAKE_SOURCE_DIR}/src/bootstrapper/StandAloneBootstrapper.cpp ${CMAKE_SOURCE_DIR}/src/bootstrapper/singleInstance/InstanceLock.cpp ${CMAKE_SOURCE_DIR}/src/bootstrapper/singleInstance/SingleInstanceClientBootstrapper.cpp ${CMAKE_SOURCE_DIR}/src/bootstrapper/singleInstance/SingleInstanceServerBootstrapper.cpp ${CMAKE_SOURCE_DIR}/src/bootstrapper/singleInstance/SingleInstanceParameterTranslator.cpp ${CMAKE_SOURCE_DIR}/src/common/platform/HdpiScaler.cpp ) if (APPLE) list(APPEND KSNIP_SRCS ${CMAKE_SOURCE_DIR}/src/backend/imageGrabber/MacImageGrabber.cpp ${CMAKE_SOURCE_DIR}/src/backend/imageGrabber/MacWrapper.cpp ${CMAKE_SOURCE_DIR}/src/backend/config/KsnipMacConfig.cpp ${CMAKE_SOURCE_DIR}/src/gui/snippingArea/MacSnippingArea.cpp ${CMAKE_SOURCE_DIR}/src/gui/globalHotKeys/DummyKeyHandler.cpp ${CMAKE_SOURCE_DIR}/src/gui/globalHotKeys/MacKeyHandler.cpp ${CMAKE_SOURCE_DIR}/src/gui/globalHotKeys/KeySequenceToMacKeyCodeTranslator.cpp ) elseif (UNIX) list(APPEND KSNIP_SRCS ${CMAKE_SOURCE_DIR}/src/backend/imageGrabber/BaseX11ImageGrabber.cpp ${CMAKE_SOURCE_DIR}/src/backend/imageGrabber/X11ImageGrabber.cpp ${CMAKE_SOURCE_DIR}/src/backend/imageGrabber/GnomeX11ImageGrabber.cpp ${CMAKE_SOURCE_DIR}/src/backend/imageGrabber/KdeWaylandImageGrabber.cpp ${CMAKE_SOURCE_DIR}/src/backend/imageGrabber/X11Wrapper.cpp ${CMAKE_SOURCE_DIR}/src/backend/imageGrabber/GnomeX11Wrapper.cpp ${CMAKE_SOURCE_DIR}/src/backend/imageGrabber/GnomeWaylandImageGrabber.cpp ${CMAKE_SOURCE_DIR}/src/backend/imageGrabber/WaylandImageGrabber.cpp ${CMAKE_SOURCE_DIR}/src/backend/config/KsnipWaylandConfig.cpp ${CMAKE_SOURCE_DIR}/src/common/platform/PlatformChecker.cpp ${CMAKE_SOURCE_DIR}/src/common/platform/CommandRunner.cpp ${CMAKE_SOURCE_DIR}/src/common/adapter/fileDialog/SnapFileDialogAdapter.cpp ${CMAKE_SOURCE_DIR}/src/gui/snippingArea/X11SnippingArea.cpp ${CMAKE_SOURCE_DIR}/src/gui/snippingArea/WaylandSnippingArea.cpp ${CMAKE_SOURCE_DIR}/src/gui/globalHotKeys/X11KeyHandler.cpp ${CMAKE_SOURCE_DIR}/src/gui/globalHotKeys/KeySequenceToX11KeyCodeTranslator.cpp ${CMAKE_SOURCE_DIR}/src/gui/globalHotKeys/X11ErrorLogger.cpp ${CMAKE_SOURCE_DIR}/src/gui/notificationService/FreeDesktopNotificationService.cpp ) elseif (WIN32) list(APPEND KSNIP_SRCS ${CMAKE_SOURCE_DIR}/src/backend/imageGrabber/WinImageGrabber.cpp ${CMAKE_SOURCE_DIR}/src/backend/imageGrabber/WinWrapper.cpp ${CMAKE_SOURCE_DIR}/src/gui/snippingArea/WinSnippingArea.cpp ${CMAKE_SOURCE_DIR}/src/gui/globalHotKeys/WinKeyHandler.cpp ${CMAKE_SOURCE_DIR}/src/gui/globalHotKeys/KeySequenceToWinKeyCodeTranslator.cpp ) endif () # Set the sources variable in the top-level as well, since the tests/ # directory wants to (re)build as well. set(KSNIP_SRCS ${KSNIP_SRCS} PARENT_SCOPE) if (WIN32) set(CPACK_GENERATOR WIX) set(CPACK_PACKAGE_NAME "ksnip") set(CPACK_PACKAGE_VENDOR "ksnip") set(CPACK_WIX_UPGRADE_GUID "4c7ed545-c0dd-4d45-bf69-c29c7998f668") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Cross-platform screenshot tool that provides many annotation features for your screenshots.") set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}") set(CPACK_PACKAGE_INSTALL_DIRECTORY "ksnip") set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE.txt") set(CPACK_WIX_PRODUCT_ICON "${CMAKE_SOURCE_DIR}/icons/ksnip.ico") INCLUDE(CPack) add_executable(ksnip ${KSNIP_SRCS} ${CMAKE_SOURCE_DIR}/icons/ksnip_icons.qrc ${CMAKE_SOURCE_DIR}/icons/ksnip_windows_icon.rc) elseif (APPLE) set(MACOSX_BUNDLE_EXECUTABLE_NAME "ksnip") set(MACOSX_BUNDLE_GUI_IDENTIFIER "org.ksnip.ksnip") set(MACOSX_BUNDLE_ICON_FILE "ksnip.icns") set(MACOSX_BUNDLE_INFO_STRING "Cross-Platform Screenshot and Annotation Tool") set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION}) set(MACOSX_BUNDLE_LONG_VERSION_STRING ${KSNIP_VERSION}) set(MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}) set(MACOSX_ICON ${CMAKE_SOURCE_DIR}/icons/ksnip.icns backend/imageGrabber/AbstractImageGrabber.cpp backend/imageGrabber/AbstractImageGrabber.h) set_source_files_properties(${MACOSX_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") add_executable(ksnip MACOSX_BUNDLE ${KSNIP_SRCS} ${CMAKE_SOURCE_DIR}/icons/ksnip_icons.qrc ${MACOSX_ICON}) else () add_executable(ksnip ${KSNIP_SRCS} ${CMAKE_SOURCE_DIR}/icons/ksnip_icons.qrc) endif () set(DEPENDENCY_LIBRARIES Qt5::Widgets Qt5::Network Qt5::Xml Qt5::PrintSupport Qt5::DBus Qt5::Svg ) if (APPLE) list(APPEND DEPENDENCY_LIBRARIES kImageAnnotator::kImageAnnotator kColorPicker::kColorPicker "-framework CoreGraphics -framework AppKit" ) elseif (UNIX) list(APPEND DEPENDENCY_LIBRARIES Qt5::X11Extras kImageAnnotator::kImageAnnotator kColorPicker::kColorPicker XCB::XFIXES ) # X11::X11 imported target only available with sufficiently new CMake if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.14.0) list(APPEND DEPENDENCY_LIBRARIES X11::X11) else() list(APPEND DEPENDENCY_LIBRARIES X11) endif() # This is the "UNIX AND NOT APPLE" case, which is the Free Desktop # world: Linux and the BSDs and Illumos. To simplify #ifdefs in # the source, add a UNIX_X11 defined to be used instead of __linux__ etc. # While the "X11" part of the define isn't necessarily accurate, # it is easy to spot. target_compile_definitions(ksnip PRIVATE UNIX_X11) elseif (WIN32) list(APPEND DEPENDENCY_LIBRARIES Qt5::WinExtras kImageAnnotator kColorPicker Dwmapi ) endif () target_link_libraries(ksnip ${DEPENDENCY_LIBRARIES}) # install target if (WIN32) install(TARGETS ksnip RUNTIME DESTINATION .) find_program(WINDEPLOYQT windeployqt HINTS $ENV{QTDIR} PATH_SUFFIXES bin) SET(WINDEPLOYQT_PARAMETERS "--no-opengl-sw --no-system-d3d-compiler --no-compiler-runtime --release") install(CODE "execute_process(COMMAND ${WINDEPLOYQT} ${WINDEPLOYQT_PARAMETERS} . WORKING_DIRECTORY \${CMAKE_INSTALL_PREFIX})") find_program(COPY cp) if (DEFINED ENV{OPENSSL_DIR}) file(TO_CMAKE_PATH "$ENV{OPENSSL_DIR}" OPENSSL_DIR) install(CODE "execute_process(COMMAND ${COPY} ${OPENSSL_DIR}/*.dll \${CMAKE_INSTALL_PREFIX})") else () message("OPENSSL_DIR not set, not able to install openssl dependencies, skipping.") endif() if (DEFINED ENV{COMPILE_RUNTIME_DIR}) file(TO_CMAKE_PATH "$ENV{COMPILE_RUNTIME_DIR}" COMPILE_RUNTIME_DIR) install(CODE "execute_process(COMMAND ${COPY} ${COMPILE_RUNTIME_DIR}/*.dll \${CMAKE_INSTALL_PREFIX})") else () message("COMPILE_RUNTIME_DIR not set, not able to install compile runtime dependencies, skipping.") endif() if (DEFINED ENV{KIMAGEANNOTATOR_DIR}) file(TO_CMAKE_PATH "$ENV{KIMAGEANNOTATOR_DIR}" KIMAGEANNOTATOR_DIR) install(CODE "execute_process(COMMAND ${COPY} -r \"${KIMAGEANNOTATOR_DIR}/${KIMAGEANNOTATOR_LANG_INSTALL_DIR}\" \${CMAKE_INSTALL_PREFIX})") else () message("KIMAGEANNOTATOR_DIR not set, not able to install kImageAnnotator translations, skipping.") endif() set_property(INSTALL "ksnip.exe" PROPERTY CPACK_START_MENU_SHORTCUTS "ksnip Screenshot Tool" ) elseif (UNIX AND NOT APPLE) install(TARGETS ksnip RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) else () message("DEBUG: NOT WIN32, NOT UNIX") endif () # uninstall target if (UNIX AND NOT APPLE) if(NOT TARGET uninstall) configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) endif () endif () ksnip-1.9.2/src/backend/000077500000000000000000000000001414701001100150125ustar00rootroot00000000000000ksnip-1.9.2/src/backend/CapturePrinter.cpp000066400000000000000000000045241414701001100204720ustar00rootroot00000000000000/* * Copyright (C) 2018 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "CapturePrinter.h" CapturePrinter::CapturePrinter(QWidget *parent) : mParent(parent) { Q_ASSERT(mParent != nullptr); } void CapturePrinter::print(const QImage &image, const QString &defaultPath) { QPrinter printer; printer.setOutputFileName(defaultPath); printer.setOutputFormat(QPrinter::NativeFormat); QPrintDialog printDialog(&printer, mParent); if (printDialog.exec() == QDialog::Accepted) { printCapture(image, &printer); } } void CapturePrinter::printCapture(const QImage &image, QPrinter *p) { QPainter painter; painter.begin(p); auto xScale = p->pageRect().width() / double(image.width()); auto yScale = p->pageRect().height() / double(image.height()); auto scale = qMin(xScale, yScale); painter.translate(p->paperRect().x() + p->pageRect().width() / 2, p->paperRect().y() + p->pageRect().height() / 2); painter.scale(scale, scale); painter.translate(-image.width() / 2, -image.height() / 2); painter.drawImage(QPoint(0, 0), image); painter.end(); } void CapturePrinter::printPreview(const QImage &image, const QString &defaultPath) { QPrinter printer; printer.setOutputFileName(defaultPath); printer.setOutputFormat(QPrinter::NativeFormat); QPrintPreviewDialog printDialog(&printer, mParent, Qt::Window | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint); connect(&printDialog, &QPrintPreviewDialog::paintRequested, [this, image](QPrinter *p) { printCapture(image, p); }); printDialog.exec(); } ksnip-1.9.2/src/backend/CapturePrinter.h000066400000000000000000000025141414701001100201340ustar00rootroot00000000000000/* * Copyright (C) 2018 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_CAPTUREPRINTER_H #define KSNIP_CAPTUREPRINTER_H #include #include #include #include class CapturePrinter : public QObject { Q_OBJECT public: explicit CapturePrinter(QWidget *parent); ~CapturePrinter() override = default; void print(const QImage &image, const QString &defaultPath); void printPreview(const QImage &image, const QString &defaultPath); private: QWidget *mParent; private slots: void printCapture(const QImage &image, QPrinter *p); }; #endif //KSNIP_CAPTUREPRINTER_H ksnip-1.9.2/src/backend/KsnipCommandLine.cpp000066400000000000000000000166451414701001100207250ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "KsnipCommandLine.h" KsnipCommandLine::KsnipCommandLine(const QCoreApplication &app, const QList &captureModes) { setApplicationDescription(translateText(QLatin1String("Ksnip Screenshot Tool"))); addHelpOption(); addVersionOptions(); addImageGrabberOptions(captureModes); addDefaultOptions(); addPositionalArguments(); process(app); } KsnipCommandLine::~KsnipCommandLine() { delete mRectAreaOption; delete mLastRectAreaOption; delete mFullScreenOption; delete mCurrentScreenOption; delete mActiveWindowOption; delete mWindowUnderCursorOption; delete mPortalOption; delete mDelayOption; delete mCursorOption; delete mEditOption; delete mSaveOption; delete mVersionOption; } void KsnipCommandLine::addImageGrabberOptions(const QList &captureModes) { if (captureModes.contains(CaptureModes::RectArea)) { mRectAreaOption = addOption(QLatin1String("r"), QLatin1String("rectarea"), QLatin1String("Select a rectangular area from where to take a screenshot.")); } if (captureModes.contains(CaptureModes::LastRectArea)) { mLastRectAreaOption = addOption(QLatin1String("l"), QLatin1String("lastrectarea"), QLatin1String("Take a screenshot using last selected rectangular area.")); } if (captureModes.contains(CaptureModes::FullScreen)) { mFullScreenOption = addOption(QLatin1String("f"), QLatin1String("fullscreen"), QLatin1String("Capture the fullscreen including all monitors.")); } if (captureModes.contains(CaptureModes::CurrentScreen)) { mCurrentScreenOption = addOption(QLatin1String("m"), QLatin1String("current"), QLatin1String("Capture the screen (monitor) where the mouse cursor is currently located.")); } if (captureModes.contains(CaptureModes::ActiveWindow)) { mActiveWindowOption = addOption(QLatin1String("a"), QLatin1String("active"), QLatin1String("Capture the window that currently has input focus.")); } if (captureModes.contains(CaptureModes::WindowUnderCursor)) { mWindowUnderCursorOption = addOption(QLatin1String("u"), QLatin1String("windowundercursor"), QLatin1String("Capture the window that is currently under the mouse cursor.")); } if (captureModes.contains(CaptureModes::Portal)) { mWindowUnderCursorOption = addOption(QLatin1String("t"), QLatin1String("portal"), QLatin1String("Uses the screenshot Portal for taking screenshot.")); } } void KsnipCommandLine::addDefaultOptions() { mDelayOption = addParameterOption(QLatin1String("d"), QLatin1String("delay"), QLatin1String("Delay before taking the screenshot."), QLatin1String("seconds")); mCursorOption = addOption(QLatin1String("c"), QLatin1String("cursor"), QLatin1String("Capture mouse cursor on screenshot.")); mEditOption = addParameterOption(QLatin1String("e"), QLatin1String("edit"), QLatin1String("Edit existing image in ksnip"), QLatin1String("image")); mSaveOption = addOption(QLatin1String("s"), QLatin1String("save"), QLatin1String("Save screenshot to default location without opening in editor.")); } void KsnipCommandLine::addVersionOptions() { mVersionOption = addOption(QLatin1String("v"), QLatin1String("version"), QLatin1String("Displays version information.")); } QString KsnipCommandLine::translateText(const QString &text) { return QCoreApplication::translate("main", text.toLatin1()); } QCommandLineOption* KsnipCommandLine::addOption(const QString &shortName, const QString &longName, const QString &description) { auto newOption = new QCommandLineOption({shortName, longName}, translateText(description)); QCommandLineParser::addOption(*newOption); return newOption; } QCommandLineOption* KsnipCommandLine::addParameterOption(const QString &shortName, const QString &longName, const QString &description, const QString ¶meter) { auto newOption = new QCommandLineOption({shortName, longName}, translateText(description), translateText(parameter)); QCommandLineParser::addOption(*newOption); return newOption; } bool KsnipCommandLine::isRectAreaSet() const { return mRectAreaOption != nullptr && isSet(*mRectAreaOption); } bool KsnipCommandLine::isLastRectAreaSet() const { return mLastRectAreaOption != nullptr && isSet(*mLastRectAreaOption); } bool KsnipCommandLine::isFullScreenSet() const { return mFullScreenOption != nullptr && isSet(*mFullScreenOption); } bool KsnipCommandLine::isCurrentScreenSet() const { return mCurrentScreenOption != nullptr && isSet(*mCurrentScreenOption); } bool KsnipCommandLine::isActiveWindowSet() const { return mActiveWindowOption != nullptr && isSet(*mActiveWindowOption); } bool KsnipCommandLine::isWindowsUnderCursorSet() const { return mWindowUnderCursorOption != nullptr && isSet(*mWindowUnderCursorOption); } bool KsnipCommandLine::isPortalSet() const { return mPortalOption != nullptr && isSet(*mPortalOption); } bool KsnipCommandLine::isDelaySet() const { return mDelayOption != nullptr && isSet(*mDelayOption); } bool KsnipCommandLine::isCursorSet() const { return mCursorOption != nullptr && isSet(*mCursorOption); } bool KsnipCommandLine::isEditSet() const { return (mEditOption != nullptr && isSet(*mEditOption)) || positionalArguments().count() == 1; } bool KsnipCommandLine::isSaveSet() const { return mSaveOption != nullptr && isSet(*mSaveOption); } bool KsnipCommandLine::isVersionSet() const { return mVersionOption != nullptr && isSet(*mVersionOption); } int KsnipCommandLine::delay() const { auto valid = true; auto delay = value(*mDelayOption).toInt(&valid); return valid && delay >= 0 ? delay : -1; } QString KsnipCommandLine::imagePath() const { return positionalArguments().count() == 1 ? positionalArguments().first() : value(*mEditOption); } bool KsnipCommandLine::isCaptureModeSet() const { return isRectAreaSet() || isLastRectAreaSet() || isFullScreenSet() || isCurrentScreenSet() || isActiveWindowSet() || isWindowsUnderCursorSet(); } CaptureModes KsnipCommandLine::captureMode() const { if (isFullScreenSet()) { return CaptureModes::FullScreen; } else if (isCurrentScreenSet()) { return CaptureModes::CurrentScreen; } else if (isActiveWindowSet()) { return CaptureModes::ActiveWindow; } else if (isWindowsUnderCursorSet()) { return CaptureModes::WindowUnderCursor; } else if (isLastRectAreaSet()) { return CaptureModes::LastRectArea; } else if (isPortalSet()) { return CaptureModes::Portal; } else { return CaptureModes::RectArea; } } void KsnipCommandLine::addPositionalArguments() { addPositionalArgument(QLatin1String("image"), QLatin1String("Edit existing image in ksnip"), QLatin1String("[image]")); } ksnip-1.9.2/src/backend/KsnipCommandLine.h000066400000000000000000000054441414701001100203650ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_KSNIPCOMMANDLINE_H #define KSNIP_KSNIPCOMMANDLINE_H #include #include #include #include #include "src/common/enum/CaptureModes.h" class KsnipCommandLine : public QCommandLineParser { public: KsnipCommandLine(const QCoreApplication &app, const QList &captureModes); ~KsnipCommandLine(); bool isRectAreaSet() const; bool isLastRectAreaSet() const; bool isFullScreenSet() const; bool isCurrentScreenSet() const; bool isActiveWindowSet() const; bool isWindowsUnderCursorSet() const; bool isPortalSet() const; bool isDelaySet() const; bool isCursorSet() const; bool isEditSet() const; bool isSaveSet() const; bool isVersionSet() const; bool isCaptureModeSet() const; int delay() const; QString imagePath() const; CaptureModes captureMode() const; private: QCommandLineOption *mRectAreaOption = nullptr; QCommandLineOption *mLastRectAreaOption = nullptr; QCommandLineOption *mFullScreenOption = nullptr; QCommandLineOption *mCurrentScreenOption = nullptr; QCommandLineOption *mActiveWindowOption = nullptr; QCommandLineOption *mWindowUnderCursorOption = nullptr; QCommandLineOption *mPortalOption = nullptr; QCommandLineOption *mDelayOption = nullptr; QCommandLineOption *mCursorOption = nullptr; QCommandLineOption *mEditOption = nullptr; QCommandLineOption *mSaveOption = nullptr; QCommandLineOption *mVersionOption = nullptr; void addImageGrabberOptions(const QList &captureModes); void addDefaultOptions(); void addVersionOptions(); QString translateText(const QString &text); QCommandLineOption* addOption(const QString &shortName, const QString &longName, const QString &description); QCommandLineOption* addParameterOption(const QString &shortName, const QString &longName, const QString &description, const QString ¶meter); void addPositionalArguments(); }; #endif //KSNIP_KSNIPCOMMANDLINE_H ksnip-1.9.2/src/backend/TranslationLoader.cpp000066400000000000000000000071261414701001100211510ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "TranslationLoader.h" void TranslationLoader::load(const QApplication &app) { auto ksnipTranslator = new QTranslator(); auto kImageAnnotatorTranslator = new QTranslator(); auto pathToKsnipTranslations = QString(KSNIP_LANG_INSTALL_DIR); auto pathToKImageAnnotatorTranslations = QString(KIMAGEANNOTATOR_LANG_INSTALL_DIR); loadTranslations(app, ksnipTranslator, pathToKsnipTranslations, QLatin1String("ksnip")); loadTranslations(app, kImageAnnotatorTranslator, pathToKImageAnnotatorTranslations, QLatin1String("kImageAnnotator")); } void TranslationLoader::loadTranslations(const QApplication &app, QTranslator *translator, QString &path, const QString &applicationName) { auto translationSuccessfullyLoaded = loadTranslationFromAbsolutePath(translator, path, applicationName); if (!translationSuccessfullyLoaded) { translationSuccessfullyLoaded = loadTranslationFromRelativePath(translator, path, applicationName); } // Translation loading for AppImage if (!translationSuccessfullyLoaded) { translationSuccessfullyLoaded = loadTranslationForAppImage(translator, path, applicationName); } // Translation loading for Snap if (!translationSuccessfullyLoaded) { translationSuccessfullyLoaded = loadTranslationForSnap(translator, path, applicationName); } if (translationSuccessfullyLoaded) { app.installTranslator(translator); } else { qWarning("Unable to find any translation files for %s.", qPrintable(applicationName)); } } bool TranslationLoader::loadTranslationFromAbsolutePath(QTranslator *translator, const QString &path, const QString &applicationName) { return loadTranslation(translator, path, applicationName); } bool TranslationLoader::loadTranslationFromRelativePath(QTranslator *translator, const QString &path, const QString &applicationName) { auto relativePathToAppDir = QCoreApplication::applicationDirPath() + QLatin1String("/"); return loadTranslation(translator, relativePathToAppDir + path, applicationName); } bool TranslationLoader::loadTranslationForAppImage(QTranslator *translator, const QString &path, const QString &applicationName) { auto relativePathToAppDir = QCoreApplication::applicationDirPath() + QLatin1String("/../.."); return loadTranslation(translator, relativePathToAppDir + path, applicationName); } bool TranslationLoader::loadTranslationForSnap(QTranslator *translator, const QString &path, const QString &applicationName) { auto relativePathToSnapVersionDir = QCoreApplication::applicationDirPath() + QLatin1String("/.."); return loadTranslation(translator, relativePathToSnapVersionDir + path, applicationName); } bool TranslationLoader::loadTranslation(QTranslator *translator, const QString &path, const QString &applicationName) { auto separator = QLatin1String("_"); return translator->load(QLocale(), applicationName, separator, path); } ksnip-1.9.2/src/backend/TranslationLoader.h000066400000000000000000000035141414701001100206130ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_TRANSLATIONLOADER_H #define KSNIP_TRANSLATIONLOADER_H #include #include #include "BuildConfig.h" class TranslationLoader { public: TranslationLoader() = default; ~TranslationLoader() = default; static void load(const QApplication &app); private: static bool loadTranslationFromAbsolutePath(QTranslator *translator, const QString &path, const QString &applicationName); static bool loadTranslationFromRelativePath(QTranslator *translator, const QString &path, const QString &applicationName); static bool loadTranslationForAppImage(QTranslator *translator, const QString &path, const QString &applicationName); static bool loadTranslationForSnap(QTranslator *translator, const QString &path, const QString &applicationName); static bool loadTranslation(QTranslator *translator, const QString &path, const QString &applicationName); static void loadTranslations(const QApplication &app, QTranslator *translator, QString &path, const QString &applicationName); }; #endif //KSNIP_TRANSLATIONLOADER_H ksnip-1.9.2/src/backend/WatermarkImageLoader.cpp000066400000000000000000000025621414701001100215520ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "WatermarkImageLoader.h" WatermarkImageLoader::WatermarkImageLoader() { mImageName = QLatin1String("watermark_image.png"); mPath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation); mImagePath = mPath + QLatin1String("/") + mImageName; } QPixmap WatermarkImageLoader::load() const { return QPixmap(mImagePath); } bool WatermarkImageLoader::save(const QPixmap &image) const { if(image.isNull()) { return false; } createPathIfRequired(); return image.save(mImagePath); } void WatermarkImageLoader::createPathIfRequired() const { QDir qdir; qdir.mkpath(mPath); } ksnip-1.9.2/src/backend/WatermarkImageLoader.h000066400000000000000000000023601414701001100212130ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_WATERMARKIMAGELOADER_H #define KSNIP_WATERMARKIMAGELOADER_H #include #include #include #include class WatermarkImageLoader { public: explicit WatermarkImageLoader(); ~WatermarkImageLoader() = default; QPixmap load() const; bool save(const QPixmap &image) const; private: QString mImageName; QString mPath; QString mImagePath; void createPathIfRequired() const; }; #endif //KSNIP_WATERMARKIMAGELOADER_H ksnip-1.9.2/src/backend/config/000077500000000000000000000000001414701001100162575ustar00rootroot00000000000000ksnip-1.9.2/src/backend/config/KsnipConfig.cpp000066400000000000000000001023141414701001100211760ustar00rootroot00000000000000/* * Copyright (C) 2016 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #include "KsnipConfig.h" // Application bool KsnipConfig::rememberPosition() const { return loadValue(KsnipConfigOptions::rememberPositionString(), true).toBool(); } void KsnipConfig::setRememberPosition(bool enabled) { if (rememberPosition() == enabled) { return; } saveValue(KsnipConfigOptions::rememberPositionString(), enabled); } bool KsnipConfig::promptSaveBeforeExit() const { return loadValue(KsnipConfigOptions::promptSaveBeforeExitString(), true).toBool(); } void KsnipConfig::setPromptSaveBeforeExit(bool enabled) { if (promptSaveBeforeExit() == enabled) { return; } saveValue(KsnipConfigOptions::promptSaveBeforeExitString(), enabled); } bool KsnipConfig::autoCopyToClipboardNewCaptures() const { return loadValue(KsnipConfigOptions::autoCopyToClipboardNewCapturesString(), false).toBool(); } void KsnipConfig::setAutoCopyToClipboardNewCaptures(bool enabled) { if (autoCopyToClipboardNewCaptures() == enabled) { return; } saveValue(KsnipConfigOptions::autoCopyToClipboardNewCapturesString(), enabled); } bool KsnipConfig::autoSaveNewCaptures() const { return loadValue(KsnipConfigOptions::autoSaveNewCapturesString(), false).toBool(); } void KsnipConfig::setAutoSaveNewCaptures(bool enabled) { if (autoSaveNewCaptures() == enabled) { return; } saveValue(KsnipConfigOptions::autoSaveNewCapturesString(), enabled); } bool KsnipConfig::autoHideDocks() const { return loadValue(KsnipConfigOptions::autoHideDocksString(), false).toBool(); } void KsnipConfig::setAutoHideDocks(bool enabled) { if (autoHideDocks() == enabled) { return; } saveValue(KsnipConfigOptions::autoHideDocksString(), enabled); } bool KsnipConfig::autoResizeToContent() const { return loadValue(KsnipConfigOptions::autoResizeToContentString(), true).toBool(); } void KsnipConfig::setAutoResizeToContent(bool enabled) { if (autoResizeToContent() == enabled) { return; } saveValue(KsnipConfigOptions::autoResizeToContentString(), enabled); } int KsnipConfig::resizeToContentDelay() const { return loadValue(KsnipConfigOptions::resizeToContentDelayString(), 10).toInt(); } void KsnipConfig::setResizeToContentDelay(int ms) { if (resizeToContentDelay() == ms) { return; } saveValue(KsnipConfigOptions::resizeToContentDelayString(), ms); } bool KsnipConfig::useTabs() const { return loadValue(KsnipConfigOptions::useTabsString(), true).toBool(); } void KsnipConfig::setUseTabs(bool enabled) { if (useTabs() == enabled) { return; } saveValue(KsnipConfigOptions::useTabsString(), enabled); emit annotatorConfigChanged(); } bool KsnipConfig::autoHideTabs() const { return loadValue(KsnipConfigOptions::autoHideTabsString(), false).toBool(); } void KsnipConfig::setAutoHideTabs(bool enabled) { if (autoHideTabs() == enabled) { return; } saveValue(KsnipConfigOptions::autoHideTabsString(), enabled); emit annotatorConfigChanged(); } bool KsnipConfig::captureOnStartup() const { return loadValue(KsnipConfigOptions::captureOnStartupString(), false).toBool(); } void KsnipConfig::setCaptureOnStartup(bool enabled) { if (captureOnStartup() == enabled) { return; } saveValue(KsnipConfigOptions::captureOnStartupString(), enabled); } QPoint KsnipConfig::windowPosition() const { // If we are not saving the position we return the default and ignore what // has been save earlier if (!rememberPosition()) { return { 200, 200 }; } auto defaultPosition = QPoint(200, 200); return loadValue(KsnipConfigOptions::positionString(), defaultPosition).value(); } void KsnipConfig::setWindowPosition(const QPoint& position) { if (windowPosition() == position) { return; } saveValue(KsnipConfigOptions::positionString(), position); } CaptureModes KsnipConfig::captureMode() const { // If we are not storing the tool selection, always return the rect area as default if (!rememberToolSelection()) { return CaptureModes::RectArea; } return loadValue(KsnipConfigOptions::captureModeString(), (int)CaptureModes::RectArea).value(); } void KsnipConfig::setCaptureMode(CaptureModes mode) { if (captureMode() == mode) { return; } saveValue(KsnipConfigOptions::captureModeString(), static_cast(mode)); } QString KsnipConfig::saveDirectory() const { auto saveDirectoryString = loadValue(KsnipConfigOptions::saveDirectoryString(), DirectoryPathProvider::home()).toString(); if (!saveDirectoryString.isEmpty()) { return saveDirectoryString + QLatin1String("/"); } else { return {}; } } void KsnipConfig::setSaveDirectory(const QString& path) { if (saveDirectory() == path) { return; } saveValue(KsnipConfigOptions::saveDirectoryString(), path); } QString KsnipConfig::saveFilename() const { auto defaultFilename = QLatin1String("ksnip_$Y$M$D-$T"); auto filename = loadValue(KsnipConfigOptions::saveFilenameString(), defaultFilename).toString(); if (filename.isEmpty() || filename.isNull()) { filename = defaultFilename; } return filename; } void KsnipConfig::setSaveFilename(const QString& filename) { if (saveFilename() == filename) { return; } saveValue(KsnipConfigOptions::saveFilenameString(), filename); } QString KsnipConfig::saveFormat() const { auto defaultFormat = QLatin1String("png"); auto format = loadValue(KsnipConfigOptions::saveFormatString(), defaultFormat).toString(); if (format.isEmpty() || format.isNull()) { format = defaultFormat; } return format; } void KsnipConfig::setSaveFormat(const QString& format) { if (saveFormat() == format) { return; } saveValue(KsnipConfigOptions::saveFormatString(), format); } QString KsnipConfig::applicationStyle() const { auto defaultStyle = QLatin1String("Fusion"); return loadValue(KsnipConfigOptions::applicationStyleString(), defaultStyle).toString(); } void KsnipConfig::setApplicationStyle(const QString &style) { if (applicationStyle() == style) { return; } saveValue(KsnipConfigOptions::applicationStyleString(), style); } TrayIconDefaultActionMode KsnipConfig::defaultTrayIconActionMode() const { return loadValue(KsnipConfigOptions::trayIconDefaultActionModeString(), (int)TrayIconDefaultActionMode::ShowEditor).value(); } void KsnipConfig::setDefaultTrayIconActionMode(TrayIconDefaultActionMode mode) { if (defaultTrayIconActionMode() == mode) { return; } saveValue(KsnipConfigOptions::trayIconDefaultActionModeString(), static_cast(mode)); } CaptureModes KsnipConfig::defaultTrayIconCaptureMode() const { return loadValue(KsnipConfigOptions::trayIconDefaultCaptureModeString(), (int)CaptureModes::RectArea).value(); } void KsnipConfig::setDefaultTrayIconCaptureMode(CaptureModes mode) { if (defaultTrayIconCaptureMode() == mode) { return; } saveValue(KsnipConfigOptions::trayIconDefaultCaptureModeString(), static_cast(mode)); } bool KsnipConfig::useTrayIcon() const { return loadValue(KsnipConfigOptions::useTrayIconString(), true).toBool(); } void KsnipConfig::setUseTrayIcon(bool enabled) { if (useTrayIcon() == enabled) { return; } saveValue(KsnipConfigOptions::useTrayIconString(), enabled); } bool KsnipConfig::minimizeToTray() const { return loadValue(KsnipConfigOptions::minimizeToTrayString(), true).toBool(); } void KsnipConfig::setMinimizeToTray(bool enabled) { if (minimizeToTray() == enabled) { return; } saveValue(KsnipConfigOptions::minimizeToTrayString(), enabled); } bool KsnipConfig::closeToTray() const { return loadValue(KsnipConfigOptions::closeToTrayString(), true).toBool(); } void KsnipConfig::setCloseToTray(bool enabled) { if (closeToTray() == enabled) { return; } saveValue(KsnipConfigOptions::closeToTrayString(), enabled); } bool KsnipConfig::trayIconNotificationsEnabled() const { return loadValue(KsnipConfigOptions::trayIconNotificationsEnabledString(), true).toBool(); } void KsnipConfig::setTrayIconNotificationsEnabled(bool enabled) { if (trayIconNotificationsEnabled() == enabled) { return; } saveValue(KsnipConfigOptions::trayIconNotificationsEnabledString(), enabled); } bool KsnipConfig::platformSpecificNotificationServiceEnabled() const { return loadValue(KsnipConfigOptions::platformSpecificNotificationServiceEnabledString(), true).toBool(); } void KsnipConfig::setPlatformSpecificNotificationServiceEnabled(bool enabled) { if (platformSpecificNotificationServiceEnabled() == enabled) { return; } saveValue(KsnipConfigOptions::platformSpecificNotificationServiceEnabledString(), enabled); } bool KsnipConfig::startMinimizedToTray() const { return loadValue(KsnipConfigOptions::startMinimizedToTrayString(), false).toBool(); } void KsnipConfig::setStartMinimizedToTray(bool enabled) { if (startMinimizedToTray() == enabled) { return; } saveValue(KsnipConfigOptions::startMinimizedToTrayString(), enabled); } bool KsnipConfig::rememberLastSaveDirectory() const { return loadValue(KsnipConfigOptions::rememberLastSaveDirectoryString(), false).toBool(); } void KsnipConfig::setRememberLastSaveDirectory(bool enabled) { if (rememberLastSaveDirectory() == enabled) { return; } saveValue(KsnipConfigOptions::rememberLastSaveDirectoryString(), enabled); } bool KsnipConfig::useSingleInstance() const { return loadValue(KsnipConfigOptions::useSingleInstanceString(), true).toBool(); } void KsnipConfig::setUseSingleInstance(bool enabled) { if (useSingleInstance() == enabled) { return; } saveValue(KsnipConfigOptions::useSingleInstanceString(), enabled); } bool KsnipConfig::hideMainWindowDuringScreenshot() const { return loadValue(KsnipConfigOptions::hideMainWindowDuringScreenshotString(), true).toBool(); } void KsnipConfig::setHideMainWindowDuringScreenshot(bool enabled) { if (hideMainWindowDuringScreenshot() == enabled) { return; } saveValue(KsnipConfigOptions::hideMainWindowDuringScreenshotString(), enabled); } bool KsnipConfig::allowResizingRectSelection() const { return loadValue(KsnipConfigOptions::allowResizingRectSelectionString(), false).toBool(); } void KsnipConfig::setAllowResizingRectSelection(bool enabled) { if (allowResizingRectSelection() == enabled) { return; } saveValue(KsnipConfigOptions::allowResizingRectSelectionString(), enabled); } bool KsnipConfig::showSnippingAreaInfoText() const { return loadValue(KsnipConfigOptions::showSnippingAreaInfoTextString(), true).toBool(); } void KsnipConfig::setShowSnippingAreaInfoText(bool enabled) { if (showSnippingAreaInfoText() == enabled) { return; } saveValue(KsnipConfigOptions::showSnippingAreaInfoTextString(), enabled); } SaveQualityMode KsnipConfig::saveQualityMode() const { return loadValue(KsnipConfigOptions::saveQualityModeString(), (int)SaveQualityMode::Default).value(); } void KsnipConfig::setSaveQualityMode(SaveQualityMode mode) { if (saveQualityMode() == mode) { return; } saveValue(KsnipConfigOptions::saveQualityModeString(), static_cast(mode)); } int KsnipConfig::saveQualityFactor() const { return loadValue(KsnipConfigOptions::saveQualityFactorString(), 50).toInt(); } void KsnipConfig::setSaveQualityFactor(int factor) { if (saveQualityFactor() == factor) { return; } saveValue(KsnipConfigOptions::saveQualityFactorString(), factor); } // Annotator bool KsnipConfig::rememberToolSelection() const { return loadValue(KsnipConfigOptions::rememberToolSelectionString(), true).toBool(); } void KsnipConfig::setRememberToolSelection(bool enabled) { if (rememberToolSelection() == enabled) { return; } saveValue(KsnipConfigOptions::rememberToolSelectionString(), enabled); } bool KsnipConfig::switchToSelectToolAfterDrawingItem() const { return loadValue(KsnipConfigOptions::switchToSelectToolAfterDrawingItemString(), true).toBool(); } void KsnipConfig::setSwitchToSelectToolAfterDrawingItem(bool enabled) { if (switchToSelectToolAfterDrawingItem() == enabled) { return; } saveValue(KsnipConfigOptions::switchToSelectToolAfterDrawingItemString(), enabled); emit annotatorConfigChanged(); } bool KsnipConfig::selectItemAfterDrawing() const { return loadValue(KsnipConfigOptions::selectItemAfterDrawingString(), true).toBool(); } void KsnipConfig::setSelectItemAfterDrawing(bool enabled) { if (selectItemAfterDrawing() == enabled) { return; } saveValue(KsnipConfigOptions::selectItemAfterDrawingString(), enabled); emit annotatorConfigChanged(); } bool KsnipConfig::numberToolSeedChangeUpdatesAllItems() const { return loadValue(KsnipConfigOptions::numberToolSeedChangeUpdatesAllItemsString(), true).toBool(); } void KsnipConfig::setNumberToolSeedChangeUpdatesAllItems(bool enabled) { if (numberToolSeedChangeUpdatesAllItems() == enabled) { return; } saveValue(KsnipConfigOptions::numberToolSeedChangeUpdatesAllItemsString(), enabled); emit annotatorConfigChanged(); } bool KsnipConfig::smoothPathEnabled() const { return loadValue(KsnipConfigOptions::smoothPathEnabledString(), true).toBool(); } void KsnipConfig::setSmoothPathEnabled(bool enabled) { if (smoothPathEnabled() == enabled) { return; } saveValue(KsnipConfigOptions::smoothPathEnabledString(), enabled); emit annotatorConfigChanged(); } int KsnipConfig::smoothFactor() const { return loadValue(KsnipConfigOptions::smoothPathFactorString(), 7).toInt(); } void KsnipConfig::setSmoothFactor(int factor) { if (smoothFactor() == factor) { return; } saveValue(KsnipConfigOptions::smoothPathFactorString(), factor); emit annotatorConfigChanged(); } bool KsnipConfig::rotateWatermarkEnabled() const { return loadValue(KsnipConfigOptions::rotateWatermarkEnabledString(), true).toBool(); } void KsnipConfig::setRotateWatermarkEnabled(bool enabled) { if (rotateWatermarkEnabled() == enabled) { return; } saveValue(KsnipConfigOptions::rotateWatermarkEnabledString(), enabled); } QStringList KsnipConfig::stickerPaths() const { return loadValue(KsnipConfigOptions::stickerPathsString(), QVariant::fromValue(QStringList())).value(); } void KsnipConfig::setStickerPaths(const QStringList &paths) { if (stickerPaths() == paths) { return; } saveValue(KsnipConfigOptions::stickerPathsString(), QVariant::fromValue(paths)); emit annotatorConfigChanged(); } bool KsnipConfig::useDefaultSticker() const { return loadValue(KsnipConfigOptions::useDefaultStickerString(), true).toBool(); } void KsnipConfig::setUseDefaultSticker(bool enabled) { if (useDefaultSticker() == enabled) { return; } saveValue(KsnipConfigOptions::useDefaultStickerString(), enabled); emit annotatorConfigChanged(); } QColor KsnipConfig::canvasColor() const { return loadValue(KsnipConfigOptions::canvasColorString(), QColor(Qt::white)).value(); } void KsnipConfig::setCanvasColor(const QColor &color) { if (canvasColor() == color) { return; } saveValue(KsnipConfigOptions::canvasColorString(), color); emit annotatorConfigChanged(); } // Image Grabber bool KsnipConfig::isFreezeImageWhileSnippingEnabledReadOnly() const { return false; } bool KsnipConfig::freezeImageWhileSnippingEnabled() const { return loadValue(KsnipConfigOptions::freezeImageWhileSnippingEnabledString(), true).toBool(); } void KsnipConfig::setFreezeImageWhileSnippingEnabled(bool enabled) { if (freezeImageWhileSnippingEnabled() == enabled) { return; } saveValue(KsnipConfigOptions::freezeImageWhileSnippingEnabledString(), enabled); } bool KsnipConfig::captureCursor() const { return loadValue(KsnipConfigOptions::captureCursorString(), true).toBool(); } void KsnipConfig::setCaptureCursor(bool enabled) { if (captureCursor() == enabled) { return; } saveValue(KsnipConfigOptions::captureCursorString(), enabled); } bool KsnipConfig::snippingAreaRulersEnabled() const { return loadValue(KsnipConfigOptions::snippingAreaRulersEnabledString(), true).toBool(); } void KsnipConfig::setSnippingAreaRulersEnabled(bool enabled) { if (snippingAreaRulersEnabled() == enabled) { return; } saveValue(KsnipConfigOptions::snippingAreaRulersEnabledString(), enabled); } bool KsnipConfig::snippingAreaPositionAndSizeInfoEnabled() const { return loadValue(KsnipConfigOptions::snippingAreaPositionAndSizeInfoEnabledString(), true).toBool(); } void KsnipConfig::setSnippingAreaPositionAndSizeInfoEnabled(bool enabled) { if (snippingAreaPositionAndSizeInfoEnabled() == enabled) { return; } saveValue(KsnipConfigOptions::snippingAreaPositionAndSizeInfoEnabledString(), enabled); } bool KsnipConfig::showMainWindowAfterTakingScreenshotEnabled() const { return loadValue(KsnipConfigOptions::showMainWindowAfterTakingScreenshotEnabledString(), true).toBool(); } void KsnipConfig::setShowMainWindowAfterTakingScreenshotEnabled(bool enabled) { if (showMainWindowAfterTakingScreenshotEnabled() == enabled) { return; } saveValue(KsnipConfigOptions::showMainWindowAfterTakingScreenshotEnabledString(), enabled); } bool KsnipConfig::isSnippingAreaMagnifyingGlassEnabledReadOnly() const { return false; } bool KsnipConfig::snippingAreaMagnifyingGlassEnabled() const { return loadValue(KsnipConfigOptions::snippingAreaMagnifyingGlassEnabledString(), true).toBool(); } void KsnipConfig::setSnippingAreaMagnifyingGlassEnabled(bool enabled) { if (snippingAreaMagnifyingGlassEnabled() == enabled) { return; } saveValue(KsnipConfigOptions::snippingAreaMagnifyingGlassEnabledString(), enabled); } int KsnipConfig::captureDelay() const { return loadValue(KsnipConfigOptions::captureDelayString(), 0).toInt(); } void KsnipConfig::setCaptureDelay(int delay) { if (captureDelay() == delay) { return; } saveValue(KsnipConfigOptions::captureDelayString(), delay); } int KsnipConfig::snippingCursorSize() const { return loadValue(KsnipConfigOptions::snippingCursorSizeString(), 1).toInt(); } void KsnipConfig::setSnippingCursorSize(int size) { if (snippingCursorSize() == size) { return; } saveValue(KsnipConfigOptions::snippingCursorSizeString(), size); } QColor KsnipConfig::snippingCursorColor() const { auto defaultColor = QColor(27, 20, 77); return loadValue(KsnipConfigOptions::snippingCursorColorString(), defaultColor).value(); } void KsnipConfig::setSnippingCursorColor(const QColor& color) { if (snippingCursorColor() == color) { return; } saveValue(KsnipConfigOptions::snippingCursorColorString(), color); } QColor KsnipConfig::snippingAdornerColor() const { return loadValue(KsnipConfigOptions::snippingAdornerColorString(), QColor(Qt::red)).value(); } void KsnipConfig::setSnippingAdornerColor(const QColor& color) { if (snippingAdornerColor() == color) { return; } saveValue(KsnipConfigOptions::snippingAdornerColorString(), color); } int KsnipConfig::snippingAreaTransparency() const { return loadValue(KsnipConfigOptions::snippingAreaTransparencyString(), 150).value(); } void KsnipConfig::setSnippingAreaTransparency(int transparency) { if (snippingAreaTransparency() == transparency) { return; } saveValue(KsnipConfigOptions::snippingAreaTransparencyString(), transparency); } QRect KsnipConfig::lastRectArea() const { return loadValue(KsnipConfigOptions::lastRectAreaString(), QRect()).value(); } void KsnipConfig::setLastRectArea(const QRect &rectArea) { if (lastRectArea() == rectArea) { return; } saveValue(KsnipConfigOptions::lastRectAreaString(), rectArea); } bool KsnipConfig::isForceGenericWaylandEnabledReadOnly() const { return true; } bool KsnipConfig::forceGenericWaylandEnabled() const { return loadValue(KsnipConfigOptions::forceGenericWaylandEnabledString(), false).toBool(); } void KsnipConfig::setForceGenericWaylandEnabled(bool enabled) { if (forceGenericWaylandEnabled() == enabled) { return; } saveValue(KsnipConfigOptions::forceGenericWaylandEnabledString(), enabled); } bool KsnipConfig::isScaleGenericWaylandScreenshotEnabledReadOnly() const { return true; } bool KsnipConfig::scaleGenericWaylandScreenshotsEnabled() const { return loadValue(KsnipConfigOptions::scaleWaylandScreenshotsEnabledString(), false).toBool(); } void KsnipConfig::setScaleGenericWaylandScreenshots(bool enabled) { if (scaleGenericWaylandScreenshotsEnabled() == enabled) { return; } saveValue(KsnipConfigOptions::scaleWaylandScreenshotsEnabledString(), enabled); } // Uploader bool KsnipConfig::confirmBeforeUpload() const { return loadValue(KsnipConfigOptions::confirmBeforeUploadString(), true).toBool(); } void KsnipConfig::setConfirmBeforeUpload(bool enabled) { if (confirmBeforeUpload() == enabled) { return; } saveValue(KsnipConfigOptions::confirmBeforeUploadString(), enabled); } UploaderType KsnipConfig::uploaderType() const { return loadValue(KsnipConfigOptions::uploaderTypeString(), static_cast(UploaderType::Imgur)).value(); } void KsnipConfig::setUploaderType(UploaderType type) { if (uploaderType() == type) { return; } saveValue(KsnipConfigOptions::uploaderTypeString(), static_cast(type)); } // Imgur Uploader QString KsnipConfig::imgurUsername() const { auto defaultUsername = QLatin1String(""); return loadValue(KsnipConfigOptions::imgurUsernameString(), defaultUsername).toString(); } void KsnipConfig::setImgurUsername(const QString& username) { if (imgurUsername() == username) { return; } saveValue(KsnipConfigOptions::imgurUsernameString(), username); } QByteArray KsnipConfig::imgurClientId() const { auto defaultClientId = QLatin1String(""); return loadValue(KsnipConfigOptions::imgurClientIdString(), defaultClientId).toByteArray(); } void KsnipConfig::setImgurClientId(const QString& clientId) { if (imgurClientId() == clientId) { return; } saveValue(KsnipConfigOptions::imgurClientIdString(), clientId); } QByteArray KsnipConfig::imgurClientSecret() const { auto defaultClientSecret = QLatin1String(""); return loadValue(KsnipConfigOptions::imgurClientSecretString(), defaultClientSecret).toByteArray(); } void KsnipConfig::setImgurClientSecret(const QString& clientSecret) { if (imgurClientSecret() == clientSecret) { return; } saveValue(KsnipConfigOptions::imgurClientSecretString(), clientSecret); } QByteArray KsnipConfig::imgurAccessToken() const { auto defaultAccessToken = QLatin1String(""); return loadValue(KsnipConfigOptions::imgurAccessTokenString(), defaultAccessToken).toByteArray(); } void KsnipConfig::setImgurAccessToken(const QString& accessToken) { if (imgurAccessToken() == accessToken) { return; } saveValue(KsnipConfigOptions::imgurAccessTokenString(), accessToken); } QByteArray KsnipConfig::imgurRefreshToken() const { auto defaultRefreshToken = QLatin1String(""); return loadValue(KsnipConfigOptions::imgurRefreshTokenString(), defaultRefreshToken).toByteArray(); } void KsnipConfig::setImgurRefreshToken(const QString& refreshToken) { if (imgurRefreshToken() == refreshToken) { return; } saveValue(KsnipConfigOptions::imgurRefreshTokenString(), refreshToken); } bool KsnipConfig::imgurForceAnonymous() const { return loadValue(KsnipConfigOptions::imgurForceAnonymousString(), false).toBool(); } void KsnipConfig::setImgurForceAnonymous(bool enabled) { if (imgurForceAnonymous() == enabled) { return; } saveValue(KsnipConfigOptions::imgurForceAnonymousString(), enabled); } bool KsnipConfig::imgurLinkDirectlyToImage() const { return loadValue(KsnipConfigOptions::imgurLinkDirectlyToImageString(), false).toBool(); } void KsnipConfig::setImgurLinkDirectlyToImage(bool enabled) { if (imgurLinkDirectlyToImage() == enabled) { return; } saveValue(KsnipConfigOptions::imgurLinkDirectlyToImageString(), enabled); } bool KsnipConfig::imgurAlwaysCopyToClipboard() const { return loadValue(KsnipConfigOptions::imgurAlwaysCopyToClipboardString(), false).toBool(); } void KsnipConfig::setImgurAlwaysCopyToClipboard(bool enabled) { if (imgurAlwaysCopyToClipboard() == enabled) { return; } saveValue(KsnipConfigOptions::imgurAlwaysCopyToClipboardString(), enabled); } bool KsnipConfig::imgurOpenLinkInBrowser() const { return loadValue(KsnipConfigOptions::imgurOpenLinkInBrowserString(), true).toBool(); } void KsnipConfig::setImgurOpenLinkInBrowser(bool enabled) { if (imgurOpenLinkInBrowser() == enabled) { return; } saveValue(KsnipConfigOptions::imgurOpenLinkInBrowserString(), enabled); } QString KsnipConfig::imgurBaseUrl() const { return loadValue(KsnipConfigOptions::imgurBaseUrlString(), DefaultValues::ImgurBaseUrl).toString(); } void KsnipConfig::setImgurBaseUrl(const QString &baseUrl) { if (imgurBaseUrl() == baseUrl) { return; } saveValue(KsnipConfigOptions::imgurBaseUrlString(), baseUrl); } // Script Uploader QString KsnipConfig::uploadScriptPath() const { return loadValue(KsnipConfigOptions::uploadScriptPathString(), QString()).toString(); } void KsnipConfig::setUploadScriptPath(const QString &path) { if (uploadScriptPath() == path) { return; } saveValue(KsnipConfigOptions::uploadScriptPathString(), path); } bool KsnipConfig::uploadScriptCopyOutputToClipboard() const { return loadValue(KsnipConfigOptions::uploadScriptCopyOutputToClipboardString(), false).toBool(); } void KsnipConfig::setUploadScriptCopyOutputToClipboard(bool enabled) { if (uploadScriptCopyOutputToClipboard() == enabled) { return; } saveValue(KsnipConfigOptions::uploadScriptCopyOutputToClipboardString(), enabled); } QString KsnipConfig::uploadScriptCopyOutputFilter() const { return loadValue(KsnipConfigOptions::uploadScriptCopyOutputFilterString(), QString()).toString(); } void KsnipConfig::setUploadScriptCopyOutputFilter(const QString ®ex) { if (uploadScriptCopyOutputFilter() == regex) { return; } saveValue(KsnipConfigOptions::uploadScriptCopyOutputFilterString(), regex); } bool KsnipConfig::uploadScriptStopOnStdErr() const { return loadValue(KsnipConfigOptions::uploadScriptStopOnStdErrString(), true).toBool(); } void KsnipConfig::setUploadScriptStopOnStdErr(bool enabled) { if (uploadScriptStopOnStdErr() == enabled) { return; } saveValue(KsnipConfigOptions::uploadScriptStopOnStdErrString(), enabled); } // HotKeys bool KsnipConfig::isGlobalHotKeysEnabledReadOnly() const { return false; } bool KsnipConfig::globalHotKeysEnabled() const { return loadValue(KsnipConfigOptions::globalHotKeysEnabledString(), true).toBool(); } void KsnipConfig::setGlobalHotKeysEnabled(bool enabled) { if (globalHotKeysEnabled() == enabled) { return; } saveValue(KsnipConfigOptions::globalHotKeysEnabledString(), enabled); emit hotKeysChanged(); } QKeySequence KsnipConfig::rectAreaHotKey() const { return loadValue(KsnipConfigOptions::rectAreaHotKeyString(), QKeySequence(Qt::ALT + Qt::SHIFT + Qt::Key_R)).value(); } void KsnipConfig::setRectAreaHotKey(const QKeySequence &keySequence) { if (rectAreaHotKey() == keySequence) { return; } saveValue(KsnipConfigOptions::rectAreaHotKeyString(), keySequence); emit hotKeysChanged(); } QKeySequence KsnipConfig::lastRectAreaHotKey() const { return loadValue(KsnipConfigOptions::lastRectAreaHotKeyString(), QKeySequence(Qt::ALT + Qt::SHIFT + Qt::Key_L)).value(); } void KsnipConfig::setLastRectAreaHotKey(const QKeySequence &keySequence) { if (lastRectAreaHotKey() == keySequence) { return; } saveValue(KsnipConfigOptions::lastRectAreaHotKeyString(), keySequence); emit hotKeysChanged(); } QKeySequence KsnipConfig::fullScreenHotKey() const { return loadValue(KsnipConfigOptions::fullScreenHotKeyString(), QKeySequence(Qt::ALT + Qt::SHIFT + Qt::Key_F)).value(); } void KsnipConfig::setFullScreenHotKey(const QKeySequence &keySequence) { if (fullScreenHotKey() == keySequence) { return; } saveValue(KsnipConfigOptions::fullScreenHotKeyString(), keySequence); emit hotKeysChanged(); } QKeySequence KsnipConfig::currentScreenHotKey() const { return loadValue(KsnipConfigOptions::currentScreenHotKeyString(), QKeySequence(Qt::ALT + Qt::SHIFT + Qt::Key_C)).value(); } void KsnipConfig::setCurrentScreenHotKey(const QKeySequence &keySequence) { if (currentScreenHotKey() == keySequence) { return; } saveValue(KsnipConfigOptions::currentScreenHotKeyString(), keySequence); emit hotKeysChanged(); } QKeySequence KsnipConfig::activeWindowHotKey() const { return loadValue(KsnipConfigOptions::activeWindowHotKeyString(), QKeySequence(Qt::ALT + Qt::SHIFT + Qt::Key_A)).value(); } void KsnipConfig::setActiveWindowHotKey(const QKeySequence &keySequence) { if (activeWindowHotKey() == keySequence) { return; } saveValue(KsnipConfigOptions::activeWindowHotKeyString(), keySequence); emit hotKeysChanged(); } QKeySequence KsnipConfig::windowUnderCursorHotKey() const { return loadValue(KsnipConfigOptions::windowUnderCursorHotKeyString(), QKeySequence(Qt::ALT + Qt::SHIFT + Qt::Key_U)).value(); } void KsnipConfig::setWindowUnderCursorHotKey(const QKeySequence &keySequence) { if (windowUnderCursorHotKey() == keySequence) { return; } saveValue(KsnipConfigOptions::windowUnderCursorHotKeyString(), keySequence); emit hotKeysChanged(); } QKeySequence KsnipConfig::portalHotKey() const { return loadValue(KsnipConfigOptions::portalHotKeyString(), QKeySequence(Qt::ALT + Qt::SHIFT + Qt::Key_T)).value(); } void KsnipConfig::setPortalHotKey(const QKeySequence &keySequence) { if (portalHotKey() == keySequence) { return; } saveValue(KsnipConfigOptions::portalHotKeyString(), keySequence); emit hotKeysChanged(); } // Actions QList KsnipConfig::actions() { QList actions; auto count = mConfig.beginReadArray(KsnipConfigOptions::actionsString()); for (auto index = 0; index < count; index++) { mConfig.setArrayIndex(index); Action action; action.setName(mConfig.value(KsnipConfigOptions::actionNameString()).toString()); action.setShortcut(mConfig.value(KsnipConfigOptions::actionShortcutString()).value()); action.setIsCaptureEnabled(mConfig.value(KsnipConfigOptions::actionIsCaptureEnabledString()).toBool()); action.setIncludeCursor(mConfig.value(KsnipConfigOptions::actionIncludeCursorString()).toBool()); action.setCaptureDelay(mConfig.value(KsnipConfigOptions::actionCaptureDelayString()).toInt()); action.setCaptureMode(mConfig.value(KsnipConfigOptions::actionCaptureModeString()).value()); action.setIsPinScreenshotEnabled(mConfig.value(KsnipConfigOptions::actionIsPinImageEnabledString()).toBool()); action.setIsUploadEnabled(mConfig.value(KsnipConfigOptions::actionIsUploadEnabledString()).toBool()); action.setIsOpenDirectoryEnabled(mConfig.value(KsnipConfigOptions::actionIsOpenDirectoryEnabledString()).toBool()); action.setIsCopyToClipboardEnabled(mConfig.value(KsnipConfigOptions::actionIsCopyToClipboardEnabledString()).toBool()); action.setIsSaveEnabled(mConfig.value(KsnipConfigOptions::actionIsSaveEnabledString()).toBool()); action.setIsHideMainWindowEnabled(mConfig.value(KsnipConfigOptions::actionIsHideMainWindowEnabledString()).toBool()); actions.append(action); } mConfig.endArray(); return actions; } void KsnipConfig::setActions(const QList &actions) { auto savedActions = this->actions(); if(savedActions == actions) { return; } mConfig.remove(KsnipConfigOptions::actionsString()); auto count = actions.count(); mConfig.beginWriteArray(KsnipConfigOptions::actionsString()); for (auto index = 0; index < count; ++index) { const auto& action = actions.at(index); mConfig.setArrayIndex(index); mConfig.setValue(KsnipConfigOptions::actionNameString(), action.name()); mConfig.setValue(KsnipConfigOptions::actionShortcutString(), action.shortcut()); mConfig.setValue(KsnipConfigOptions::actionIsCaptureEnabledString(), action.isCaptureEnabled()); mConfig.setValue(KsnipConfigOptions::actionIncludeCursorString(), action.includeCursor()); mConfig.setValue(KsnipConfigOptions::actionCaptureDelayString(), action.captureDelay()); mConfig.setValue(KsnipConfigOptions::actionCaptureModeString(), static_cast(action.captureMode())); mConfig.setValue(KsnipConfigOptions::actionIsPinImageEnabledString(), action.isPinImageEnabled()); mConfig.setValue(KsnipConfigOptions::actionIsUploadEnabledString(), action.isUploadEnabled()); mConfig.setValue(KsnipConfigOptions::actionIsOpenDirectoryEnabledString(), action.isOpenDirectoryEnabled()); mConfig.setValue(KsnipConfigOptions::actionIsCopyToClipboardEnabledString(), action.isCopyToClipboardEnabled()); mConfig.setValue(KsnipConfigOptions::actionIsSaveEnabledString(), action.isSaveEnabled()); mConfig.setValue(KsnipConfigOptions::actionIsHideMainWindowEnabledString(), action.isHideMainWindowEnabled()); } mConfig.endArray(); emit actionsChanged(); emit hotKeysChanged(); } // Misc void KsnipConfig::saveValue(const QString &key, const QVariant &value) { mConfig.setValue(key, value); mConfig.sync(); } QVariant KsnipConfig::loadValue(const QString &key, const QVariant &defaultValue) const { return mConfig.value(key, defaultValue); } ksnip-1.9.2/src/backend/config/KsnipConfig.h000066400000000000000000000245611414701001100206520ustar00rootroot00000000000000/* * Copyright (C) 2016 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef KSNIP_KSNIPCONFIG_H #define KSNIP_KSNIPCONFIG_H #include #include #include #include #include #include #include "KsnipConfigOptions.h" #include "src/common/enum/CaptureModes.h" #include "src/common/enum/SaveQualityMode.h" #include "src/common/enum/UploaderType.h" #include "src/common/enum/TrayIconDefaultActionMode.h" #include "src/common/helper/PathHelper.h" #include "src/common/constants/DefaultValues.h" #include "src/common/provider/DirectoryPathProvider.h" #include "src/gui/actions/Action.h" class KsnipConfig : public QObject { Q_OBJECT public: KsnipConfig() = default; // Application virtual bool rememberPosition() const; virtual void setRememberPosition(bool enabled); virtual bool promptSaveBeforeExit() const; virtual void setPromptSaveBeforeExit(bool enabled); virtual bool autoCopyToClipboardNewCaptures() const; virtual void setAutoCopyToClipboardNewCaptures(bool enabled); virtual bool autoSaveNewCaptures() const; virtual void setAutoSaveNewCaptures(bool enabled); virtual bool autoHideDocks() const; virtual void setAutoHideDocks(bool enabled); virtual bool autoResizeToContent() const; virtual void setAutoResizeToContent(bool enabled); virtual int resizeToContentDelay() const; virtual void setResizeToContentDelay(int ms); virtual bool useTabs() const; virtual void setUseTabs(bool enabled); virtual bool autoHideTabs() const; virtual void setAutoHideTabs(bool enabled); virtual bool captureOnStartup() const; virtual void setCaptureOnStartup(bool enabled); virtual QPoint windowPosition() const; virtual void setWindowPosition(const QPoint &position); virtual CaptureModes captureMode() const; virtual void setCaptureMode(CaptureModes mode); virtual QString saveDirectory() const; virtual void setSaveDirectory(const QString &path); virtual QString saveFilename() const; virtual void setSaveFilename(const QString &filename); virtual QString saveFormat() const; virtual void setSaveFormat(const QString &format); virtual QString applicationStyle() const; virtual void setApplicationStyle(const QString &style); virtual TrayIconDefaultActionMode defaultTrayIconActionMode() const; virtual void setDefaultTrayIconActionMode(TrayIconDefaultActionMode mode); virtual CaptureModes defaultTrayIconCaptureMode() const; virtual void setDefaultTrayIconCaptureMode(CaptureModes mode); virtual bool useTrayIcon() const; virtual void setUseTrayIcon(bool enabled); virtual bool minimizeToTray() const; virtual void setMinimizeToTray(bool enabled); virtual bool closeToTray() const; virtual void setCloseToTray(bool enabled); virtual bool trayIconNotificationsEnabled() const; virtual void setTrayIconNotificationsEnabled(bool enabled); virtual bool platformSpecificNotificationServiceEnabled() const; virtual void setPlatformSpecificNotificationServiceEnabled(bool enabled); virtual bool startMinimizedToTray() const; virtual void setStartMinimizedToTray(bool enabled); virtual bool rememberLastSaveDirectory() const; virtual void setRememberLastSaveDirectory(bool enabled); virtual bool useSingleInstance() const; virtual void setUseSingleInstance(bool enabled); virtual SaveQualityMode saveQualityMode() const; virtual void setSaveQualityMode(SaveQualityMode mode); virtual int saveQualityFactor() const; virtual void setSaveQualityFactor(int factor); // Annotator virtual bool rememberToolSelection() const; virtual void setRememberToolSelection(bool enabled); virtual bool switchToSelectToolAfterDrawingItem() const; virtual void setSwitchToSelectToolAfterDrawingItem(bool enabled); virtual bool selectItemAfterDrawing() const; virtual void setSelectItemAfterDrawing(bool enabled); virtual bool numberToolSeedChangeUpdatesAllItems() const; virtual void setNumberToolSeedChangeUpdatesAllItems(bool enabled); virtual bool smoothPathEnabled() const; virtual void setSmoothPathEnabled(bool enabled); virtual int smoothFactor() const; virtual void setSmoothFactor(int factor); virtual bool rotateWatermarkEnabled() const; virtual void setRotateWatermarkEnabled(bool enabled); virtual QStringList stickerPaths() const; virtual void setStickerPaths(const QStringList &paths); virtual bool useDefaultSticker() const; virtual void setUseDefaultSticker(bool enabled); virtual QColor canvasColor() const; virtual void setCanvasColor(const QColor &color); // Image Grabber virtual bool isFreezeImageWhileSnippingEnabledReadOnly() const; virtual bool freezeImageWhileSnippingEnabled() const; virtual void setFreezeImageWhileSnippingEnabled(bool enabled); virtual bool captureCursor() const; virtual void setCaptureCursor(bool enabled); virtual bool snippingAreaRulersEnabled() const; virtual void setSnippingAreaRulersEnabled(bool enabled); virtual bool snippingAreaPositionAndSizeInfoEnabled() const; virtual void setSnippingAreaPositionAndSizeInfoEnabled(bool enabled); virtual bool showMainWindowAfterTakingScreenshotEnabled() const; virtual void setShowMainWindowAfterTakingScreenshotEnabled(bool enabled); virtual bool isSnippingAreaMagnifyingGlassEnabledReadOnly() const; virtual bool snippingAreaMagnifyingGlassEnabled() const; virtual void setSnippingAreaMagnifyingGlassEnabled(bool enabled); virtual int captureDelay() const; virtual void setCaptureDelay(int delay); virtual int snippingCursorSize() const; virtual void setSnippingCursorSize(int size); virtual QColor snippingCursorColor() const; virtual void setSnippingCursorColor(const QColor &color); virtual QColor snippingAdornerColor() const; virtual void setSnippingAdornerColor(const QColor &color); virtual int snippingAreaTransparency() const; virtual void setSnippingAreaTransparency(int transparency); virtual QRect lastRectArea() const; virtual void setLastRectArea(const QRect &rectArea); virtual bool isForceGenericWaylandEnabledReadOnly() const; virtual bool forceGenericWaylandEnabled() const; virtual void setForceGenericWaylandEnabled(bool enabled); virtual bool isScaleGenericWaylandScreenshotEnabledReadOnly() const; virtual bool scaleGenericWaylandScreenshotsEnabled() const; virtual void setScaleGenericWaylandScreenshots(bool enabled); virtual bool hideMainWindowDuringScreenshot() const; virtual void setHideMainWindowDuringScreenshot(bool enabled); virtual bool allowResizingRectSelection() const; virtual void setAllowResizingRectSelection(bool enabled); virtual bool showSnippingAreaInfoText() const; virtual void setShowSnippingAreaInfoText(bool enabled); // Uploader virtual bool confirmBeforeUpload() const; virtual void setConfirmBeforeUpload(bool enabled); virtual UploaderType uploaderType() const; virtual void setUploaderType(UploaderType type); // Imgur Uploader virtual QString imgurUsername() const; virtual void setImgurUsername(const QString &username); virtual QByteArray imgurClientId() const; virtual void setImgurClientId(const QString &clientId); virtual QByteArray imgurClientSecret() const; virtual void setImgurClientSecret(const QString &clientSecret); virtual QByteArray imgurAccessToken() const; virtual void setImgurAccessToken(const QString &accessToken); virtual QByteArray imgurRefreshToken() const; virtual void setImgurRefreshToken(const QString &refreshToken); virtual bool imgurForceAnonymous() const; virtual void setImgurForceAnonymous(bool enabled); virtual bool imgurLinkDirectlyToImage() const; virtual void setImgurLinkDirectlyToImage(bool enabled); virtual bool imgurAlwaysCopyToClipboard() const; virtual void setImgurAlwaysCopyToClipboard(bool enabled); virtual bool imgurOpenLinkInBrowser() const; virtual void setImgurOpenLinkInBrowser(bool enabled); virtual QString imgurBaseUrl() const; virtual void setImgurBaseUrl(const QString &baseUrl); // Script Uploader virtual QString uploadScriptPath() const; virtual void setUploadScriptPath(const QString &path); virtual bool uploadScriptCopyOutputToClipboard() const; virtual void setUploadScriptCopyOutputToClipboard(bool enabled); virtual QString uploadScriptCopyOutputFilter() const; virtual void setUploadScriptCopyOutputFilter(const QString ®ex); virtual bool uploadScriptStopOnStdErr() const; virtual void setUploadScriptStopOnStdErr(bool enabled); // HotKeys virtual bool isGlobalHotKeysEnabledReadOnly() const; virtual bool globalHotKeysEnabled() const; virtual void setGlobalHotKeysEnabled(bool enabled); virtual QKeySequence rectAreaHotKey() const; virtual void setRectAreaHotKey(const QKeySequence &keySequence); virtual QKeySequence lastRectAreaHotKey() const; virtual void setLastRectAreaHotKey(const QKeySequence &keySequence); virtual QKeySequence fullScreenHotKey() const; virtual void setFullScreenHotKey(const QKeySequence &keySequence); virtual QKeySequence currentScreenHotKey() const; virtual void setCurrentScreenHotKey(const QKeySequence &keySequence); virtual QKeySequence activeWindowHotKey() const; virtual void setActiveWindowHotKey(const QKeySequence &keySequence); virtual QKeySequence windowUnderCursorHotKey() const; virtual void setWindowUnderCursorHotKey(const QKeySequence &keySequence); virtual QKeySequence portalHotKey() const; virtual void setPortalHotKey(const QKeySequence &keySequence); // Actions virtual QList actions(); virtual void setActions(const QList &actions); signals: void annotatorConfigChanged() const; void hotKeysChanged() const; void actionsChanged() const; private: QSettings mConfig; void saveValue(const QString &key, const QVariant &value); QVariant loadValue(const QString &key, const QVariant &defaultValue = QVariant()) const; }; #endif // KSNIP_KSNIPCONFIG_H ksnip-1.9.2/src/backend/config/KsnipConfigOptions.cpp000066400000000000000000000326431414701001100225610ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "KsnipConfigOptions.h" QString KsnipConfigOptions::rememberPositionString() { return applicationSectionString() + QLatin1String("SavePosition"); } QString KsnipConfigOptions::promptSaveBeforeExitString() { return applicationSectionString() + QLatin1String("PromptSaveBeforeExit"); } QString KsnipConfigOptions::autoCopyToClipboardNewCapturesString() { return applicationSectionString() + QLatin1String("AutoCopyToClipboardNewCaptures"); } QString KsnipConfigOptions::autoSaveNewCapturesString() { return applicationSectionString() + QLatin1String("AutoSaveNewCaptures"); } QString KsnipConfigOptions::rememberToolSelectionString() { return annotatorSectionString() + QLatin1String("SaveToolsSelection"); } QString KsnipConfigOptions::switchToSelectToolAfterDrawingItemString() { return annotatorSectionString() + QLatin1String("SwitchToSelectToolAfterDrawingItem"); } QString KsnipConfigOptions::selectItemAfterDrawingString() { return annotatorSectionString() + QLatin1String("SelectItemAfterDrawing"); } QString KsnipConfigOptions::numberToolSeedChangeUpdatesAllItemsString() { return annotatorSectionString() + QLatin1String("NumberToolSeedChangeUpdatesAllItems"); } QString KsnipConfigOptions::useTabsString() { return applicationSectionString() + QLatin1String("UseTabs"); } QString KsnipConfigOptions::autoHideTabsString() { return applicationSectionString() + QLatin1String("AutoHideTabs"); } QString KsnipConfigOptions::captureOnStartupString() { return applicationSectionString() + QLatin1String("CaptureOnStartup"); } QString KsnipConfigOptions::autoHideDocksString() { return applicationSectionString() + QLatin1String("AutoHideDocks"); } QString KsnipConfigOptions::autoResizeToContentString() { return applicationSectionString() + QLatin1String("AutoResizeToContent"); } QString KsnipConfigOptions::resizeToContentDelayString() { return applicationSectionString() + QLatin1String("ResizeToContentDelay"); } QString KsnipConfigOptions::freezeImageWhileSnippingEnabledString() { return imageGrabberSectionString() + QLatin1String("FreezeImageWhileSnippingEnabled"); } QString KsnipConfigOptions::positionString() { return mainWindowSectionString() + QLatin1String("Position"); } QString KsnipConfigOptions::captureModeString() { return imageGrabberSectionString() + QLatin1String("CaptureMode"); } QString KsnipConfigOptions::saveQualityModeString() { return saveSectionString() + QLatin1String("SaveQualityMode"); } QString KsnipConfigOptions::saveQualityFactorString() { return saveSectionString() + QLatin1String("SaveQualityFactor"); } QString KsnipConfigOptions::saveDirectoryString() { return applicationSectionString() + QLatin1String("SaveDirectory"); } QString KsnipConfigOptions::saveFilenameString() { return applicationSectionString() + QLatin1String("SaveFilename"); } QString KsnipConfigOptions::saveFormatString() { return applicationSectionString() + QLatin1String("SaveFormat"); } QString KsnipConfigOptions::applicationStyleString() { return applicationSectionString() + QLatin1String("ApplicationStyle"); } QString KsnipConfigOptions::trayIconDefaultActionModeString() { return applicationSectionString() + QLatin1String("TrayIconDefaultActionMode"); } QString KsnipConfigOptions::trayIconDefaultCaptureModeString() { return applicationSectionString() + QLatin1String("TrayIconDefaultCaptureMode"); } QString KsnipConfigOptions::useTrayIconString() { return applicationSectionString() + QLatin1String("UseTrayIcon"); } QString KsnipConfigOptions::minimizeToTrayString() { return applicationSectionString() + QLatin1String("MinimizeToTray"); } QString KsnipConfigOptions::closeToTrayString() { return applicationSectionString() + QLatin1String("CloseToTray"); } QString KsnipConfigOptions::trayIconNotificationsEnabledString() { return applicationSectionString() + QLatin1String("TrayIconNotificationsEnabled"); } QString KsnipConfigOptions::platformSpecificNotificationServiceEnabledString() { return applicationSectionString() + QLatin1String("PlatformSpecificNotificationServiceEnabled"); } QString KsnipConfigOptions::startMinimizedToTrayString() { return applicationSectionString() + QLatin1String("StartMinimizedToTray"); } QString KsnipConfigOptions::rememberLastSaveDirectoryString() { return applicationSectionString() + QLatin1String("RememberLastSaveDirectory"); } QString KsnipConfigOptions::useSingleInstanceString() { return applicationSectionString() + QLatin1String("UseSingleInstanceString"); } QString KsnipConfigOptions::hideMainWindowDuringScreenshotString() { return applicationSectionString() + QLatin1String("HideMainWindowDuringScreenshot"); } QString KsnipConfigOptions::allowResizingRectSelectionString() { return applicationSectionString() + QLatin1String("AllowResizingRectSelection"); } QString KsnipConfigOptions::showSnippingAreaInfoTextString() { return applicationSectionString() + QLatin1String("ShowSnippingAreaInfoText"); } QString KsnipConfigOptions::smoothPathEnabledString() { return annotatorSectionString() + QLatin1String("SmoothPathEnabled"); } QString KsnipConfigOptions::smoothPathFactorString() { return annotatorSectionString() + QLatin1String("SmoothPathFactor"); } QString KsnipConfigOptions::rotateWatermarkEnabledString() { return annotatorSectionString() + QLatin1String("RotateWatermark"); } QString KsnipConfigOptions::stickerPathsString() { return annotatorSectionString() + QLatin1String("StickerPaths"); } QString KsnipConfigOptions::useDefaultStickerString() { return annotatorSectionString() + QLatin1String("UseDefaultSticker"); } QString KsnipConfigOptions::captureCursorString() { return imageGrabberSectionString() + QLatin1String("CaptureCursor"); } QString KsnipConfigOptions::snippingAreaRulersEnabledString() { return imageGrabberSectionString() + QLatin1String("SnippingAreaRulersEnabled"); } QString KsnipConfigOptions::snippingAreaPositionAndSizeInfoEnabledString() { return imageGrabberSectionString() + QLatin1String("SnippingAreaPositionAndSizeInfoEnabled"); } QString KsnipConfigOptions::snippingAreaMagnifyingGlassEnabledString() { return imageGrabberSectionString() + QLatin1String("SnippingAreaMagnifyingGlassEnabled"); } QString KsnipConfigOptions::showMainWindowAfterTakingScreenshotEnabledString() { return imageGrabberSectionString() + QLatin1String("ShowMainWindowAfterTakingScreenshotEnabled"); } QString KsnipConfigOptions::captureDelayString() { return imageGrabberSectionString() + QLatin1String("CaptureDelay"); } QString KsnipConfigOptions::snippingCursorSizeString() { return imageGrabberSectionString() + QLatin1String("SnippingCursorSize"); } QString KsnipConfigOptions::snippingCursorColorString() { return imageGrabberSectionString() + QLatin1String("SnippingCursorColor"); } QString KsnipConfigOptions::snippingAdornerColorString() { return imageGrabberSectionString() + QLatin1String("SnippingAdornerColor"); } QString KsnipConfigOptions::snippingAreaTransparencyString() { return imageGrabberSectionString() + QLatin1String("SnippingAreaTransparency"); } QString KsnipConfigOptions::lastRectAreaString() { return imageGrabberSectionString() + QLatin1String("LastRectArea"); } QString KsnipConfigOptions::forceGenericWaylandEnabledString() { return imageGrabberSectionString() + QLatin1String("ForceGenericWaylandEnabled"); } QString KsnipConfigOptions::scaleWaylandScreenshotsEnabledString() { return imageGrabberSectionString() + QLatin1String("ScaleGenericWaylandScreenshotsEnabledString"); } QString KsnipConfigOptions::imgurUsernameString() { return imgurSectionString() + QLatin1String("Username"); } QString KsnipConfigOptions::imgurClientIdString() { return imgurSectionString() + QLatin1String("ClientId"); } QString KsnipConfigOptions::imgurClientSecretString() { return imgurSectionString() + QLatin1String("ClientSecret"); } QString KsnipConfigOptions::imgurAccessTokenString() { return imgurSectionString() + QLatin1String("AccessToken"); } QString KsnipConfigOptions::imgurRefreshTokenString() { return imgurSectionString() + QLatin1String("RefreshToken"); } QString KsnipConfigOptions::imgurForceAnonymousString() { return imgurSectionString() + QLatin1String("ForceAnonymous"); } QString KsnipConfigOptions::imgurLinkDirectlyToImageString() { return imgurSectionString() + QLatin1String("OpenLinkDirectlyToImage"); } QString KsnipConfigOptions::imgurOpenLinkInBrowserString() { return imgurSectionString() + QLatin1String("OpenLinkInBrowser"); } QString KsnipConfigOptions::imgurAlwaysCopyToClipboardString() { return imgurSectionString() + QLatin1String("AlwaysCopyToClipboard"); } QString KsnipConfigOptions::imgurBaseUrlString() { return imgurSectionString() + QLatin1String("BaseUrl"); } QString KsnipConfigOptions::uploadScriptPathString() { return uploadScriptSectionString() + QLatin1String("UploadScriptPath"); } QString KsnipConfigOptions::confirmBeforeUploadString() { return uploaderSectionString() + QLatin1String("ConfirmBeforeUpload"); } QString KsnipConfigOptions::uploaderTypeString() { return uploaderSectionString() + QLatin1String("UploaderType"); } QString KsnipConfigOptions::canvasColorString() { return annotatorSectionString() + QLatin1String("CanvasColor"); } QString KsnipConfigOptions::actionsString() { return QLatin1String("Actions"); } QString KsnipConfigOptions::actionNameString() { return QLatin1String("Name"); } QString KsnipConfigOptions::actionShortcutString() { return QLatin1String("Shortcut"); } QString KsnipConfigOptions::actionIsCaptureEnabledString() { return QLatin1String("IsCaptureEnabled"); } QString KsnipConfigOptions::actionIncludeCursorString() { return QLatin1String("IncludeCursor"); } QString KsnipConfigOptions::actionCaptureDelayString() { return QLatin1String("CaptureDelay"); } QString KsnipConfigOptions::actionCaptureModeString() { return QLatin1String("CaptureMode"); } QString KsnipConfigOptions::actionIsPinImageEnabledString() { return QLatin1String("IsPinImageEnabled"); } QString KsnipConfigOptions::actionIsUploadEnabledString() { return QLatin1String("IsUploadEnabled"); } QString KsnipConfigOptions::actionIsOpenDirectoryEnabledString() { return QLatin1String("IsOpenDirectoryEnabled"); } QString KsnipConfigOptions::actionIsCopyToClipboardEnabledString() { return QLatin1String("IsCopyToClipboardEnabled"); } QString KsnipConfigOptions::actionIsSaveEnabledString() { return QLatin1String("IsSaveEnabled"); } QString KsnipConfigOptions::actionIsHideMainWindowEnabledString() { return QLatin1String("IsHideMainWindowEnabled"); } QString KsnipConfigOptions::uploadScriptCopyOutputToClipboardString() { return uploadScriptSectionString() + QLatin1String("CopyOutputToClipboard"); } QString KsnipConfigOptions::uploadScriptStopOnStdErrString() { return uploadScriptSectionString() + QLatin1String("UploadScriptStoOnStdErr"); } QString KsnipConfigOptions::uploadScriptCopyOutputFilterString() { return uploadScriptSectionString() + QLatin1String("CopyOutputFilter"); } QString KsnipConfigOptions::globalHotKeysEnabledString() { return hotKeysSectionString() + QLatin1String("GlobalHotKeysEnabled"); } QString KsnipConfigOptions::rectAreaHotKeyString() { return hotKeysSectionString() + QLatin1String("RectAreaHotKey"); } QString KsnipConfigOptions::lastRectAreaHotKeyString() { return hotKeysSectionString() + QLatin1String("LastRectAreaHotKey"); } QString KsnipConfigOptions::fullScreenHotKeyString() { return hotKeysSectionString() + QLatin1String("FullScreenHotKey"); } QString KsnipConfigOptions::currentScreenHotKeyString() { return hotKeysSectionString() + QLatin1String("CurrentScreenHotKey"); } QString KsnipConfigOptions::activeWindowHotKeyString() { return hotKeysSectionString() + QLatin1String("ActiveWindowHotKey"); } QString KsnipConfigOptions::windowUnderCursorHotKeyString() { return hotKeysSectionString() + QLatin1String("WindowUnderCursorHotKey"); } QString KsnipConfigOptions::portalHotKeyString() { return hotKeysSectionString() + QLatin1String("PortalHotKey"); } QString KsnipConfigOptions::applicationSectionString() { return QLatin1String("Application/"); } QString KsnipConfigOptions::imageGrabberSectionString() { return QLatin1String("ImageGrabber/"); } QString KsnipConfigOptions::annotatorSectionString() { return QLatin1String("Painter/"); } QString KsnipConfigOptions::uploaderSectionString() { return QLatin1String("Uploader/"); } QString KsnipConfigOptions::imgurSectionString() { return QLatin1String("Imgur/"); } QString KsnipConfigOptions::uploadScriptSectionString() { return QLatin1String("UploadScript/"); } QString KsnipConfigOptions::hotKeysSectionString() { return QLatin1String("HotKeys/"); } QString KsnipConfigOptions::mainWindowSectionString() { return QLatin1String("MainWindow/"); } QString KsnipConfigOptions::saveSectionString() { return QLatin1String("Save/"); } ksnip-1.9.2/src/backend/config/KsnipConfigOptions.h000066400000000000000000000126771414701001100222330ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_KSNIPCONFIGOPTIONS_H #define KSNIP_KSNIPCONFIGOPTIONS_H #include class KsnipConfigOptions { public: static QString rememberPositionString(); static QString promptSaveBeforeExitString(); static QString autoCopyToClipboardNewCapturesString(); static QString autoSaveNewCapturesString(); static QString rememberToolSelectionString(); static QString switchToSelectToolAfterDrawingItemString(); static QString selectItemAfterDrawingString(); static QString numberToolSeedChangeUpdatesAllItemsString(); static QString useTabsString(); static QString autoHideTabsString(); static QString captureOnStartupString(); static QString freezeImageWhileSnippingEnabledString(); static QString positionString(); static QString autoHideDocksString(); static QString autoResizeToContentString(); static QString resizeToContentDelayString(); static QString captureModeString(); static QString saveQualityModeString(); static QString saveQualityFactorString(); static QString saveDirectoryString(); static QString saveFilenameString(); static QString saveFormatString(); static QString applicationStyleString(); static QString trayIconDefaultActionModeString(); static QString trayIconDefaultCaptureModeString(); static QString useTrayIconString(); static QString minimizeToTrayString(); static QString closeToTrayString(); static QString trayIconNotificationsEnabledString(); static QString platformSpecificNotificationServiceEnabledString(); static QString startMinimizedToTrayString(); static QString rememberLastSaveDirectoryString(); static QString useSingleInstanceString(); static QString hideMainWindowDuringScreenshotString(); static QString allowResizingRectSelectionString(); static QString showSnippingAreaInfoTextString(); static QString smoothPathEnabledString(); static QString smoothPathFactorString(); static QString rotateWatermarkEnabledString(); static QString stickerPathsString(); static QString useDefaultStickerString(); static QString captureCursorString(); static QString snippingAreaRulersEnabledString(); static QString snippingAreaPositionAndSizeInfoEnabledString(); static QString snippingAreaMagnifyingGlassEnabledString(); static QString showMainWindowAfterTakingScreenshotEnabledString(); static QString captureDelayString(); static QString snippingCursorSizeString(); static QString snippingCursorColorString(); static QString snippingAdornerColorString(); static QString snippingAreaTransparencyString(); static QString lastRectAreaString(); static QString forceGenericWaylandEnabledString(); static QString scaleWaylandScreenshotsEnabledString(); static QString imgurUsernameString(); static QString imgurClientIdString(); static QString imgurClientSecretString(); static QString imgurAccessTokenString(); static QString imgurRefreshTokenString(); static QString imgurForceAnonymousString(); static QString imgurLinkDirectlyToImageString(); static QString imgurOpenLinkInBrowserString(); static QString imgurAlwaysCopyToClipboardString(); static QString imgurBaseUrlString(); static QString uploadScriptPathString(); static QString confirmBeforeUploadString(); static QString uploadScriptCopyOutputToClipboardString(); static QString uploadScriptStopOnStdErrString(); static QString uploadScriptCopyOutputFilterString(); static QString globalHotKeysEnabledString(); static QString rectAreaHotKeyString(); static QString lastRectAreaHotKeyString(); static QString fullScreenHotKeyString(); static QString currentScreenHotKeyString(); static QString activeWindowHotKeyString(); static QString windowUnderCursorHotKeyString(); static QString portalHotKeyString(); static QString uploaderTypeString(); static QString canvasColorString(); static QString actionsString(); static QString actionNameString(); static QString actionShortcutString(); static QString actionIsCaptureEnabledString(); static QString actionIncludeCursorString(); static QString actionCaptureDelayString(); static QString actionCaptureModeString(); static QString actionIsPinImageEnabledString(); static QString actionIsUploadEnabledString(); static QString actionIsOpenDirectoryEnabledString(); static QString actionIsCopyToClipboardEnabledString(); static QString actionIsSaveEnabledString(); static QString actionIsHideMainWindowEnabledString(); private: static QString applicationSectionString(); static QString imageGrabberSectionString(); static QString annotatorSectionString(); static QString uploaderSectionString(); static QString imgurSectionString(); static QString uploadScriptSectionString(); static QString hotKeysSectionString(); static QString mainWindowSectionString(); static QString saveSectionString(); }; #endif //KSNIP_KSNIPCONFIGOPTIONS_H ksnip-1.9.2/src/backend/config/KsnipConfigProvider.cpp000066400000000000000000000023241414701001100227110ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "KsnipConfigProvider.h" KsnipConfig* KsnipConfigProvider::instance() { #if defined(__APPLE__) static KsnipMacConfig instance; return &instance; #endif #if defined(UNIX_X11) if (PlatformChecker::instance()->isWayland()) { static KsnipWaylandConfig instance; return &instance; } else { static KsnipConfig instance; return &instance; } #endif #if defined(_WIN32) static KsnipConfig instance; return &instance; #endif } ksnip-1.9.2/src/backend/config/KsnipConfigProvider.h000066400000000000000000000023741414701001100223630ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_KSNIPCONFIGPROVIDER_H #define KSNIP_KSNIPCONFIGPROVIDER_H #include "KsnipWaylandConfig.h" #if defined(__APPLE__) #include "KsnipMacConfig.h" #endif #if defined(UNIX_X11) #include "KsnipWaylandConfig.h" #include "src/common/platform/PlatformChecker.h" #endif #if defined(_WIN32) #include "KsnipConfig.h" #endif class KsnipConfigProvider { public: static KsnipConfig *instance(); private: KsnipConfigProvider() = default; }; #endif //KSNIP_KSNIPCONFIGPROVIDER_H ksnip-1.9.2/src/backend/config/KsnipMacConfig.cpp000066400000000000000000000021621414701001100216170ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "KsnipMacConfig.h" bool KsnipMacConfig::isFreezeImageWhileSnippingEnabledReadOnly() const { return true; } bool KsnipMacConfig::freezeImageWhileSnippingEnabled() const { return true; } bool KsnipMacConfig::isGlobalHotKeysEnabledReadOnly() const { return true; } bool KsnipMacConfig::globalHotKeysEnabled() const { return false; }ksnip-1.9.2/src/backend/config/KsnipMacConfig.h000066400000000000000000000022501414701001100212620ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_KSNIPMACCONFIG_H #define KSNIP_KSNIPMACCONFIG_H #include "KsnipConfig.h" class KsnipMacConfig : public KsnipConfig { public: bool isFreezeImageWhileSnippingEnabledReadOnly() const override; bool freezeImageWhileSnippingEnabled() const override; bool isGlobalHotKeysEnabledReadOnly() const override; bool globalHotKeysEnabled() const override; }; #endif //KSNIP_KSNIPMACCONFIG_H ksnip-1.9.2/src/backend/config/KsnipWaylandConfig.cpp000066400000000000000000000030051414701001100225130ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "KsnipWaylandConfig.h" bool KsnipWaylandConfig::isFreezeImageWhileSnippingEnabledReadOnly() const { return true; } bool KsnipWaylandConfig::freezeImageWhileSnippingEnabled() const { return false; } bool KsnipWaylandConfig::isGlobalHotKeysEnabledReadOnly() const { return true; } bool KsnipWaylandConfig::globalHotKeysEnabled() const { return false; } bool KsnipWaylandConfig::isSnippingAreaMagnifyingGlassEnabledReadOnly() const { return true; } bool KsnipWaylandConfig::snippingAreaMagnifyingGlassEnabled() const { return false; } bool KsnipWaylandConfig::isForceGenericWaylandEnabledReadOnly() const { return false; } bool KsnipWaylandConfig::isScaleGenericWaylandScreenshotEnabledReadOnly() const { return false; } ksnip-1.9.2/src/backend/config/KsnipWaylandConfig.h000066400000000000000000000027051414701001100221660ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_KSNIPWAYLANDCONFIG_H #define KSNIP_KSNIPWAYLANDCONFIG_H #include "KsnipConfig.h" class KsnipWaylandConfig : public KsnipConfig { public: bool isFreezeImageWhileSnippingEnabledReadOnly() const override; bool freezeImageWhileSnippingEnabled() const override; bool isGlobalHotKeysEnabledReadOnly() const override; bool globalHotKeysEnabled() const override; bool isSnippingAreaMagnifyingGlassEnabledReadOnly() const override; bool snippingAreaMagnifyingGlassEnabled() const override; bool isForceGenericWaylandEnabledReadOnly() const override; bool isScaleGenericWaylandScreenshotEnabledReadOnly() const override; }; #endif //KSNIP_KSNIPWAYLANDCONFIG_H ksnip-1.9.2/src/backend/imageGrabber/000077500000000000000000000000001414701001100173615ustar00rootroot00000000000000ksnip-1.9.2/src/backend/imageGrabber/AbstractImageGrabber.cpp000066400000000000000000000050561414701001100240660ustar00rootroot00000000000000/* * Copyright (C) 2017 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "AbstractImageGrabber.h" AbstractImageGrabber::AbstractImageGrabber() : mConfig(KsnipConfigProvider::instance()), mIsCaptureCursorEnabled(false), mCaptureDelay(0), mCaptureMode(CaptureModes::FullScreen) { } bool AbstractImageGrabber::isCaptureModeSupported(CaptureModes captureMode) const { return mSupportedCaptureModes.contains(captureMode); } QList AbstractImageGrabber::supportedCaptureModes() const { return mSupportedCaptureModes; } void AbstractImageGrabber::grabImage(CaptureModes captureMode, bool captureCursor, int delay) { setIsCaptureCursorEnabled(captureCursor); setCaptureDelay(delay); setCaptureMode(captureMode); QTimer::singleShot(captureDelay(), this, &AbstractImageGrabber::grab); } void AbstractImageGrabber::addSupportedCaptureMode(CaptureModes captureMode) { mSupportedCaptureModes.append(captureMode); } void AbstractImageGrabber::setCaptureDelay(int delay) { mCaptureDelay = mDelayHandler.getDelay(delay); } int AbstractImageGrabber::captureDelay() const { return mCaptureDelay; } CaptureModes AbstractImageGrabber::captureMode() const { return mCaptureMode; } void AbstractImageGrabber::setCaptureMode(CaptureModes captureMode) { if (isCaptureModeSupported(captureMode)) { mCaptureMode = captureMode; } else { qWarning("Unsupported Capture Mode selected, falling back to full screen."); mCaptureMode = CaptureModes::FullScreen; } } bool AbstractImageGrabber::isCaptureDelayBelowMin() const { return mCaptureDelay <= mDelayHandler.minDelayInMs(); } bool AbstractImageGrabber::isCaptureCursorEnabled() const { return mIsCaptureCursorEnabled; } void AbstractImageGrabber::setIsCaptureCursorEnabled(bool enabled) { mIsCaptureCursorEnabled = enabled; } ksnip-1.9.2/src/backend/imageGrabber/AbstractImageGrabber.h000066400000000000000000000042061414701001100235270ustar00rootroot00000000000000/* * Copyright (C) 2017 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_ABSTRACTIMAGEGRABBER_H #define KSNIP_ABSTRACTIMAGEGRABBER_H #include #include #include "src/common/dtos/CaptureDto.h" #include "src/common/enum/CaptureModes.h" #include "src/common/handler/DelayHandler.h" #include "src/backend/config/KsnipConfigProvider.h" class AbstractImageGrabber : public QObject { Q_OBJECT public: explicit AbstractImageGrabber(); ~AbstractImageGrabber() override = default; bool isCaptureModeSupported(CaptureModes captureMode) const; QList supportedCaptureModes() const; virtual void grabImage(CaptureModes captureMode, bool captureCursor, int delay); signals: void finished(const CaptureDto &capture) const; void canceled() const; protected: KsnipConfig* mConfig; void addSupportedCaptureMode(CaptureModes captureMode); void setCaptureDelay(int delay); int captureDelay() const; void setCaptureMode(CaptureModes captureMode); CaptureModes captureMode() const; bool isCaptureDelayBelowMin() const; bool isCaptureCursorEnabled() const; void setIsCaptureCursorEnabled(bool enabled); protected slots: virtual void grab() = 0; private: QList mSupportedCaptureModes; int mCaptureDelay; CaptureModes mCaptureMode; bool mIsCaptureCursorEnabled; DelayHandler mDelayHandler; }; #endif //KSNIP_ABSTRACTIMAGEGRABBER_H ksnip-1.9.2/src/backend/imageGrabber/AbstractRectAreaImageGrabber.cpp000066400000000000000000000160201414701001100254660ustar00rootroot00000000000000/* * Copyright (C) 2017 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "AbstractRectAreaImageGrabber.h" AbstractRectAreaImageGrabber::AbstractRectAreaImageGrabber(AbstractSnippingArea *snippingArea) : mSnippingArea(snippingArea), mFreezeImageWhileSnipping(mConfig->freezeImageWhileSnippingEnabled()) { Q_ASSERT(mSnippingArea != nullptr); connectSnippingAreaCancel(); } AbstractRectAreaImageGrabber::~AbstractRectAreaImageGrabber() { delete mSnippingArea; } void AbstractRectAreaImageGrabber::grabImage(CaptureModes captureMode, bool captureCursor, int delay) { setIsCaptureCursorEnabled(captureCursor); setCaptureDelay(delay); setCaptureMode(captureMode); if (isRectAreaCaptureWithoutBackground()) { openSnippingAreaWithoutBackground(); } else { QTimer::singleShot(captureDelay(), this, &AbstractRectAreaImageGrabber::prepareGrab); } } /* * Returns the rect of the screen where the mouse cursor is currently located */ QRect AbstractRectAreaImageGrabber::currentScreenRect() const { #if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) auto screen = QGuiApplication::screenAt(QCursor::pos()); if (screen == nullptr) { screen = QGuiApplication::primaryScreen(); } return screen->geometry(); #else auto screen = QApplication::desktop()->screenNumber(QCursor::pos()); return QApplication::desktop()->screenGeometry(screen); #endif } QRect AbstractRectAreaImageGrabber::lastRectArea() const { auto rectArea = mConfig->lastRectArea(); if(rectArea.isNull()) { qWarning("ImageGrabber: No RectArea found, capturing full screen."); return fullScreenRect(); } return rectArea; } void AbstractRectAreaImageGrabber::openSnippingAreaWithoutBackground() { connectSnippingAreaFinish(); mSnippingArea->showWithoutBackground(); } void AbstractRectAreaImageGrabber::openSnippingAreaWithBackground(const QPixmap& background) { connectSnippingAreaFinish(); mSnippingArea->showWithBackground(background); } QRect AbstractRectAreaImageGrabber::selectedSnippingAreaRect() const { return mSnippingArea->selectedRectArea(); } QPixmap AbstractRectAreaImageGrabber::snippingAreaBackground() const { return mSnippingArea->background(); } QPixmap AbstractRectAreaImageGrabber::getScreenshotFromRect(const QRect &rect) const { auto screen = QGuiApplication::primaryScreen(); auto windowId = QApplication::desktop()->winId(); auto rectPosition = rect.topLeft(); return screen->grabWindow(windowId, rectPosition.x(), rectPosition.y(), rect.width(), rect.height()); } QPixmap AbstractRectAreaImageGrabber::getScreenshot() const { if (isRectAreaCaptureWithBackground()) { return snippingAreaBackground().copy(mCaptureRect); } else { return getScreenshotFromRect(mCaptureRect); } } void AbstractRectAreaImageGrabber::setCaptureRectFromCorrectSource() { switch (captureMode()) { case CaptureModes::RectArea: mCaptureRect = selectedSnippingAreaRect(); break; case CaptureModes::LastRectArea: mCaptureRect = lastRectArea(); break; case CaptureModes::CurrentScreen: mCaptureRect = currentScreenRect(); break; case CaptureModes::ActiveWindow: mCaptureRect = activeWindowRect(); if (mCaptureRect.isNull()) { qWarning("ImageGrabber::getActiveWindow: Found no window with focus."); mCaptureRect = currentScreenRect(); } break; default: mCaptureRect = fullScreenRect(); } } bool AbstractRectAreaImageGrabber::isSnippingAreaBackgroundTransparent() const { return !mFreezeImageWhileSnipping; } void AbstractRectAreaImageGrabber::prepareGrab() { if (isRectAreaCaptureWithBackground()) { openSnippingArea(); } else { grab(); } } void AbstractRectAreaImageGrabber::grab() { setCaptureRectFromCorrectSource(); CaptureDto capture(getScreenshot()); if (shouldCaptureCursor()) { capture.cursor = getCursorRelativeToScreenshot(); } emit finished(capture); } CursorDto AbstractRectAreaImageGrabber::getCursorRelativeToScreenshot() const { auto cursor = getCursorImageWithPositionFromCorrectSource(); if (mCaptureRect.contains(cursor.position)) { cursor.position -= mCaptureRect.topLeft(); // The final cursor is inserted with offset from 0,0 return cursor; } else { return {}; } } bool AbstractRectAreaImageGrabber::shouldCaptureCursor() const { return isCaptureCursorEnabled() && !(captureMode() == CaptureModes::RectArea && isCaptureDelayBelowMin()); } void AbstractRectAreaImageGrabber::openSnippingArea() { if (isSnippingAreaBackgroundTransparent()) { openSnippingAreaWithoutBackground(); } else { auto screenRect = fullScreenRect(); auto background = getScreenshotFromRect(screenRect); storeCursorForPostProcessing(screenRect); openSnippingAreaWithBackground(background); } } void AbstractRectAreaImageGrabber::storeCursorForPostProcessing(const QRect &screenRect) { auto offset = screenRect.topLeft(); auto cursorWithPosition = getCursorWithPosition(); cursorWithPosition.position -= offset; // Fix in case left most monitor has negative position mStoredCursorImageWithPosition = cursorWithPosition; } void AbstractRectAreaImageGrabber::connectSnippingAreaCancel() { connect(mSnippingArea, &AbstractSnippingArea::canceled, this, &AbstractRectAreaImageGrabber::canceled); } void AbstractRectAreaImageGrabber::connectSnippingAreaFinish() { disconnectSnippingAreaFinish(); if (isSnippingAreaBackgroundTransparent()) { connect(mSnippingArea, &AbstractSnippingArea::finished, [this]() { QTimer::singleShot(captureDelay(), this, &AbstractRectAreaImageGrabber::grab); }); } else { connect(mSnippingArea, &AbstractSnippingArea::finished, this, &AbstractRectAreaImageGrabber::grab); } } void AbstractRectAreaImageGrabber::disconnectSnippingAreaFinish() { disconnect(mSnippingArea, &AbstractSnippingArea::finished, nullptr, nullptr); } CursorDto AbstractRectAreaImageGrabber::getCursorImageWithPositionFromCorrectSource() const { return isRectAreaCaptureWithBackground() ? mStoredCursorImageWithPosition : getCursorWithPosition(); } bool AbstractRectAreaImageGrabber::isRectAreaCaptureWithBackground() const { return captureMode() == CaptureModes::RectArea && !isSnippingAreaBackgroundTransparent(); } bool AbstractRectAreaImageGrabber::isRectAreaCaptureWithoutBackground() const { return captureMode() == CaptureModes::RectArea && isSnippingAreaBackgroundTransparent(); } ksnip-1.9.2/src/backend/imageGrabber/AbstractRectAreaImageGrabber.h000066400000000000000000000051151414701001100251360ustar00rootroot00000000000000/* * Copyright (C) 2017 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_ABSTRACTRECTAREAIMAGEGRABBER_H #define KSNIP_ABSTRACTRECTAREAIMAGEGRABBER_H #include #include #include "AbstractImageGrabber.h" #include "src/gui/snippingArea/AbstractSnippingArea.h" class AbstractRectAreaImageGrabber : public AbstractImageGrabber { Q_OBJECT public: explicit AbstractRectAreaImageGrabber(AbstractSnippingArea *snippingArea); ~AbstractRectAreaImageGrabber() override; void grabImage(CaptureModes captureMode, bool captureCursor, int delay) override; virtual QRect currentScreenRect() const; virtual QRect fullScreenRect() const = 0; virtual QRect activeWindowRect() const = 0; virtual QRect lastRectArea() const; protected: QRect mCaptureRect; CursorDto mStoredCursorImageWithPosition; void openSnippingAreaWithoutBackground(); void openSnippingAreaWithBackground(const QPixmap &background); QRect selectedSnippingAreaRect() const; QPixmap snippingAreaBackground() const; QPixmap getScreenshotFromRect(const QRect &rect) const; QPixmap getScreenshot() const; void setCaptureRectFromCorrectSource(); virtual bool isSnippingAreaBackgroundTransparent() const; virtual CursorDto getCursorWithPosition() const = 0; protected slots: void prepareGrab(); void grab() override; private: AbstractSnippingArea* mSnippingArea; bool mFreezeImageWhileSnipping; void openSnippingArea(); void connectSnippingAreaCancel(); void connectSnippingAreaFinish(); void disconnectSnippingAreaFinish(); bool shouldCaptureCursor() const; CursorDto getCursorImageWithPositionFromCorrectSource() const; bool isRectAreaCaptureWithBackground() const; bool isRectAreaCaptureWithoutBackground() const; CursorDto getCursorRelativeToScreenshot() const; void storeCursorForPostProcessing(const QRect &screenRect); }; #endif // KSNIP_ABSTRACTRECTAREAIMAGEGRABBER_H ksnip-1.9.2/src/backend/imageGrabber/BaseX11ImageGrabber.cpp000066400000000000000000000035611414701001100234660ustar00rootroot00000000000000/* * Copyright (C) 2016 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #include "BaseX11ImageGrabber.h" BaseX11ImageGrabber::BaseX11ImageGrabber(X11Wrapper *x11Wrapper) : AbstractRectAreaImageGrabber(new X11SnippingArea), mX11Wrapper(x11Wrapper) { addSupportedCaptureMode(CaptureModes::RectArea); addSupportedCaptureMode(CaptureModes::LastRectArea); addSupportedCaptureMode(CaptureModes::FullScreen); addSupportedCaptureMode(CaptureModes::CurrentScreen); addSupportedCaptureMode(CaptureModes::ActiveWindow); } BaseX11ImageGrabber::~BaseX11ImageGrabber() { delete mX11Wrapper; } bool BaseX11ImageGrabber::isSnippingAreaBackgroundTransparent() const { return mX11Wrapper->isCompositorActive() && AbstractRectAreaImageGrabber::isSnippingAreaBackgroundTransparent(); } QRect BaseX11ImageGrabber::activeWindowRect() const { auto rect = mX11Wrapper->getActiveWindowRect(); return mHdpiScaler.unscale(rect); } QRect BaseX11ImageGrabber::fullScreenRect() const { auto rect = mX11Wrapper->getFullScreenRect(); return mHdpiScaler.unscale(rect); } CursorDto BaseX11ImageGrabber::getCursorWithPosition() const { return mX11Wrapper->getCursorWithPosition(); } ksnip-1.9.2/src/backend/imageGrabber/BaseX11ImageGrabber.h000066400000000000000000000027171414701001100231350ustar00rootroot00000000000000/* * Copyright (C) 2016 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef X11IMAGEGRABBER_H #define X11IMAGEGRABBER_H #include "AbstractRectAreaImageGrabber.h" #include "X11Wrapper.h" #include "src/common/platform/HdpiScaler.h" #include "src/gui/snippingArea/X11SnippingArea.h" class BaseX11ImageGrabber : public AbstractRectAreaImageGrabber { public: explicit BaseX11ImageGrabber(X11Wrapper *x11Wrapper); ~BaseX11ImageGrabber() override; protected: QRect fullScreenRect() const override; QRect activeWindowRect() const override; bool isSnippingAreaBackgroundTransparent() const override; CursorDto getCursorWithPosition() const override; private: X11Wrapper *mX11Wrapper; HdpiScaler mHdpiScaler; }; #endif // X11IMAGEGRABBER_H ksnip-1.9.2/src/backend/imageGrabber/GnomeWaylandImageGrabber.cpp000066400000000000000000000057551414701001100247160ustar00rootroot00000000000000/* * Copyright (C) 2017 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "GnomeWaylandImageGrabber.h" GnomeWaylandImageGrabber::GnomeWaylandImageGrabber() : AbstractRectAreaImageGrabber(new WaylandSnippingArea) { addSupportedCaptureMode(CaptureModes::RectArea); addSupportedCaptureMode(CaptureModes::LastRectArea); addSupportedCaptureMode(CaptureModes::ActiveWindow); addSupportedCaptureMode(CaptureModes::FullScreen); addSupportedCaptureMode(CaptureModes::CurrentScreen); } QRect GnomeWaylandImageGrabber::activeWindowRect() const { // Gnome Wayland captures active window directly return {}; } CursorDto GnomeWaylandImageGrabber::getCursorWithPosition() const { // Gnome Wayland merges the cursor already return {}; } void GnomeWaylandImageGrabber::grab() { QDBusInterface interface(QLatin1String("org.gnome.Shell.Screenshot"), QLatin1String("/org/gnome/Shell/Screenshot"), QLatin1String("org.gnome.Shell.Screenshot")); QDBusPendingReply reply; if (captureMode() == CaptureModes::ActiveWindow) { reply = interface.asyncCall(QLatin1String("ScreenshotWindow"), true, isCaptureCursorEnabled(), false, tmpScreenshotFilename()); } else { reply = interface.asyncCall(QLatin1String("Screenshot"), isCaptureCursorEnabled(), false, tmpScreenshotFilename()); } reply.waitForFinished(); if (reply.isError()) { qCritical("Invalid reply from DBus: %s", qPrintable(reply.error().message())); emit canceled(); } else { auto pathToTmpScreenshot = reply.argumentAt<1>(); postProcessing(QPixmap(pathToTmpScreenshot)); } } void GnomeWaylandImageGrabber::postProcessing(const QPixmap& pixmap) { if (captureMode() == CaptureModes::ActiveWindow) { emit finished(CaptureDto(pixmap)); } else { setCaptureRectFromCorrectSource(); emit finished(CaptureDto(pixmap.copy(mCaptureRect))); } } QString GnomeWaylandImageGrabber::tmpScreenshotFilename() const { auto path = QLatin1String("/tmp/"); auto filename = QLatin1String("ksnip-") + QString::number(MathHelper::randomInt()); auto extension = QLatin1String(".png"); return path + filename + extension; } QRect GnomeWaylandImageGrabber::fullScreenRect() const { // Copy with empty rect will return full screen return {}; } ksnip-1.9.2/src/backend/imageGrabber/GnomeWaylandImageGrabber.h000066400000000000000000000030031414701001100243430ustar00rootroot00000000000000/* * Copyright (C) 2018 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef GNOMEWAYLANDIMAGEGRABBER_H #define GNOMEWAYLANDIMAGEGRABBER_H #include #include #include #include "AbstractRectAreaImageGrabber.h" #include "src/common/helper/MathHelper.h" #include "src/gui/snippingArea/WaylandSnippingArea.h" class GnomeWaylandImageGrabber : public AbstractRectAreaImageGrabber { public: explicit GnomeWaylandImageGrabber(); QRect fullScreenRect() const override; QRect activeWindowRect() const override; protected: void grab() override; CursorDto getCursorWithPosition() const override; private: void postProcessing(const QPixmap &pixmap); QString tmpScreenshotFilename() const; }; #endif // GNOMEWAYLANDIMAGEGRABBER_H ksnip-1.9.2/src/backend/imageGrabber/GnomeX11ImageGrabber.cpp000066400000000000000000000016311414701001100236550ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "GnomeX11ImageGrabber.h" GnomeX11ImageGrabber::GnomeX11ImageGrabber() : BaseX11ImageGrabber(new GnomeX11Wrapper) { } ksnip-1.9.2/src/backend/imageGrabber/GnomeX11ImageGrabber.h000066400000000000000000000021251414701001100233210ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_GNOMEX11IMAGEGRABBER_H #define KSNIP_GNOMEX11IMAGEGRABBER_H #include "BaseX11ImageGrabber.h" #include "GnomeX11Wrapper.h" class GnomeX11ImageGrabber : public BaseX11ImageGrabber { public: GnomeX11ImageGrabber(); ~GnomeX11ImageGrabber() override = default; }; #endif //KSNIP_GNOMEX11IMAGEGRABBER_H ksnip-1.9.2/src/backend/imageGrabber/GnomeX11Wrapper.cpp000066400000000000000000000041541414701001100227710ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "GnomeX11Wrapper.h" QRect GnomeX11Wrapper::getActiveWindowRect() const { auto windowId = X11Wrapper::getActiveWindowId(); auto windowRect = X11Wrapper::getWindowRect(windowId); auto frameExtents = getGtkFrameExtents(windowId); return windowRect.adjusted(frameExtents.left, frameExtents.top, -frameExtents.right, -frameExtents.bottom); } GnomeX11Wrapper::FrameExtents GnomeX11Wrapper::getGtkFrameExtents(unsigned int windowId) { FrameExtents values{}; auto connection = QX11Info::connection(); auto atom_cookie = xcb_intern_atom(connection, 0, strlen("_GTK_FRAME_EXTENTS"), "_GTK_FRAME_EXTENTS"); ScopedCPointer atom_reply(xcb_intern_atom_reply(connection, atom_cookie, nullptr)); if (!atom_reply.isNull()) { auto cookie = xcb_get_property(connection, 0, windowId, atom_reply->atom, XCB_ATOM_CARDINAL, 0, 4); ScopedCPointer reply(xcb_get_property_reply(connection, cookie, nullptr)); if (!reply.isNull()) { int length = xcb_get_property_value_length(reply.data()); if (length != 0) { auto gtkFrameExtents = static_cast(xcb_get_property_value(reply.data())); values.left = (int)gtkFrameExtents[0]; values.right = (int)gtkFrameExtents[1]; values.top = (int)gtkFrameExtents[2]; values.bottom = (int)gtkFrameExtents[3]; } } } return values; } ksnip-1.9.2/src/backend/imageGrabber/GnomeX11Wrapper.h000066400000000000000000000024011414701001100224270ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_GNOMEX11WRAPPER_H #define KSNIP_GNOMEX11WRAPPER_H #include #include #include "X11Wrapper.h" class GnomeX11Wrapper : public X11Wrapper { public: GnomeX11Wrapper() = default; ~GnomeX11Wrapper() = default; QRect getActiveWindowRect() const override; private: struct FrameExtents { int left; int right; int top; int bottom; }; static FrameExtents getGtkFrameExtents(unsigned int windowId); }; #endif //KSNIP_GNOMEX11WRAPPER_H ksnip-1.9.2/src/backend/imageGrabber/ImageGrabberFactory.cpp000066400000000000000000000037411414701001100237310ustar00rootroot00000000000000/* * Copyright (C) 2017 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "ImageGrabberFactory.h" AbstractImageGrabber* ImageGrabberFactory::createImageGrabber() { #if defined(__APPLE__) return new MacImageGrabber(); #endif #if defined(UNIX_X11) if (PlatformChecker::instance()->isX11()) { if(PlatformChecker::instance()->isGnome()) { return new GnomeX11ImageGrabber(); } else { return new X11ImageGrabber(); } } else if (PlatformChecker::instance()->isWayland()) { auto config = KsnipConfigProvider::instance(); if (config->forceGenericWaylandEnabled() || PlatformChecker::instance()->isSnap() || PlatformChecker::instance()->gnomeVersion() >= 41) { return new WaylandImageGrabber(); } else if(PlatformChecker::instance()->isKde()) { return new KdeWaylandImageGrabber(); } else if (PlatformChecker::instance()->isGnome()) { return new GnomeWaylandImageGrabber(); } else { qCritical("Unknown wayland platform, using default wayland Image Grabber."); return new WaylandImageGrabber(); } } else { qCritical("Unknown platform, using default X11 Image Grabber."); return new X11ImageGrabber(); } #endif #if defined(_WIN32) return new WinImageGrabber(); #endif } ksnip-1.9.2/src/backend/imageGrabber/ImageGrabberFactory.h000066400000000000000000000026231414701001100233740ustar00rootroot00000000000000/* * Copyright (C) 2017 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_IMAGEGRABBERFACTORY_H #define KSNIP_IMAGEGRABBERFACTORY_H #if defined(__APPLE__) #include "MacImageGrabber.h" #endif #if defined(UNIX_X11) #include "X11ImageGrabber.h" #include "GnomeX11ImageGrabber.h" #include "KdeWaylandImageGrabber.h" #include "GnomeWaylandImageGrabber.h" #include "WaylandImageGrabber.h" #include "src/common/platform/PlatformChecker.h" #include "src/backend/config/KsnipConfigProvider.h" #endif #if defined(_WIN32) #include "WinImageGrabber.h" #endif class ImageGrabberFactory { public: static AbstractImageGrabber *createImageGrabber(); }; #endif // KSNIP_IMAGEGRABBERFACTORY_H ksnip-1.9.2/src/backend/imageGrabber/KdeWaylandImageGrabber.cpp000066400000000000000000000071101414701001100243370ustar00rootroot00000000000000/* * Copyright (C) 2017 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ /* * Most part of this class comes from the KWinWaylandImageGrabber implementation * from KDE Spectacle, implemented by Martin Graesslin */ #include "KdeWaylandImageGrabber.h" static int readData(int fd, QByteArray& data) { // implementation based on QtWayland file qwaylanddataoffer.cpp char buffer[4096]; int retryCount = 0; int n; while (true) { n = QT_READ(fd, buffer, sizeof buffer); // give user 30 sec to click a window, afterwards considered as error if (n == -1 && (errno == EAGAIN) && ++retryCount < 30000) { usleep(1000); } else { break; } } if (n > 0) { data.append(buffer, n); n = readData(fd, data); } return n; } static QImage readImage(int pipeFd) { QByteArray content; if (readData(pipeFd, content) != 0) { close(pipeFd); return QImage(); } close(pipeFd); QDataStream dataStream(content); QImage image; dataStream >> image; return image; }; KdeWaylandImageGrabber::KdeWaylandImageGrabber() : AbstractImageGrabber() { addSupportedCaptureMode(CaptureModes::WindowUnderCursor); addSupportedCaptureMode(CaptureModes::CurrentScreen); addSupportedCaptureMode(CaptureModes::FullScreen); } void KdeWaylandImageGrabber::grab() { if (captureMode() == CaptureModes::FullScreen) { prepareDBus(QLatin1String("screenshotFullscreen"), isCaptureCursorEnabled()); } else if (captureMode() == CaptureModes::CurrentScreen) { prepareDBus(QLatin1String("screenshotScreen"), isCaptureCursorEnabled()); } else { int mask = 1; if (isCaptureCursorEnabled()) { mask |= 1 << 1; } prepareDBus(QLatin1String("interactive"), mask); } } template void KdeWaylandImageGrabber::prepareDBus(const QString& mode, T mask) { int pipeFds[2]; if (pipe2(pipeFds, O_CLOEXEC | O_NONBLOCK) != 0) { emit canceled(); return; } callDBus(pipeFds[1], mode, mask); startReadImage(pipeFds[0]); close(pipeFds[1]); } template void KdeWaylandImageGrabber::callDBus(int writeFd, const QString& mode, T mask) { QDBusInterface interface(QLatin1String("org.kde.KWin"), QLatin1String("/Screenshot"), QLatin1String("org.kde.kwin.Screenshot")); interface.asyncCall(mode, QVariant::fromValue(QDBusUnixFileDescriptor(writeFd)), mask); } void KdeWaylandImageGrabber::startReadImage(int readPipe) { auto watcher = new QFutureWatcher(this); QObject::connect(watcher, &QFutureWatcher::finished, this, [watcher, this] { watcher->deleteLater(); auto image = watcher->result(); emit finished(CaptureDto(QPixmap::fromImage(image))); }); watcher->setFuture(QtConcurrent::run(readImage, readPipe)); } ksnip-1.9.2/src/backend/imageGrabber/KdeWaylandImageGrabber.h000066400000000000000000000031661414701001100240130ustar00rootroot00000000000000/* * Copyright (C) 2017 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_KDEWAYLANDIMAGEGRABBER_H #define KSNIP_KDEWAYLANDIMAGEGRABBER_H #include #include #include #include #include #include #include #include #include #include "AbstractImageGrabber.h" class KdeWaylandImageGrabber : public AbstractImageGrabber { public: explicit KdeWaylandImageGrabber(); ~KdeWaylandImageGrabber() override = default; protected: void grab() override; private: void startReadImage(int readPipe); template void prepareDBus(const QString& mode, T mask); template void callDBus(int writeFd, const QString& mode, T mask); }; #endif // KSNIP_KDEWAYLANDIMAGEGRABBER_H ksnip-1.9.2/src/backend/imageGrabber/MacImageGrabber.cpp000066400000000000000000000027441414701001100230240ustar00rootroot00000000000000/* * Copyright (C) 2018 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "MacImageGrabber.h" MacImageGrabber::MacImageGrabber() : AbstractRectAreaImageGrabber(new MacSnippingArea), mMacWrapper(new MacWrapper) { addSupportedCaptureMode(CaptureModes::RectArea); addSupportedCaptureMode(CaptureModes::LastRectArea); addSupportedCaptureMode(CaptureModes::FullScreen); addSupportedCaptureMode(CaptureModes::CurrentScreen); } QRect MacImageGrabber::fullScreenRect() const { return mMacWrapper->getFullScreenRect(); } QRect MacImageGrabber::activeWindowRect() const { // Not supported for MacOs return {}; } CursorDto MacImageGrabber::getCursorWithPosition() const { // MacOs currently captures always mouse by itself return {}; } ksnip-1.9.2/src/backend/imageGrabber/MacImageGrabber.h000066400000000000000000000025351414701001100224670ustar00rootroot00000000000000/* * Copyright (C) 2018 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_MACIMAGEGRABBER_H #define KSNIP_MACIMAGEGRABBER_H #include "AbstractRectAreaImageGrabber.h" #include "MacWrapper.h" #include "src/gui/snippingArea/MacSnippingArea.h" class MacImageGrabber : public AbstractRectAreaImageGrabber { Q_OBJECT public: explicit MacImageGrabber(); ~MacImageGrabber() override = default; protected slots: QRect fullScreenRect() const override; QRect activeWindowRect() const override; CursorDto getCursorWithPosition() const override; private: MacWrapper *mMacWrapper; }; #endif //KSNIP_MACIMAGEGRABBER_H ksnip-1.9.2/src/backend/imageGrabber/MacWrapper.cpp000066400000000000000000000021061414701001100221250ustar00rootroot00000000000000/* * Copyright (C) 2018 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "MacWrapper.h" QRect MacWrapper::getFullScreenRect() const { auto mainDisplayID = CGMainDisplayID(); auto screenWidth = (int)CGDisplayPixelsWide(mainDisplayID); auto screenHeight = (int)CGDisplayPixelsHigh(mainDisplayID); return {0, 0, screenWidth, screenHeight}; } ksnip-1.9.2/src/backend/imageGrabber/MacWrapper.h000066400000000000000000000020371414701001100215750ustar00rootroot00000000000000/* * Copyright (C) 2018 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_MACWRAPPER_H #define KSNIP_MACWRAPPER_H #include #include "CoreGraphics/CGDirectDisplay.h" #include "src/common/dtos/CursorDto.h" class MacWrapper { public: QRect getFullScreenRect() const; }; #endif //KSNIP_MACWRAPPER_H ksnip-1.9.2/src/backend/imageGrabber/WaylandImageGrabber.cpp000066400000000000000000000074321414701001100237220ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "WaylandImageGrabber.h" WaylandImageGrabber::WaylandImageGrabber() : AbstractImageGrabber(), mRequestTokenCounter(1) { addSupportedCaptureMode(CaptureModes::Portal); } void WaylandImageGrabber::grab() { auto message = getDBusMessage(); auto pendingCall = QDBusConnection::sessionBus().asyncCall(message); auto watcher = new QDBusPendingCallWatcher(pendingCall); connect(watcher, &QDBusPendingCallWatcher::finished, this, &WaylandImageGrabber::portalResponse); } QDBusMessage WaylandImageGrabber::getDBusMessage() { auto message = QDBusMessage::createMethodCall( QLatin1String("org.freedesktop.portal.Desktop"), QLatin1String("/org/freedesktop/portal/desktop"), QLatin1String("org.freedesktop.portal.Screenshot"), QLatin1String("Screenshot")); message << QLatin1String("wayland:") << QVariantMap{ {QLatin1String("interactive"), false}, {QLatin1String("handle_token"), getRequestToken()} }; return message; } void WaylandImageGrabber::gotScreenshotResponse(uint response, const QVariantMap& results) { if (isResponseValid(response, results)) { auto path = getPathToScreenshot(results); auto screenshot = createPixmapFromPath(path); if(isTemporaryImage(path)) { emit finished(CaptureDto(screenshot)); } else { emit finished(CaptureFromFileDto(screenshot, path)); } } else { qCritical("Failed to take screenshot"); } } QPixmap WaylandImageGrabber::createPixmapFromPath(const QString &path) const { auto capture = QPixmap::fromImage(QImage(path)); if(mConfig->scaleGenericWaylandScreenshotsEnabled()) { capture.setDevicePixelRatio(mHdpiScaler.scaleFactor()); } return capture; } bool WaylandImageGrabber::isResponseValid(uint response, const QVariantMap &results) { return !response && results.contains(QLatin1String("uri")); } bool WaylandImageGrabber::isTemporaryImage(const QString &path) { return path.contains(QLatin1String("/tmp/")); } QString WaylandImageGrabber::getPathToScreenshot(const QVariantMap &results) { auto uri = results.value(QLatin1String("uri")).toString(); return uri.remove(QLatin1String("file://")); } QString WaylandImageGrabber::getRequestToken() { mRequestTokenCounter += 1; return QString("u%1").arg(mRequestTokenCounter); } void WaylandImageGrabber::portalResponse(QDBusPendingCallWatcher *watcher) { QDBusPendingReply reply = *watcher; if (reply.isError()) { qCritical("Error: %s", qPrintable(reply.error().message())); } else { QDBusConnection::sessionBus().connect(QString(), reply.value().path(), QLatin1String("org.freedesktop.portal.Request"), QLatin1String("Response"), this, SLOT(gotScreenshotResponse(uint,QVariantMap))); } } ksnip-1.9.2/src/backend/imageGrabber/WaylandImageGrabber.h000066400000000000000000000035261414701001100233670ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_WAYLANDIMAGEGRABBER_H #define KSNIP_WAYLANDIMAGEGRABBER_H #include #include #include #include "AbstractImageGrabber.h" #include "src/common/dtos/CaptureFromFileDto.h" #include "src/common/platform/HdpiScaler.h" class WaylandImageGrabber : public AbstractImageGrabber { Q_OBJECT public: explicit WaylandImageGrabber(); ~WaylandImageGrabber() override = default; public slots: void gotScreenshotResponse(uint response, const QVariantMap& results); protected: void grab() override; private: int mRequestTokenCounter; HdpiScaler mHdpiScaler; QString getRequestToken(); static QString getPathToScreenshot(const QVariantMap &results); static bool isTemporaryImage(const QString &path); static bool isResponseValid(uint response, const QVariantMap &results); QDBusMessage getDBusMessage(); private slots: void portalResponse(QDBusPendingCallWatcher *watcher); QPixmap createPixmapFromPath(const QString &path) const; }; #endif //KSNIP_WAYLANDIMAGEGRABBER_H ksnip-1.9.2/src/backend/imageGrabber/WinImageGrabber.cpp000066400000000000000000000031171414701001100230540ustar00rootroot00000000000000/* * Copyright (C) 2018 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "WinImageGrabber.h" WinImageGrabber::WinImageGrabber() : AbstractRectAreaImageGrabber(new WinSnippingArea), mWinWrapper(new WinWrapper) { addSupportedCaptureMode(CaptureModes::RectArea); addSupportedCaptureMode(CaptureModes::LastRectArea); addSupportedCaptureMode(CaptureModes::FullScreen); addSupportedCaptureMode(CaptureModes::ActiveWindow); addSupportedCaptureMode(CaptureModes::CurrentScreen); } QRect WinImageGrabber::activeWindowRect() const { auto rect = mWinWrapper->getActiveWindowRect(); return mHdpiScaler.unscale(rect); } QRect WinImageGrabber::fullScreenRect() const { auto rect = mWinWrapper->getFullScreenRect(); return mHdpiScaler.unscale(rect); } CursorDto WinImageGrabber::getCursorWithPosition() const { return mWinWrapper->getCursorWithPosition(); } ksnip-1.9.2/src/backend/imageGrabber/WinImageGrabber.h000066400000000000000000000026331414701001100225230ustar00rootroot00000000000000/* * Copyright (C) 2018 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_WINIMAGEGRABBER_H #define KSNIP_WINIMAGEGRABBER_H #include "AbstractRectAreaImageGrabber.h" #include "WinWrapper.h" #include "src/gui/snippingArea/WinSnippingArea.h" #include "src/common/platform/HdpiScaler.h" class WinImageGrabber : public AbstractRectAreaImageGrabber { Q_OBJECT public: explicit WinImageGrabber(); ~WinImageGrabber() override = default; protected: QRect fullScreenRect() const override; QRect activeWindowRect() const override; CursorDto getCursorWithPosition() const override; private: WinWrapper *mWinWrapper; HdpiScaler mHdpiScaler; }; #endif //KSNIP_WINIMAGEGRABBER_H ksnip-1.9.2/src/backend/imageGrabber/WinWrapper.cpp000066400000000000000000000057351414701001100221750ustar00rootroot00000000000000/* * Copyright (C) 2018 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "WinWrapper.h" QRect WinWrapper::getFullScreenRect() const { auto height = GetSystemMetrics(SM_CYVIRTUALSCREEN); auto width = GetSystemMetrics(SM_CXVIRTUALSCREEN); auto x = GetSystemMetrics(SM_XVIRTUALSCREEN); auto y = GetSystemMetrics(SM_YVIRTUALSCREEN); return {x, y, width, height}; } QRect WinWrapper::getActiveWindowRect() const { RECT window, frame; auto handle = GetForegroundWindow(); GetWindowRect(handle, &window); DwmGetWindowAttribute(handle, DWMWA_EXTENDED_FRAME_BOUNDS, &frame, sizeof(RECT)); return {QPoint(frame.left, frame.top), QPoint(frame.right, frame.bottom)}; } CursorDto WinWrapper::getCursorWithPosition() const { CURSORINFO cursorInfo = { sizeof(cursorInfo) }; GetCursorInfo(&cursorInfo); auto cursorPosition = getCursorPosition(QRect(), cursorInfo); auto cursorPixmap = getCursorPixmap(cursorInfo); return {cursorPixmap, cursorPosition}; } QPoint WinWrapper::getCursorPosition(const QRect &rect, const CURSORINFO &cursor) const { ICONINFOEXW iconInfo = { sizeof(iconInfo) }; GetIconInfoExW(cursor.hCursor, &iconInfo); auto x = cursor.ptScreenPos.x - (int)iconInfo.xHotspot; auto y = cursor.ptScreenPos.y - (int)iconInfo.yHotspot; return { x, y }; } QPixmap WinWrapper::getCursorPixmap(const CURSORINFO &cursor) const { // Get Cursor Size auto cursorWidth = GetSystemMetrics(SM_CXCURSOR); auto cursorHeight = GetSystemMetrics(SM_CYCURSOR); // Get your device contexts. auto screenHandle = GetDC(nullptr); auto memoryHandle = CreateCompatibleDC(screenHandle); // Create the bitmap to use as a canvas. auto canvasBitmap = CreateCompatibleBitmap(screenHandle, cursorWidth, cursorHeight); // Select the bitmap into the device context. auto oldBitmap = SelectObject(memoryHandle, canvasBitmap); // Draw the cursor into the canvas. DrawIcon(memoryHandle, 0, 0, cursor.hCursor); // Convert to QPixmap auto cursorPixmap = fromHBITMAP(canvasBitmap, QtWin::HBitmapAlpha); // Clean up after yourself. SelectObject(memoryHandle, oldBitmap); DeleteObject(canvasBitmap); DeleteDC(memoryHandle); ReleaseDC(nullptr, screenHandle); return cursorPixmap; } ksnip-1.9.2/src/backend/imageGrabber/WinWrapper.h000066400000000000000000000024371414701001100216360ustar00rootroot00000000000000/* * Copyright (C) 2018 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_WINWRAPPER_H #define KSNIP_WINWRAPPER_H #include #include #include #include #include "src/common/dtos/CursorDto.h" class WinWrapper { public: QRect getFullScreenRect() const; QRect getActiveWindowRect() const; CursorDto getCursorWithPosition() const; private: QPixmap getCursorPixmap(const CURSORINFO &cursor) const; QPoint getCursorPosition(const QRect &rect, const CURSORINFO &cursor) const; }; #endif //KSNIP_WINWRAPPER_H ksnip-1.9.2/src/backend/imageGrabber/X11ImageGrabber.cpp000066400000000000000000000016051414701001100226700ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "X11ImageGrabber.h" X11ImageGrabber::X11ImageGrabber() : BaseX11ImageGrabber(new X11Wrapper) { } ksnip-1.9.2/src/backend/imageGrabber/X11ImageGrabber.h000066400000000000000000000020621414701001100223330ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_X11IMAGEGRABBER_H #define KSNIP_X11IMAGEGRABBER_H #include "BaseX11ImageGrabber.h" #include "X11Wrapper.h" class X11ImageGrabber : public BaseX11ImageGrabber { public: X11ImageGrabber(); ~X11ImageGrabber() override = default; }; #endif //KSNIP_X11IMAGEGRABBER_H ksnip-1.9.2/src/backend/imageGrabber/X11Wrapper.cpp000066400000000000000000000105531414701001100220030ustar00rootroot00000000000000/* * Copyright (C) 2017 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ /* * blendCursorImage() and getNativeCursorPosition() functions have been taken * from KDE Spectacle X11ImageGrabber and slightly modified to fit this * implementation. */ #include "X11Wrapper.h" #include bool X11Wrapper::isCompositorActive() const { auto display = QX11Info::display(); auto prop_atom = XInternAtom(display, "_NET_WM_CM_S0", false); return XGetSelectionOwner(display, prop_atom) != None; } QRect X11Wrapper::getFullScreenRect() const { return getWindowRect(QX11Info::appRootWindow()); } QRect X11Wrapper::getActiveWindowRect() const { auto windowId = getActiveWindowId(); return getWindowRect(windowId); } QRect X11Wrapper::getWindowRect(xcb_window_t windowId) const { // In case of window id 0 return empty rect if (windowId == 0) { return {}; } auto connection = QX11Info::connection(); auto geomCookie = xcb_get_geometry_unchecked(connection, windowId); ScopedCPointer geomReply(xcb_get_geometry_reply(connection, geomCookie, nullptr)); return { geomReply->x, geomReply->y, geomReply->width, geomReply->height }; } xcb_window_t X11Wrapper::getActiveWindowId() const { xcb_query_tree_cookie_t treeCookie; auto connection = QX11Info::connection(); ScopedCPointer focusReply(xcb_get_input_focus_reply(connection, xcb_get_input_focus(connection), nullptr)); // Get ID of focused window, however, this must not always be the top level // window so we loop through parents and search for the top level window. auto windowId = focusReply->focus; while (true) { treeCookie = xcb_query_tree_unchecked(connection, windowId); ScopedCPointer treeReply(xcb_query_tree_reply(connection, treeCookie, nullptr)); if (!treeReply) { return 0; } // If the root window it is equal to the parent or the window ID itself // the this must be the top level window. if (windowId == treeReply->root || treeReply->parent == treeReply->root) { return windowId; } else { windowId = treeReply->parent; } } } QPoint X11Wrapper::getNativeCursorPosition() const { // QCursor::pos() is not used because it requires additional calculations. // Its value is the offset to the origin of the current screen is in // device-independent pixels while the origin itself uses native pixels. auto xcbConn = QX11Info::connection(); auto pointerCookie = xcb_query_pointer_unchecked(xcbConn, QX11Info::appRootWindow()); ScopedCPointer pointerReply(xcb_query_pointer_reply(xcbConn, pointerCookie, nullptr)); return { pointerReply->root_x, pointerReply->root_y }; } CursorDto X11Wrapper::getCursorWithPosition() const { auto cursorPosition = getNativeCursorPosition(); // now we can get the image and start processing auto xcbConn = QX11Info::connection(); auto cursorCookie = xcb_xfixes_get_cursor_image_unchecked(xcbConn); ScopedCPointer cursorReply(xcb_xfixes_get_cursor_image_reply(xcbConn, cursorCookie, nullptr)); if (cursorReply.isNull()) { return CursorDto(); } auto pixelData = xcb_xfixes_get_cursor_image_cursor_image(cursorReply.data()); if (!pixelData) { return CursorDto(); } // process the image into a QImage auto cursorImage = QImage((quint8 *) pixelData, cursorReply->width, cursorReply->height, QImage::Format_ARGB32_Premultiplied); // a small fix for the cursor position for fancier cursor cursorPosition -= QPoint(cursorReply->xhot, cursorReply->yhot); return { QPixmap::fromImage(cursorImage, Qt::AutoColor), cursorPosition }; } ksnip-1.9.2/src/backend/imageGrabber/X11Wrapper.h000066400000000000000000000032221414701001100214430ustar00rootroot00000000000000/* * Copyright (C) 2017 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef X11WRAPPER_H #define X11WRAPPER_H #include #include #include "src/common/dtos/CursorDto.h" class X11Wrapper { public: X11Wrapper() = default; ~X11Wrapper() = default; virtual bool isCompositorActive() const; virtual QRect getFullScreenRect() const; virtual QRect getActiveWindowRect() const; virtual CursorDto getCursorWithPosition() const; protected: QPoint getNativeCursorPosition() const; QRect getWindowRect(xcb_window_t window) const; xcb_window_t getActiveWindowId() const; }; /* * QScopedPointer class overwritten to free pointers that need to be freed by * free() instead of delete. */ template class ScopedCPointer : public QScopedPointer { public: explicit ScopedCPointer(T *p = 0) : QScopedPointer(p) {} }; #endif // X11WRAPPER_H ksnip-1.9.2/src/backend/ipc/000077500000000000000000000000001414701001100155655ustar00rootroot00000000000000ksnip-1.9.2/src/backend/ipc/IpcClient.cpp000066400000000000000000000022031414701001100201400ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "IpcClient.h" IpcClient::IpcClient() : mLocalSocket(new QLocalSocket(this)) { } IpcClient::~IpcClient() { delete mLocalSocket; } void IpcClient::connectTo(const QString &name) { mLocalSocket->connectToServer(name); } void IpcClient::send(const QByteArray &data) { mLocalSocket->write(data); mLocalSocket->waitForBytesWritten(); } ksnip-1.9.2/src/backend/ipc/IpcClient.h000066400000000000000000000021401414701001100176050ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_IPCCLIENT_H #define KSNIP_IPCCLIENT_H #include class IpcClient : public QObject { Q_OBJECT public: IpcClient(); ~IpcClient() override; void connectTo(const QString &name); void send(const QByteArray &data); private: QLocalSocket *mLocalSocket; }; #endif //KSNIP_IPCCLIENT_H ksnip-1.9.2/src/backend/ipc/IpcServer.cpp000066400000000000000000000030241414701001100201720ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "IpcServer.h" IpcServer::IpcServer() : mLocalServer(new QLocalServer()) { mLocalServer->setSocketOptions(QLocalServer::WorldAccessOption); } IpcServer::~IpcServer() { delete mLocalServer; } bool IpcServer::listen(const QString &name) { auto hasStarted = mLocalServer->listen(name); connect(mLocalServer, &QLocalServer::newConnection, this, &IpcServer::newConnection); return hasStarted; } void IpcServer::newConnection() { auto clientConnection = mLocalServer->nextPendingConnection(); connect(clientConnection, &QLocalSocket::readyRead, this, &IpcServer::processData); } void IpcServer::processData() { auto clientSocket = dynamic_cast(sender()); auto data = clientSocket->readAll(); emit received(data); } ksnip-1.9.2/src/backend/ipc/IpcServer.h000066400000000000000000000023051414701001100176400ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_LOCALSERVER_H #define KSNIP_LOCALSERVER_H #include #include class IpcServer : public QObject { Q_OBJECT public: IpcServer(); ~IpcServer() override; bool listen(const QString &name); signals: void received(const QByteArray &data); private: QLocalServer *mLocalServer; private slots: void newConnection(); void processData(); }; #endif //KSNIP_LOCALSERVER_H ksnip-1.9.2/src/backend/recentImages/000077500000000000000000000000001414701001100174205ustar00rootroot00000000000000ksnip-1.9.2/src/backend/recentImages/IImagePathStorage.h000066400000000000000000000021351414701001100230670ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_IIMAGEPATHSTORAGE_H #define KSNIP_IIMAGEPATHSTORAGE_H #include class IImagePathStorage { public: virtual ~IImagePathStorage() = default; virtual void store(const QString &value, int index) = 0; virtual QString load(int index) = 0; virtual int count() = 0; }; #endif //KSNIP_IIMAGEPATHSTORAGE_H ksnip-1.9.2/src/backend/recentImages/IRecentImageService.h000066400000000000000000000021131414701001100234030ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_IRECENTIMAGESERVICE_H #define KSNIP_IRECENTIMAGESERVICE_H class IRecentImageService { public: virtual ~IRecentImageService() = default; virtual void storeImagePath(const QString &imagePath) = 0; virtual QStringList getRecentImagesPath() const = 0; }; #endif //KSNIP_IRECENTIMAGESERVICE_H ksnip-1.9.2/src/backend/recentImages/ImagePathStorage.cpp000066400000000000000000000030461414701001100233130ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "ImagePathStorage.h" ImagePathStorage::ImagePathStorage() : mSettingsGroupPrefix(QLatin1String("recentImagesPath")), mSettingsGroupKey(QLatin1String("imagePath")) { } void ImagePathStorage::store(const QString &value, int index) { mSettings.beginWriteArray(mSettingsGroupPrefix); mSettings.setArrayIndex(index); mSettings.setValue(mSettingsGroupKey, value); mSettings.endArray(); mSettings.sync(); } QString ImagePathStorage::load(int index) { mSettings.beginReadArray(mSettingsGroupPrefix); mSettings.setArrayIndex(index); auto value = mSettings.value(mSettingsGroupKey).toString(); mSettings.endArray(); return value; } int ImagePathStorage::count() { auto count = mSettings.beginReadArray(mSettingsGroupPrefix); mSettings.endArray(); return count; } ksnip-1.9.2/src/backend/recentImages/ImagePathStorage.h000066400000000000000000000024121414701001100227540ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_IMAGEPATHSTORAGE_H #define KSNIP_IMAGEPATHSTORAGE_H #include #include "IImagePathStorage.h" class ImagePathStorage : public IImagePathStorage { public: ImagePathStorage(); ~ImagePathStorage() override = default; void store(const QString &value, int index) override; QString load(int index) override; int count() override; private: QSettings mSettings; const QString mSettingsGroupPrefix; const QString mSettingsGroupKey; }; #endif //KSNIP_IMAGEPATHSTORAGE_H ksnip-1.9.2/src/backend/recentImages/RecentImagesPathStore.cpp000066400000000000000000000037631414701001100243350ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "RecentImagesPathStore.h" RecentImagesPathStore::RecentImagesPathStore(IImagePathStorage *imagePathStorage) : mImagePathStorage(imagePathStorage), mMaxRecentItems(10) { Q_ASSERT(mImagePathStorage != nullptr); loadRecentImagesPath(); } RecentImagesPathStore::~RecentImagesPathStore() { delete mImagePathStorage; } void RecentImagesPathStore::loadRecentImagesPath() { const auto storedImageCount = mImagePathStorage->count(); for (auto i = 0; i < storedImageCount; ++i) { mRecentImagesPathCache.enqueue(mImagePathStorage->load(i)); } } void RecentImagesPathStore::storeImagePath(const QString &imagePath) { if (mRecentImagesPathCache.contains(imagePath)) { return; } if (mRecentImagesPathCache.size() == mMaxRecentItems) { mRecentImagesPathCache.dequeue(); } mRecentImagesPathCache.enqueue(imagePath); saveRecentImagesPath(); } void RecentImagesPathStore::saveRecentImagesPath() { for (auto i = 0 ; i < mRecentImagesPathCache.size(); ++i) { mImagePathStorage->store(mRecentImagesPathCache.at(i), i); } } QStringList RecentImagesPathStore::getRecentImagesPath() const { QStringList reversedList = mRecentImagesPathCache; std::reverse(reversedList.begin(), reversedList.end()); return reversedList; } ksnip-1.9.2/src/backend/recentImages/RecentImagesPathStore.h000066400000000000000000000027071414701001100237770ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_RECENTIMAGESPATHSTORE_H #define KSNIP_RECENTIMAGESPATHSTORE_H #include #include #include "IImagePathStorage.h" #include "IRecentImageService.h" class RecentImagesPathStore : public IRecentImageService { public: explicit RecentImagesPathStore(IImagePathStorage *imagePathStorage); ~RecentImagesPathStore() override; void storeImagePath(const QString &imagePath) override; QStringList getRecentImagesPath() const override; private: IImagePathStorage *mImagePathStorage; QQueue mRecentImagesPathCache; const int mMaxRecentItems; void loadRecentImagesPath(); void saveRecentImagesPath(); }; #endif //KSNIP_RECENTIMAGESPATHSTORE_H ksnip-1.9.2/src/backend/saver/000077500000000000000000000000001414701001100161325ustar00rootroot00000000000000ksnip-1.9.2/src/backend/saver/ImageSaver.cpp000066400000000000000000000034651414701001100206710ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "ImageSaver.h" ImageSaver::ImageSaver() : mConfig(KsnipConfigProvider::instance()) { } bool ImageSaver::save(const QImage &image, const QString &path) { ensurePathExists(path); auto fullPath = ensureFilenameHasFormat(path); auto isSuccessful = image.save(fullPath, nullptr, getSaveQuality()); if (!isSuccessful) { qCritical("Unable to save file '%s'", qPrintable(fullPath)); } return isSuccessful; } void ImageSaver::ensurePathExists(const QString &path) { auto directory = PathHelper::extractParentDirectory(path); QDir dir(directory); if(!dir.exists()) { dir.mkpath(QLatin1String(".")); } } QString ImageSaver::ensureFilenameHasFormat(const QString &path) { auto format = PathHelper::extractFormat(path); if(format.isEmpty()) { return path + QLatin1String(".") + mConfig->saveFormat(); } return path; } int ImageSaver::getSaveQuality() { auto defaultQualityFactor = -1; return mConfig->saveQualityMode() == SaveQualityMode::Default ? defaultQualityFactor : mConfig->saveQualityFactor(); } ksnip-1.9.2/src/backend/saver/ImageSaver.h000066400000000000000000000024711414701001100203320ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_IMAGESAVER_H #define KSNIP_IMAGESAVER_H #include #include #include #include #include #include "src/backend/config/KsnipConfigProvider.h" class ImageSaver { public: explicit ImageSaver(); ~ImageSaver() = default; bool save(const QImage &image, const QString &path); private: KsnipConfig* mConfig; void ensurePathExists(const QString &path); QString ensureFilenameHasFormat(const QString &path); int getSaveQuality(); }; #endif //KSNIP_IMAGESAVER_H ksnip-1.9.2/src/backend/saver/SavePathProvider.cpp000066400000000000000000000034001414701001100220610ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "SavePathProvider.h" SavePathProvider::SavePathProvider() { mConfig = KsnipConfigProvider::instance(); } QString SavePathProvider::savePath() const { return UniqueNameProvider::makeUniqueFilename(saveDirectory(), getFilename(), getFormat(mConfig->saveFormat())); } QString SavePathProvider::savePathWithFormat(const QString &format) const { return UniqueNameProvider::makeUniqueFilename(saveDirectory(), getFilename(), getFormat(format)); } QString SavePathProvider::getFilename() const { auto filename = WildcardResolver::replaceDateTimeWildcards(mConfig->saveFilename()); return WildcardResolver::replaceNumberWildcards(filename, saveDirectory(), getFormat(mConfig->saveFormat())); } QString SavePathProvider::getFormat(const QString &format) const { return format.startsWith(QLatin1Char('.')) ? format : QLatin1Char('.') + format; } QString SavePathProvider::saveDirectory() const { return WildcardResolver::replaceDateTimeWildcards(mConfig->saveDirectory()); } ksnip-1.9.2/src/backend/saver/SavePathProvider.h000066400000000000000000000025541414701001100215370ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_SAVEPATHPROVIDER_H #define KSNIP_SAVEPATHPROVIDER_H #include "src/backend/saver/WildcardResolver.h" #include "src/backend/saver/UniqueNameProvider.h" #include "src/backend/config/KsnipConfigProvider.h" class SavePathProvider { public: SavePathProvider(); ~SavePathProvider() = default; QString savePath() const; QString savePathWithFormat(const QString& format) const; QString saveDirectory() const; private: KsnipConfig *mConfig; QString getFormat(const QString &format) const; QString getFilename() const; }; #endif //KSNIP_SAVEPATHPROVIDER_H ksnip-1.9.2/src/backend/saver/UniqueNameProvider.cpp000066400000000000000000000025031414701001100224200ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "UniqueNameProvider.h" QString UniqueNameProvider::makeUniqueFilename(const QString& path, const QString& filename, const QString& format) { auto uniqueFilename = path + filename + format; if (QFile::exists(uniqueFilename)) { auto i = 1; auto openingParentheses = QLatin1String("("); auto closingParentheses = QLatin1String(")") ; while (QFile::exists(uniqueFilename)) { i++; uniqueFilename = path + filename + openingParentheses + QString::number(i) + closingParentheses + format; } } return uniqueFilename; }ksnip-1.9.2/src/backend/saver/UniqueNameProvider.h000066400000000000000000000021221414701001100220620ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_UNIQUENAMEPROVIDER_H #define KSNIP_UNIQUENAMEPROVIDER_H #include #include class UniqueNameProvider { public: static QString makeUniqueFilename(const QString &path, const QString &filename, const QString &format = QString()); }; #endif //KSNIP_UNIQUENAMEPROVIDER_H ksnip-1.9.2/src/backend/saver/WildcardResolver.cpp000066400000000000000000000061701414701001100221150ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "WildcardResolver.h" QString WildcardResolver::replaceDateTimeWildcards(const QString &filename) { auto filenameWithoutWildcards = filename; filenameWithoutWildcards.replace(QLatin1String("$Y"), QDateTime::currentDateTime().toString(QLatin1String("yyyy"))); filenameWithoutWildcards.replace(QLatin1String("$M"), QDateTime::currentDateTime().toString(QLatin1String("MM"))); filenameWithoutWildcards.replace(QLatin1String("$D"), QDateTime::currentDateTime().toString(QLatin1String("dd"))); filenameWithoutWildcards.replace(QLatin1String("$T"), QDateTime::currentDateTime().toString(QLatin1String("hhmmss"))); filenameWithoutWildcards.replace(QLatin1String("$h"), QDateTime::currentDateTime().toString(QLatin1String("hh"))); filenameWithoutWildcards.replace(QLatin1String("$m"), QDateTime::currentDateTime().toString(QLatin1String("mm"))); filenameWithoutWildcards.replace(QLatin1String("$s"), QDateTime::currentDateTime().toString(QLatin1String("ss"))); return filenameWithoutWildcards; } QString WildcardResolver::replaceNumberWildcards(const QString &filename, const QString &directory, const QString &format) { auto filenameWithoutWildcards = filename; auto wildcard = QLatin1Char('#'); if(filenameWithoutWildcards.contains(wildcard)) { auto firstWildcardIndex = filename.indexOf(wildcard); auto lastWildcardIndex = filename.lastIndexOf(wildcard); auto leftPart = filename.left(firstWildcardIndex); auto rightPart = filename.mid(lastWildcardIndex + 1); auto digitCount = filename.count(wildcard); auto highestNumber = getHighestWildcardNumber(directory, leftPart, rightPart, format); filenameWithoutWildcards = leftPart + QString("%1").arg(highestNumber + 1, digitCount, 10, QChar('0')) + rightPart; } return filenameWithoutWildcards; } int WildcardResolver::getHighestWildcardNumber(const QString &directory, const QString &leftPart, const QString &rightPart, const QString &format) { auto rightPartWithFormat = rightPart + format; QDir parentDirectory(directory); auto number = 0; auto allFiles = parentDirectory.entryList({ QLatin1String("*") + format }, QDir::Files); for(auto file : allFiles) { if(file.startsWith(leftPart) && file.endsWith(rightPartWithFormat)) { file.remove(leftPart); file.remove(rightPartWithFormat); auto currentNumber = file.toInt(); number = qMax(number, currentNumber); } } return number; }ksnip-1.9.2/src/backend/saver/WildcardResolver.h000066400000000000000000000025031414701001100215560ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_WILDCARDRESOLVER_H #define KSNIP_WILDCARDRESOLVER_H #include #include #include #include class WildcardResolver { public: static QString replaceDateTimeWildcards(const QString &filename); static QString replaceNumberWildcards(const QString &filename, const QString &directory, const QString &format); private: static int getHighestWildcardNumber(const QString &directory, const QString &leftPart, const QString &rightPart, const QString &format); }; #endif //KSNIP_WILDCARDRESOLVER_H ksnip-1.9.2/src/backend/uploader/000077500000000000000000000000001414701001100166255ustar00rootroot00000000000000ksnip-1.9.2/src/backend/uploader/IUploader.h000066400000000000000000000022071414701001100206630ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_IUPLOADER_H #define KSNIP_IUPLOADER_H #include "UploadResult.h" #include "src/common/enum/UploaderType.h" class IUploader { public: virtual ~IUploader() = default; virtual void upload(const QImage &image) = 0; virtual UploaderType type() const = 0; protected: virtual void finished(const UploadResult &result) = 0; }; #endif //KSNIP_IUPLOADER_H ksnip-1.9.2/src/backend/uploader/UploadResult.h000066400000000000000000000025111414701001100214200ustar00rootroot00000000000000/* * Copyright (C) 2030 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_UPLOADRESULT_H #define KSNIP_UPLOADRESULT_H #include #include "src/common/enum/UploadStatus.h" #include "src/common/enum/UploaderType.h" struct UploadResult { UploadStatus status; UploaderType type; QString content; explicit UploadResult(UploadStatus status, UploaderType type) { this->status = status; this->type = type; } explicit UploadResult(UploadStatus status, UploaderType type, const QString &content) { this->status = status; this->type = type; this->content = content; } }; #endif //KSNIP_UPLOADRESULT_H ksnip-1.9.2/src/backend/uploader/UploaderProvider.cpp000066400000000000000000000034701414701001100226230ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "UploaderProvider.h" UploaderProvider::UploaderProvider() : mConfig(KsnipConfigProvider::instance()), mImgurUploader(nullptr), mScriptUploader(nullptr) { } UploaderProvider::~UploaderProvider() { delete mImgurUploader; delete mScriptUploader; } IUploader* UploaderProvider::get() { switch (mConfig->uploaderType()) { case UploaderType::Imgur: return getImgurUploader(); case UploaderType::Script: return getScriptUploader(); default: return getImgurUploader(); } } IUploader* UploaderProvider::getScriptUploader() { if(mScriptUploader == nullptr) { mScriptUploader = new ScriptUploader; connectSignals(mScriptUploader); } return mScriptUploader; } IUploader* UploaderProvider::getImgurUploader() { if(mImgurUploader == nullptr) { mImgurUploader = new ImgurUploader; connectSignals(mImgurUploader); } return mImgurUploader; } void UploaderProvider::connectSignals(IUploader *uploader) { connect(dynamic_cast(uploader), SIGNAL(finished(UploadResult)), this, SIGNAL(finished(UploadResult))); } ksnip-1.9.2/src/backend/uploader/UploaderProvider.h000066400000000000000000000026701414701001100222710ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_UPLOADERPROVIDER_H #define KSNIP_UPLOADERPROVIDER_H #include #include "src/backend/uploader/imgur/ImgurUploader.h" #include "src/backend/uploader/script/ScriptUploader.h" #include "src/backend/config/KsnipConfigProvider.h" class UploaderProvider : public QObject { Q_OBJECT public: UploaderProvider(); ~UploaderProvider() override; IUploader* get(); signals: void finished(const UploadResult &result); private: KsnipConfig *mConfig; IUploader *mImgurUploader; IUploader *mScriptUploader; void connectSignals(IUploader *uploader); IUploader* getImgurUploader(); IUploader* getScriptUploader(); }; #endif //KSNIP_UPLOADERPROVIDER_H ksnip-1.9.2/src/backend/uploader/imgur/000077500000000000000000000000001414701001100177505ustar00rootroot00000000000000ksnip-1.9.2/src/backend/uploader/imgur/ImgurResponse.cpp000066400000000000000000000022611414701001100232570ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #include "ImgurResponse.h" ImgurResponse::ImgurResponse(const QString &link, const QString &deleteHash) { mLink = link; mDeleteHash = deleteHash; mTimeStamp = QDateTime::currentDateTime(); } QString ImgurResponse::link() const { return mLink; } QString ImgurResponse::deleteHash() const { return mDeleteHash; } QDateTime ImgurResponse::timeStamp() const { return mTimeStamp; } ksnip-1.9.2/src/backend/uploader/imgur/ImgurResponse.h000066400000000000000000000023321414701001100227230ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef KSNIP_IMGURRESPONSE_H #define KSNIP_IMGURRESPONSE_H #include #include class ImgurResponse { public: explicit ImgurResponse(const QString &link, const QString &deleteHash); ~ImgurResponse() = default; QString link() const; QString deleteHash() const; QDateTime timeStamp() const; private: QString mLink; QString mDeleteHash; QDateTime mTimeStamp; }; #endif //KSNIP_IMGURRESPONSE_H ksnip-1.9.2/src/backend/uploader/imgur/ImgurResponseLogger.cpp000066400000000000000000000045171414701001100244250ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #include #include "ImgurResponseLogger.h" ImgurResponseLogger::ImgurResponseLogger() { mLogFilename = QLatin1String("imgur_history.txt"); mLogPath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation); mLogFilePath = mLogPath + QLatin1String("/") + mLogFilename; } void ImgurResponseLogger::log(const ImgurResponse &response) { createPathIfRequired(); auto logEntry = getLogEntry(response); writeLogEntry(logEntry); } void ImgurResponseLogger::writeLogEntry(const QString &logEntry) const { QFile file(mLogFilePath); auto fileOpened = file.open(QIODevice::ReadWrite | QIODevice::Append | QIODevice::Text); if(fileOpened) { QTextStream stream(&file); stream << logEntry << endl; } } void ImgurResponseLogger::createPathIfRequired() const { QDir qdir; qdir.mkpath(mLogPath); } QString ImgurResponseLogger::getLogEntry(const ImgurResponse &response) const { auto separator = QLatin1String(","); auto deleteLink = QLatin1String("https://imgur.com/delete/") + response.deleteHash(); auto timestamp = response.timeStamp().toString(QLatin1String("dd.MM.yyyy hh:mm:ss")); return timestamp + separator + response.link() + separator + deleteLink; } QStringList ImgurResponseLogger::getLogs() const { auto logEntries = QStringList(); QFile file(mLogFilePath); auto fileOpened = file.open(QIODevice::ReadOnly); if (fileOpened) { QTextStream stream(&file); while (!stream.atEnd()) { auto entry = stream.readLine(); logEntries.append(entry); } } return logEntries; } ksnip-1.9.2/src/backend/uploader/imgur/ImgurResponseLogger.h000066400000000000000000000026271414701001100240720ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef KSNIP_IMGURRESPONSELOGGER_H #define KSNIP_IMGURRESPONSELOGGER_H #include #include #include #include "ImgurResponse.h" class ImgurResponseLogger { public: explicit ImgurResponseLogger(); ~ImgurResponseLogger() = default; void log(const ImgurResponse &response); QStringList getLogs() const; private: QString mLogFilename; QString mLogPath; QString mLogFilePath; void createPathIfRequired() const; QString getLogEntry(const ImgurResponse &response) const; void writeLogEntry(const QString &logEntry) const; }; #endif //KSNIP_IMGURRESPONSELOGGER_H ksnip-1.9.2/src/backend/uploader/imgur/ImgurUploader.cpp000066400000000000000000000062261414701001100232410ustar00rootroot00000000000000/* * Copyright (C) 2018 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "ImgurUploader.h" ImgurUploader::ImgurUploader() : mConfig(KsnipConfigProvider::instance()), mImgurWrapper(new ImgurWrapper(mConfig->imgurBaseUrl(), nullptr)), mImgurResponseLogger(new ImgurResponseLogger) { connect(mImgurWrapper, &ImgurWrapper::uploadFinished, this, &ImgurUploader::imgurUploadFinished); connect(mImgurWrapper, &ImgurWrapper::error, this, &ImgurUploader::imgurError); connect(mImgurWrapper, &ImgurWrapper::tokenUpdated, this, &ImgurUploader::imgurTokenUpdated); connect(mImgurWrapper, &ImgurWrapper::tokenRefreshRequired, this, &ImgurUploader::imgurTokenRefresh); } UploaderType ImgurUploader::type() const { return UploaderType::Imgur; } ImgurUploader::~ImgurUploader() { delete mImgurWrapper; delete mImgurResponseLogger; } void ImgurUploader::upload(const QImage &image) { mImage = image; if (!mConfig->imgurForceAnonymous() && !mConfig->imgurAccessToken().isEmpty()) { mImgurWrapper->startUpload(mImage, mConfig->imgurAccessToken()); } else { mImgurWrapper->startUpload(mImage); } } void ImgurUploader::imgurUploadFinished(const ImgurResponse &response) { qInfo("%s", qPrintable(tr("Upload to imgur.com finished!"))); mImgurResponseLogger->log(response); auto url = formatResponseUrl(response); emit finished(UploadResult(UploadStatus::NoError, type(), url)); } QString ImgurUploader::formatResponseUrl(const ImgurResponse &response) const { if (!mConfig->imgurLinkDirectlyToImage()) { return response.link().remove(QLatin1String(".png")); } return response.link(); } void ImgurUploader::imgurError(const QString &message) { qCritical("MainWindow: Imgur uploader returned error: '%s'", qPrintable(message)); emit finished(UploadResult(UploadStatus::NoError, type(), message)); } void ImgurUploader::imgurTokenUpdated(const QString &accessToken, const QString &refreshToken, const QString &username) { mConfig->setImgurAccessToken(accessToken.toUtf8()); mConfig->setImgurRefreshToken(refreshToken.toUtf8()); mConfig->setImgurUsername(username); qInfo("%s", qPrintable(tr("Received new token, trying upload again…"))); upload(mImage); } void ImgurUploader::imgurTokenRefresh() { mImgurWrapper->refreshToken(mConfig->imgurRefreshToken(), mConfig->imgurClientId(), mConfig->imgurClientSecret()); qInfo("%s", qPrintable(tr("Imgur token has expired, requesting new token…"))); } ksnip-1.9.2/src/backend/uploader/imgur/ImgurUploader.h000066400000000000000000000035541414701001100227070ustar00rootroot00000000000000/* * Copyright (C) 2018 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_IMGURUPLOADER_H #define KSNIP_IMGURUPLOADER_H #include #include "ImgurWrapper.h" #include "ImgurResponseLogger.h" #include "src/backend/uploader/IUploader.h" #include "src/backend/uploader/UploadResult.h" #include "src/backend/config/KsnipConfigProvider.h" #include "src/common/constants/DefaultValues.h" class ImgurUploader : public QObject, public IUploader { Q_OBJECT public: explicit ImgurUploader(); ~ImgurUploader() override; void upload(const QImage &image) override; UploaderType type() const override; signals: void finished(const UploadResult &result) override; private: KsnipConfig *mConfig; ImgurWrapper *mImgurWrapper; ImgurResponseLogger *mImgurResponseLogger; QImage mImage; private slots: void imgurUploadFinished(const ImgurResponse &response); void imgurError(const QString &message); void imgurTokenUpdated(const QString &accessToken, const QString &refreshToken, const QString &username); void imgurTokenRefresh(); QString formatResponseUrl(const ImgurResponse &response) const; }; #endif //KSNIP_IMGURUPLOADER_H ksnip-1.9.2/src/backend/uploader/imgur/ImgurWrapper.cpp000066400000000000000000000221371414701001100231050ustar00rootroot00000000000000/* * Copyright (C) 2016 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #include "ImgurWrapper.h" ImgurWrapper::ImgurWrapper(const QString &imgurUrl, QObject *parent) : mBaseImgutUrl(imgurUrl), QObject(parent), mAccessManager(new QNetworkAccessManager(this)) { connect(mAccessManager, &QNetworkAccessManager::finished, this, &ImgurWrapper::handleReply); // Client ID that will only be used for anonymous upload mClientId = "16d41e28a3ba71e"; } /* * This function starts the upload, depending if an access token was provided * this will be either an account upload on an anonymous upload. If the upload * was successful the upload Fished signal will be emitted which holds the url * to the image. */ void ImgurWrapper::startUpload(const QImage& image, const QByteArray& accessToken) const { // Convert the image into a byteArray QByteArray imageByteArray; QBuffer buffer(&imageByteArray); image.save(&buffer, "PNG"); // Create the network request for posting the image QUrl url(mBaseImgutUrl + QLatin1String("/3/upload.xml")); QUrlQuery urlQuery; // Add params that we send with the picture urlQuery.addQueryItem(QLatin1String("title"), QLatin1String("Ksnip Screenshot")); urlQuery.addQueryItem(QLatin1String("description"), QLatin1String("Screenshot uploaded via Ksnip")); url.setQuery(urlQuery); QNetworkRequest request; request.setUrl(url); request.setHeader(QNetworkRequest::ContentTypeHeader, QLatin1String("application/x-www-form-urlencoded")); // If an access token was sent, we upload to account, otherwise we upload // anonymously if (accessToken.isEmpty()) { request.setRawHeader("Authorization", "Client-ID " + mClientId); } else { request.setRawHeader("Authorization", "Bearer " + accessToken); } // Post the image mAccessManager->post(request, imageByteArray); } /* * This functions requests an access token, it only starts the request, the * topenUpdate signal will be emitted if the request was successful or otherwise * the tokenError. */ void ImgurWrapper::getAccessToken(const QByteArray& pin, const QByteArray& clientId, const QByteArray& clientSecret) const { QNetworkRequest request; // Build the URL that we will request the token from. The XML indicates we // want the response in XML format. request.setUrl(QUrl(mBaseImgutUrl + QLatin1String("/oauth2/token.xml"))); request.setHeader(QNetworkRequest::ContentTypeHeader, QLatin1String("application/x-www-form-urlencoded")); // Prepare the params that we send with the request QByteArray params; params.append("client_id=" + clientId); params.append("&client_secret=" + clientSecret); params.append("&grant_type=pin"); params.append("&pin=" + pin); // Request the token mAccessManager->post(request, params); } /* * The imgur token expires after some time, when this happens and you try to * post an image the server responds with 403 and we emit the * tokenRefreshRequired signal, after which this function should be called to * refresh the token. */ void ImgurWrapper::refreshToken(const QByteArray& refreshToken, const QByteArray& clientId, const QByteArray& clientSecret) const { QNetworkRequest request; // Build the URL that we will request the token from. The XML indicates we // want the response in XML format request.setUrl(QUrl(mBaseImgutUrl + QLatin1String("/oauth2/token.xml"))); request.setHeader(QNetworkRequest::ContentTypeHeader, QLatin1String("application/x-www-form-urlencoded")); // Prepare the params QByteArray params; params.append("refresh_token=" + refreshToken); params.append("&client_id=" + clientId); params.append("&client_secret=" + clientSecret); params.append("&grant_type=refresh_token"); // Request the token mAccessManager->post(request, params); } /* * Returns a URL that can be opened in a browser to request the pin. The * function is not opening the pin window in the browser, it only returns the * correct url to it. */ QUrl ImgurWrapper::pinRequestUrl(const QString& clientId) const { QUrl url(mBaseImgutUrl + QLatin1String("/oauth2/authorize")); QUrlQuery urlQuery; urlQuery.addQueryItem(QLatin1String("client_id"), clientId); urlQuery.addQueryItem(QLatin1String("response_type"), QLatin1String("pin")); url.setQuery(urlQuery); return url; } // // Private Functions // /* * This function handles the default response, a 200OK and any error message is * returned in a data root element. 200OK is returned when posting an image was * successful, 403 is mostly returned when a token has expired, anything else is * an error that we currently cannot handle */ void ImgurWrapper::handleDataResponse(const QDomElement& element) const { if (element.attribute(QLatin1String("status")) == QLatin1String("200") && !element.elementsByTagName(QLatin1String("link")).isEmpty()) { auto link = element.elementsByTagName(QLatin1String("link")).at(0).toElement().text(); auto deleteHash = element.elementsByTagName(QLatin1String("deletehash")).at(0).toElement().text(); emit uploadFinished(ImgurResponse(link, deleteHash)); } else if (element.attribute(QLatin1String("status")) == QLatin1String("403")) { emit tokenRefreshRequired(); } else { if (element.elementsByTagName(QLatin1String("error")).isEmpty()) { emit error(QLatin1String("Server responded with ") + element.attribute(QLatin1String("status"))); } else { emit error(QLatin1String("Server responded with ") + element.attribute(QLatin1String("status")) + ": " + element.elementsByTagName(QLatin1String("error")).at(0).toElement().text()); } } } /* * Called when a new token was received, either when first time getting access * or refreshing a token */ void ImgurWrapper::handleTokenResponse(const QDomElement& element) const { if (!element.elementsByTagName(QLatin1String("access_token")).isEmpty() && !element.elementsByTagName(QLatin1String("refresh_token")).isEmpty() && !element.elementsByTagName(QLatin1String("account_username")).isEmpty() ) { emit tokenUpdated(element.elementsByTagName(QLatin1String("access_token")).at(0).toElement().text(), element.elementsByTagName(QLatin1String("refresh_token")).at(0).toElement().text(), element.elementsByTagName(QLatin1String("account_username")).at(0).toElement().text() ); } else { emit error(QLatin1String("Expected token response was received, something went wrong.")); } } // // Private Slots // /* * This function will be called when we've got the reply from imgur */ void ImgurWrapper::handleReply(QNetworkReply* reply) { // Only for troubleshooting, if reply->readAll is called the parser will fail! // qDebug("----------------------------------------------------------------"); // qDebug("Reply code:\n%s", qPrintable(reply->readAll())); // qDebug("----------------------------------------------------------------"); // Check network return code, if we get no error or if we get a status 202, // proceed, the 202 is returned for invalid token, we will request a new // token. if (reply->error() != QNetworkReply::NoError && reply->error() != QNetworkReply::ContentOperationNotPermittedError) { emit error(QLatin1String("Network Error(") + QString::number(reply->error()) + "): " + reply->errorString()); reply->deleteLater(); return; } QDomDocument doc; QString errorMessage; int errorLine; int errorColumn; // Try to parse reply into xml reader if (!doc.setContent(reply->readAll(), false, &errorMessage, &errorLine, &errorColumn)) { emit error(QLatin1String("Parse error: ") + errorMessage + QLatin1String(", line:") + errorLine + QLatin1String(", column:") + errorColumn); reply->deleteLater(); return; } // See if we have an upload reply, token response or error auto rootElement = doc.documentElement(); if (rootElement.tagName() == QLatin1String("data")) { handleDataResponse(rootElement); } else if (rootElement.tagName() == QLatin1String("response")) { handleTokenResponse(rootElement); } else { emit error(QLatin1String("Received unexpected reply from imgur server.")); } reply->deleteLater(); } ksnip-1.9.2/src/backend/uploader/imgur/ImgurWrapper.h000066400000000000000000000041351414701001100225500ustar00rootroot00000000000000/* * Copyright (C) 2016 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef KSNIP_IMGURWRAPPER_H #define KSNIP_IMGURWRAPPER_H #include #include #include #include #include #include #include #include "ImgurResponse.h" class ImgurWrapper : public QObject { Q_OBJECT public: explicit ImgurWrapper(const QString &imgurUrl, QObject *parent); void startUpload(const QImage &image, const QByteArray &accessToken = nullptr) const; void getAccessToken(const QByteArray &pin, const QByteArray &clientId, const QByteArray &clientSecret) const; void refreshToken(const QByteArray &refreshToken, const QByteArray &clientId, const QByteArray &clientSecret) const; QUrl pinRequestUrl(const QString &clientId) const; signals: void uploadFinished(const ImgurResponse &response) const; void error(const QString &message) const; void tokenUpdated(const QString &accessToken, const QString &refreshToken, const QString &username) const; void tokenRefreshRequired() const; private: QNetworkAccessManager *mAccessManager; QByteArray mClientId; QString mBaseImgutUrl; void handleDataResponse(const QDomElement &element) const; void handleTokenResponse(const QDomElement &element) const; private slots: void handleReply(QNetworkReply *reply); }; #endif // KSNIP_IMGURWRAPPER_H ksnip-1.9.2/src/backend/uploader/script/000077500000000000000000000000001414701001100201315ustar00rootroot00000000000000ksnip-1.9.2/src/backend/uploader/script/ScriptUploader.cpp000066400000000000000000000072731414701001100236060ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "ScriptUploader.h" ScriptUploader::ScriptUploader() : mConfig(KsnipConfigProvider::instance()) { connect(&mProcessHandler, QOverload::of(&QProcess::finished), this, &ScriptUploader::scriptFinished); connect(&mProcessHandler, &QProcess::errorOccurred, this, &ScriptUploader::errorOccurred); } void ScriptUploader::upload(const QImage &image) { if(saveImageLocally(image)) { mProcessHandler.start(mConfig->uploadScriptPath(), { mPathToTmpImage }); } else { auto result = UploadResult(UploadStatus::UnableToSaveTemporaryImage, type()); emit finished(result); } } UploaderType ScriptUploader::type() const { return UploaderType::Script; } bool ScriptUploader::saveImageLocally(const QImage &image) { mPathToTmpImage = TempFileProvider::tempFile(); return image.save(mPathToTmpImage); } void ScriptUploader::scriptFinished(int exitCode, QProcess::ExitStatus exitStatus) { Q_UNUSED(exitCode); Q_UNUSED(exitStatus); auto stdErrOutput = mProcessHandler.readAllStandardError(); if(mConfig->uploadScriptStopOnStdErr() && !stdErrOutput.isEmpty()) { handleError(UploadStatus::ScriptWroteToStdErr, stdErrOutput); } else if(exitStatus == QProcess::ExitStatus::NormalExit) { handleSuccess(); } } void ScriptUploader::handleSuccess() { auto output = QString(mProcessHandler.readAllStandardOutput()); auto result = parseOutput(output); writeToConsole(output); cleanup(); emit finished(UploadResult(UploadStatus::NoError, type(), result)); } QString ScriptUploader::parseOutput(const QString &output) const { auto outputFilter = mConfig->uploadScriptCopyOutputFilter(); auto result = output; if(!outputFilter.isEmpty()) { QRegularExpression regEx(outputFilter); auto expressionMatch = regEx.match(output); if(expressionMatch.hasMatch()) { result = expressionMatch.captured(0); } } return result; } void ScriptUploader::errorOccurred(QProcess::ProcessError errorType) { auto status = mapErrorTypeToStatus(errorType); auto stdErrOutput = mProcessHandler.readAllStandardError(); handleError(status, stdErrOutput); } void ScriptUploader::handleError(const UploadStatus &status, const QString &stdErrOutput) { writeToConsole(stdErrOutput); cleanup(); emit finished(UploadResult(status, type())); } UploadStatus ScriptUploader::mapErrorTypeToStatus(QProcess::ProcessError errorType) const { switch (errorType) { case QProcess::FailedToStart: return UploadStatus::FailedToStart; case QProcess::Crashed: return UploadStatus::Crashed; case QProcess::Timedout: return UploadStatus::Timedout; case QProcess::ReadError: return UploadStatus::ReadError; case QProcess::WriteError: return UploadStatus::WriteError; default: return UploadStatus::UnknownError; } } void ScriptUploader::cleanup() { QFile file(mPathToTmpImage); file.remove(); mPathToTmpImage.clear(); } void ScriptUploader::writeToConsole(const QString &output) const { qInfo("%s", qPrintable(output)); } ksnip-1.9.2/src/backend/uploader/script/ScriptUploader.h000066400000000000000000000036631414701001100232520ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_SCRIPTUPLOADER_H #define KSNIP_SCRIPTUPLOADER_H #include #include #include "src/backend/uploader/IUploader.h" #include "src/backend/config/KsnipConfigProvider.h" #include "src/common/enum/UploadStatus.h" #include "src/common/provider/TempFileProvider.h" class ScriptUploader : public QObject, public IUploader { Q_OBJECT public: ScriptUploader(); ~ScriptUploader() override = default; void upload(const QImage &image) override; UploaderType type() const override; signals: void finished(const UploadResult &result) override; private: KsnipConfig * mConfig; QProcess mProcessHandler; QString mPathToTmpImage; private slots: void scriptFinished(int exitCode, QProcess::ExitStatus exitStatus); void errorOccurred(QProcess::ProcessError error); bool saveImageLocally(const QImage &image); void cleanup(); QString parseOutput(const QString &output) const; void writeToConsole(const QString &output) const; UploadStatus mapErrorTypeToStatus(QProcess::ProcessError errorType) const; void handleSuccess(); void handleError(const UploadStatus &status, const QString &stdErrOutput); }; #endif //KSNIP_SCRIPTUPLOADER_H ksnip-1.9.2/src/bootstrapper/000077500000000000000000000000001414701001100161475ustar00rootroot00000000000000ksnip-1.9.2/src/bootstrapper/BootstrapperFactory.cpp000066400000000000000000000024641414701001100226750ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "BootstrapperFactory.h" QSharedPointer BootstrapperFactory::create() { if(isSingleInstance()) { if (mInstanceLock.lock()) { return QSharedPointer(new SingleInstanceServerBootstrapper()); } else { return QSharedPointer(new SingleInstanceClientBootstrapper()); } } else { return QSharedPointer(new StandAloneBootstrapper()); } } bool BootstrapperFactory::isSingleInstance() { return KsnipConfigProvider::instance()->useSingleInstance(); } ksnip-1.9.2/src/bootstrapper/BootstrapperFactory.h000066400000000000000000000026521414701001100223410ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_BOOTSTRAPPERFACTORY_H #define KSNIP_BOOTSTRAPPERFACTORY_H #include #include #include "src/backend/config/KsnipConfigProvider.h" #include "src/bootstrapper/singleInstance/SingleInstanceServerBootstrapper.h" #include "src/bootstrapper/singleInstance/SingleInstanceClientBootstrapper.h" #include "src/bootstrapper/singleInstance/InstanceLock.h" class BootstrapperFactory { public: BootstrapperFactory() = default; ~BootstrapperFactory() = default; QSharedPointer create(); private: InstanceLock mInstanceLock; bool isSingleInstance(); }; #endif //KSNIP_BOOTSTRAPPERFACTORY_H ksnip-1.9.2/src/bootstrapper/IBootstrapper.h000066400000000000000000000017251414701001100211220ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_IBOOTSTRAPPER_H #define KSNIP_IBOOTSTRAPPER_H class IBootstrapper { public: virtual int start(const QApplication &app) = 0; }; #endif //KSNIP_IBOOTSTRAPPER_H ksnip-1.9.2/src/bootstrapper/StandAloneBootstrapper.cpp000066400000000000000000000120111414701001100233030ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "StandAloneBootstrapper.h" StandAloneBootstrapper::StandAloneBootstrapper() : mImageGrabber(nullptr), mCommandLine(nullptr), mMainWindow(nullptr) { } StandAloneBootstrapper::~StandAloneBootstrapper() { delete mCommandLine; } int StandAloneBootstrapper::start(const QApplication &app) { app.setQuitOnLastWindowClosed(false); createImageGrabber(); createCommandLineParser(app); if (isVersionRequested()) { return showVersion(); } if (isStartedWithoutArguments()) { return startKsnip(app); } if (isEditRequested()) { return startKsnipAndEditImage(app); } return startKsnipAndTakeCapture(app); } bool StandAloneBootstrapper::isEditRequested() const { return mCommandLine->isEditSet(); } bool StandAloneBootstrapper::isVersionRequested() const { return mCommandLine->isVersionSet(); } bool StandAloneBootstrapper::isStartedWithoutArguments() const { auto arguments = QCoreApplication::arguments(); return arguments.count() <= 1; } int StandAloneBootstrapper::startKsnipAndTakeCapture(const QApplication &app) { auto captureMode = getCaptureMode(); auto runMode = getRunMode(); auto captureCursor = getCaptureCursor(); auto delay = getDelay(); if(runMode != RunMode::CLI) { loadTranslations(app); } createMainWindow(runMode); mMainWindow->captureScreenshot(captureMode, captureCursor, delay); return app.exec(); } bool StandAloneBootstrapper::getCaptureCursor() const { return mCommandLine->isCursorSet(); } int StandAloneBootstrapper::getDelay() const { auto delay = 0; if (mCommandLine->isDelaySet()) { delay = mCommandLine->delay(); if (delay < 0) { qWarning("Delay flag set without value, ignoring delay."); delay = 0; } } return delay * 1000; } RunMode StandAloneBootstrapper::getRunMode() const { return getSave() ? RunMode::CLI : RunMode::Edit; } bool StandAloneBootstrapper::getSave() const { return mCommandLine->isSaveSet(); } CaptureModes StandAloneBootstrapper::getCaptureMode() const { if (mCommandLine->isCaptureModeSet()) { return mCommandLine->captureMode(); } else { qWarning("No capture mode selected, using default."); return CaptureModes::RectArea; } } int StandAloneBootstrapper::startKsnipAndEditImage(const QApplication &app) { loadTranslations(app); auto pathToImage = getImagePath(); auto pixmap = getPixmapFromCorrectSource(pathToImage); if (pixmap.isNull()) { qWarning("Unable to open image file %s.", qPrintable(pathToImage)); return 1; } else { createMainWindow(RunMode::Edit); if(PathHelper::isPipePath(pathToImage)) { mMainWindow->processImage(CaptureDto(pixmap)); } else { mMainWindow->processImage(CaptureFromFileDto(pixmap, pathToImage)); } return app.exec(); } } QPixmap StandAloneBootstrapper::getPixmapFromCorrectSource(const QString &pathToImage) { if (PathHelper::isPipePath(pathToImage)) { qInfo("Reading image from stdin."); return getPixmapFromStdin(); } else { return QPixmap(pathToImage); } } QPixmap StandAloneBootstrapper::getPixmapFromStdin() { QByteArray stdinImage; while (!std::cin.eof()) { char string[1024]; std::cin.read(string, sizeof(string)); auto length = std::cin.gcount(); stdinImage.append(string, length); } QPixmap pixmap; pixmap.loadFromData(stdinImage); return pixmap; } QString StandAloneBootstrapper::getImagePath() const { return mCommandLine->imagePath(); } int StandAloneBootstrapper::startKsnip(const QApplication &app) { loadTranslations(app); createMainWindow(RunMode::GUI); return app.exec(); } int StandAloneBootstrapper::showVersion() { QTextStream stream(stdout); stream << QLatin1String("Version: ") + qPrintable(KSNIP_VERSION) + QLatin1String("\n"); stream << QLatin1String("Build: ") + qPrintable(KSNIP_BUILD_NUMBER) + QLatin1String("\n"); return 0; } void StandAloneBootstrapper::createMainWindow(RunMode mode) { Q_ASSERT(mMainWindow == nullptr); mMainWindow = new MainWindow(mImageGrabber, mode); } void StandAloneBootstrapper::createCommandLineParser(const QApplication &app) { mCommandLine = new KsnipCommandLine (app, mImageGrabber->supportedCaptureModes()); } void StandAloneBootstrapper::createImageGrabber() { mImageGrabber = ImageGrabberFactory::createImageGrabber(); } void StandAloneBootstrapper::loadTranslations(const QApplication &app) { TranslationLoader::load(app); } ksnip-1.9.2/src/bootstrapper/StandAloneBootstrapper.h000066400000000000000000000044141414701001100227600ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_STANDALONEBOOTSTRAPPER_H #define KSNIP_STANDALONEBOOTSTRAPPER_H #include #include #include "BuildConfig.h" #include "src/bootstrapper/IBootstrapper.h" #include "src/gui/MainWindow.h" #include "src/backend/imageGrabber/ImageGrabberFactory.h" #include "src/backend/TranslationLoader.h" #include "src/backend/KsnipCommandLine.h" #include "src/common/dtos/CaptureFromFileDto.h" class StandAloneBootstrapper : public IBootstrapper { public: StandAloneBootstrapper(); ~StandAloneBootstrapper(); int start(const QApplication &app) override; protected: MainWindow *mMainWindow; void createCommandLineParser(const QApplication &app); void createImageGrabber(); static int showVersion() ; bool isStartedWithoutArguments() const; bool isVersionRequested() const; bool isEditRequested() const; CaptureModes getCaptureMode() const; RunMode getRunMode() const; int getDelay() const; QString getImagePath() const; bool getCaptureCursor() const; bool getSave() const; private: AbstractImageGrabber *mImageGrabber; KsnipCommandLine *mCommandLine; static void loadTranslations(const QApplication &app) ; virtual void createMainWindow(RunMode mode); int startKsnip(const QApplication &app); int startKsnipAndEditImage(const QApplication &app); int startKsnipAndTakeCapture(const QApplication &app); static QPixmap getPixmapFromCorrectSource(const QString &pathToImage); static QPixmap getPixmapFromStdin(); }; #endif //KSNIP_STANDALONEBOOTSTRAPPER_H ksnip-1.9.2/src/bootstrapper/singleInstance/000077500000000000000000000000001414701001100211155ustar00rootroot00000000000000ksnip-1.9.2/src/bootstrapper/singleInstance/InstanceLock.cpp000066400000000000000000000026251414701001100242030ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "InstanceLock.h" InstanceLock::InstanceLock() { mSingular = new QSharedMemory(QLatin1String("KsnipInstanceLock"), this); } InstanceLock::~InstanceLock() { if(mSingular->isAttached()) { mSingular->detach(); } } bool InstanceLock::lock() { if (create()) { return true; } else { attachDetach(); return create(); } } bool InstanceLock::create() { if (mSingular->create(1)) { mSingular->lock(); mSingular->unlock(); return true; } return false; } bool InstanceLock::attachDetach() { if (mSingular->attach(QSharedMemory::ReadOnly)) { mSingular->detach(); return true; } return false; }ksnip-1.9.2/src/bootstrapper/singleInstance/InstanceLock.h000066400000000000000000000021351414701001100236440ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_INSTANCELOCK_H #define KSNIP_INSTANCELOCK_H #include class InstanceLock : public QObject { Q_OBJECT public: InstanceLock(); ~InstanceLock() override; bool lock(); private: QSharedMemory *mSingular; bool create(); bool attachDetach(); }; #endif //KSNIP_INSTANCELOCK_H ksnip-1.9.2/src/bootstrapper/singleInstance/SingleInstanceClientBootstrapper.cpp000066400000000000000000000040721414701001100302760ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "SingleInstanceClientBootstrapper.h" SingleInstanceClientBootstrapper::SingleInstanceClientBootstrapper() : mIpcClient(new IpcClient) { mIpcClient->connectTo(SingleInstance::ServerName); } SingleInstanceClientBootstrapper::~SingleInstanceClientBootstrapper() { delete mIpcClient; } int SingleInstanceClientBootstrapper::start(const QApplication &app) { createImageGrabber(); createCommandLineParser(app); if (isVersionRequested()) { return showVersion(); } else { return notifyServer(); } } bool SingleInstanceClientBootstrapper::isImagePathValid(const QString &imagePath) const { QPixmap pixmap(imagePath); auto imageValid = pixmap.isNull(); return imageValid; } int SingleInstanceClientBootstrapper::notifyServer() const { SingleInstanceParameter parameter; if (isStartedWithoutArguments()) { parameter = SingleInstanceParameter(); } else if (isEditRequested()) { auto imagePath = getImagePath(); if (isImagePathValid(imagePath)) { qWarning("Unable to open image file %s.", qPrintable(imagePath)); return 1; } parameter = SingleInstanceParameter(imagePath); } else { parameter = SingleInstanceParameter(getCaptureMode(), getSave(), getCaptureCursor(), getDelay()); } mIpcClient->send(mParameterTranslator.translate(parameter)); return 0; } ksnip-1.9.2/src/bootstrapper/singleInstance/SingleInstanceClientBootstrapper.h000066400000000000000000000031601414701001100277400ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_SINGLEINSTANCECLIENTBOOTSTRAPPER_H #define KSNIP_SINGLEINSTANCECLIENTBOOTSTRAPPER_H #include #include "src/bootstrapper/StandAloneBootstrapper.h" #include "src/bootstrapper/IBootstrapper.h" #include "src/bootstrapper/singleInstance/SingleInstanceConstants.h" #include "src/bootstrapper/singleInstance/SingleInstanceParameterTranslator.h" #include "src/backend/ipc/IpcClient.h" class SingleInstanceClientBootstrapper : public StandAloneBootstrapper { public: SingleInstanceClientBootstrapper(); ~SingleInstanceClientBootstrapper(); int start(const QApplication &app) override; private: IpcClient *mIpcClient; SingleInstanceParameterTranslator mParameterTranslator; bool isImagePathValid(const QString &imagePath) const; int notifyServer() const; }; #endif //KSNIP_SINGLEINSTANCECLIENTBOOTSTRAPPER_H ksnip-1.9.2/src/bootstrapper/singleInstance/SingleInstanceConstants.h000066400000000000000000000021111414701001100260640ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_SINGLEINSTANCECONSTANTS_H #define KSNIP_SINGLEINSTANCECONSTANTS_H #include inline namespace SingleInstance { const QString ServerName(QStringLiteral("org.ksnip.ksnip.singleInstanceServer")); } // namespace SingleInstance #endif //KSNIP_SINGLEINSTANCECONSTANTS_H ksnip-1.9.2/src/bootstrapper/singleInstance/SingleInstanceParameter.h000066400000000000000000000032671414701001100260450ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_SINGLEINSTANCEPARAMETER_H #define KSNIP_SINGLEINSTANCEPARAMETER_H #include #include "src/bootstrapper/singleInstance/SingleInstanceStartupModes.h" #include "src/common/enum/CaptureModes.h" struct SingleInstanceParameter { SingleInstanceStartupModes startupMode; CaptureModes captureMode; QString imagePath; bool save; bool captureCursor; int delay; SingleInstanceParameter() { this->startupMode = SingleInstanceStartupModes::Start; } SingleInstanceParameter(const QString &path) { this->startupMode = SingleInstanceStartupModes::Edit; this->imagePath = path; } SingleInstanceParameter(CaptureModes captureMode, bool save, bool captureCursor, int delay) { this->startupMode = SingleInstanceStartupModes::Capture; this->captureMode = captureMode; this->save = save; this->captureCursor = captureCursor; this->delay = delay; } }; #endif //KSNIP_SINGLEINSTANCEPARAMETER_H ksnip-1.9.2/src/bootstrapper/singleInstance/SingleInstanceParameterTranslator.cpp000066400000000000000000000121171414701001100304440ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "SingleInstanceParameterTranslator.h" QByteArray SingleInstanceParameterTranslator::translate(const SingleInstanceParameter ¶meter) const { switch (parameter.startupMode) { case SingleInstanceStartupModes::Edit: return getEditParameters(parameter.imagePath); case SingleInstanceStartupModes::Capture: return getCaptureParameters(parameter.captureMode, parameter.save, parameter.captureCursor, parameter.delay); default: return getStartParameter(); } } SingleInstanceParameter SingleInstanceParameterTranslator::translate(const QByteArray &byteArray) const { auto parameters = byteArray.split(getSeparator()[0]); if(parameters.empty()) { qCritical("Startup mode must be provided."); return SingleInstanceParameter(); } auto startupMode = parameters[0]; if (startupMode == getEditParameter() && parameters.count() == 2) { return SingleInstanceParameter(parameters[1]); } else if (startupMode == getCaptureParameter() && parameters.count() == 5){ auto captureMode = getCaptureMode(parameters[1]); auto save = getBoolean(parameters[2]); auto captureCursor = getBoolean(parameters[3]); auto delay = parameters[4].toInt(); return SingleInstanceParameter(captureMode, save, captureCursor, delay); } else { return SingleInstanceParameter(); } } CaptureModes SingleInstanceParameterTranslator::getCaptureMode(const QByteArray &captureMode) const { if (captureMode == QByteArray("rectArea")) { return CaptureModes::RectArea; } else if (captureMode == QByteArray("lastRectArea")) { return CaptureModes::LastRectArea; } else if (captureMode == QByteArray("fullScreen")) { return CaptureModes::FullScreen; } else if (captureMode == QByteArray("currentScreen")) { return CaptureModes::CurrentScreen; } else if (captureMode == QByteArray("activeWindow")) { return CaptureModes::ActiveWindow; } else if (captureMode == QByteArray("portal")) { return CaptureModes::Portal; } else { return CaptureModes::WindowUnderCursor; } } QByteArray SingleInstanceParameterTranslator::getStartParameter() const { return QByteArray("start"); } QByteArray SingleInstanceParameterTranslator::getEditParameters(const QString &path) const { return getEditParameter() + getSeparator() + getPathParameter(path); } QByteArray SingleInstanceParameterTranslator::getEditParameter() const { return QByteArray("edit"); } QByteArray SingleInstanceParameterTranslator::getCaptureParameters(CaptureModes captureModes, bool save, bool captureCursor, int delay) const { return getCaptureParameter() + getSeparator() + getCaptureModeParameter(captureModes) + getSeparator() + getSaveParameter(save) + getSeparator() + getCaptureCursorParameter(captureCursor) + getSeparator() + getDelayParameter(delay); } QByteArray SingleInstanceParameterTranslator::getCaptureParameter() const { return QByteArray("capture"); } QByteArray SingleInstanceParameterTranslator::getSaveParameter(bool save) const { return getBooleanString(save); } QByteArray SingleInstanceParameterTranslator::getCaptureModeParameter(const CaptureModes &captureModes) const { switch (captureModes) { case CaptureModes::LastRectArea: return QByteArray("lastRectArea"); case CaptureModes::FullScreen: return QByteArray("fullScreen"); case CaptureModes::CurrentScreen: return QByteArray("currentScreen"); case CaptureModes::ActiveWindow: return QByteArray("activeWindow"); case CaptureModes::WindowUnderCursor: return QByteArray("windowUnderCursor"); case CaptureModes::Portal: return QByteArray("portal"); default: return QByteArray("rectArea"); } } QByteArray SingleInstanceParameterTranslator::getSeparator() const { return QByteArray(";"); } QByteArray SingleInstanceParameterTranslator::getPathParameter(const QString &path) const { return path.toLatin1(); } QByteArray SingleInstanceParameterTranslator::getBooleanString(bool value) const { return value ? QByteArray("true") : QByteArray("false"); } QByteArray SingleInstanceParameterTranslator::getCaptureCursorParameter(bool captureCursor) const { return getBooleanString(captureCursor); } QByteArray SingleInstanceParameterTranslator::getDelayParameter(int delay) const { return QString::number(delay).toLatin1(); } bool SingleInstanceParameterTranslator::getBoolean(const QByteArray &value) const { return value == QByteArray("true"); } ksnip-1.9.2/src/bootstrapper/singleInstance/SingleInstanceParameterTranslator.h000066400000000000000000000042101414701001100301040ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_SINGLEINSTANCEPARAMETERTRANSLATOR_H #define KSNIP_SINGLEINSTANCEPARAMETERTRANSLATOR_H #include #include #include "src/bootstrapper/singleInstance/SingleInstanceParameter.h" #include "src/common/enum/RunMode.h" class SingleInstanceParameterTranslator { public: SingleInstanceParameterTranslator() = default; ~SingleInstanceParameterTranslator() = default; QByteArray translate(const SingleInstanceParameter ¶meter) const; SingleInstanceParameter translate(const QByteArray &byteArray) const; private: QByteArray getStartParameter() const; QByteArray getEditParameters(const QString &path) const; QByteArray getCaptureParameters(CaptureModes captureModes, bool save, bool captureCursor, int delay) const; QByteArray getSeparator() const; QByteArray getPathParameter(const QString &path) const; QByteArray getCaptureModeParameter(const CaptureModes &captureModes) const; QByteArray getSaveParameter(bool save) const; QByteArray getBooleanString(bool value) const; QByteArray getCaptureCursorParameter(bool captureCursor) const; QByteArray getDelayParameter(int delay) const; QByteArray getEditParameter() const; QByteArray getCaptureParameter() const; CaptureModes getCaptureMode(const QByteArray &captureMode) const; bool getBoolean(const QByteArray &value) const; }; #endif //KSNIP_SINGLEINSTANCEPARAMETERTRANSLATOR_H ksnip-1.9.2/src/bootstrapper/singleInstance/SingleInstanceServerBootstrapper.cpp000066400000000000000000000043551414701001100303320ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "SingleInstanceServerBootstrapper.h" SingleInstanceServerBootstrapper::SingleInstanceServerBootstrapper() : mIpcServer(new IpcServer) { } SingleInstanceServerBootstrapper::~SingleInstanceServerBootstrapper() { delete mIpcServer; } int SingleInstanceServerBootstrapper::start(const QApplication &app) { startServer(); return StandAloneBootstrapper::start(app); } void SingleInstanceServerBootstrapper::startServer() const { mIpcServer->listen(SingleInstance::ServerName); connect(mIpcServer, &IpcServer::received, this, &SingleInstanceServerBootstrapper::processData); } void SingleInstanceServerBootstrapper::processData(const QByteArray &data) { auto parameter = mParameterTranslator.translate(data); switch (parameter.startupMode) { case SingleInstanceStartupModes::Start: show(); break; case SingleInstanceStartupModes::Edit: processImage(parameter.imagePath); break; case SingleInstanceStartupModes::Capture: capture(parameter); break; } } void SingleInstanceServerBootstrapper::capture(const SingleInstanceParameter ¶meter) const { mMainWindow->captureScreenshot(parameter.captureMode, parameter.captureCursor, parameter.delay); } void SingleInstanceServerBootstrapper::show() const { mMainWindow->show(); } void SingleInstanceServerBootstrapper::processImage(const QString &imagePath) { QPixmap pixmap(imagePath); auto captureDto = CaptureFromFileDto(pixmap, imagePath); mMainWindow->processCapture(captureDto); } ksnip-1.9.2/src/bootstrapper/singleInstance/SingleInstanceServerBootstrapper.h000066400000000000000000000033201414701001100277660ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_SINGLEINSTANCESERVERBOOTSTRAPPER_H #define KSNIP_SINGLEINSTANCESERVERBOOTSTRAPPER_H #include "src/bootstrapper/StandAloneBootstrapper.h" #include "src/bootstrapper/singleInstance/SingleInstanceConstants.h" #include "src/bootstrapper/singleInstance/SingleInstanceParameterTranslator.h" #include "src/backend/ipc/IpcServer.h" class SingleInstanceServerBootstrapper : public QObject, public StandAloneBootstrapper { Q_OBJECT public: SingleInstanceServerBootstrapper(); ~SingleInstanceServerBootstrapper() override; int start(const QApplication &app) override; private: IpcServer *mIpcServer; SingleInstanceParameterTranslator mParameterTranslator; void show() const; void processImage(const QString &imagePath); void capture(const SingleInstanceParameter ¶meter) const; private slots: void processData(const QByteArray &data); void startServer() const; }; #endif //KSNIP_SINGLEINSTANCESERVERBOOTSTRAPPER_H ksnip-1.9.2/src/bootstrapper/singleInstance/SingleInstanceStartupModes.h000066400000000000000000000017511414701001100265530ustar00rootroot00000000000000/* * Copyright (C) 2017 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_SINGLEINSTANCESTARTUPMODES_H #define KSNIP_SINGLEINSTANCESTARTUPMODES_H enum class SingleInstanceStartupModes { Start, Edit, Capture }; #endif //KSNIP_SINGLEINSTANCESTARTUPMODES_H ksnip-1.9.2/src/common/000077500000000000000000000000001414701001100147135ustar00rootroot00000000000000ksnip-1.9.2/src/common/adapter/000077500000000000000000000000001414701001100163335ustar00rootroot00000000000000ksnip-1.9.2/src/common/adapter/fileDialog/000077500000000000000000000000001414701001100203725ustar00rootroot00000000000000ksnip-1.9.2/src/common/adapter/fileDialog/FileDialogAdapter.cpp000066400000000000000000000036021414701001100243770ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "FileDialogAdapter.h" QString FileDialogAdapter::getExistingDirectory(QWidget *parent, const QString &title, const QString &directory) { return QFileDialog::getExistingDirectory(parent, title, directory, mOptions); } QString FileDialogAdapter::getOpenFileName(QWidget *parent, const QString &title, const QString &directory) { return QFileDialog::getOpenFileName(parent, title, directory, nullptr, nullptr, mOptions); } QStringList FileDialogAdapter::getOpenFileNames(QWidget *parent, const QString &title, const QString &directory, const QString &filter) { return QFileDialog::getOpenFileNames(parent, title, directory, filter, nullptr, mOptions); } QString FileDialogAdapter::getSavePath(QWidget *parent, const QString &title, const QString &path, const QString &filter) { QFileDialog saveDialog(parent, title, path, filter); saveDialog.setAcceptMode(QFileDialog::AcceptSave); saveDialog.setOptions(mOptions); if (saveDialog.exec() == QDialog::Accepted) { return saveDialog.selectedFiles().first(); } return {}; } void FileDialogAdapter::addOption(QFileDialog::Option option) { mOptions |= option; } ksnip-1.9.2/src/common/adapter/fileDialog/FileDialogAdapter.h000066400000000000000000000031601414701001100240430ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_FILEDIALOGADAPTER_H #define KSNIP_FILEDIALOGADAPTER_H #include #include "IFileDialogAdapter.h" class FileDialogAdapter : public IFileDialogAdapter { public: explicit FileDialogAdapter() = default; ~FileDialogAdapter() override = default; QString getExistingDirectory(QWidget *parent, const QString &title, const QString &directory) override; QString getOpenFileName(QWidget *parent, const QString &title, const QString &directory) override; QStringList getOpenFileNames(QWidget *parent, const QString &title, const QString &directory, const QString &filter) override; QString getSavePath(QWidget *parent, const QString &title, const QString &path, const QString &filter) override; protected: void addOption(QFileDialog::Option option); private: QFileDialog::Options mOptions; }; #endif //KSNIP_FILEDIALOGADAPTER_H ksnip-1.9.2/src/common/adapter/fileDialog/FileDialogAdapterFactory.cpp000066400000000000000000000021501414701001100257240ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "FileDialogAdapterFactory.h" IFileDialogAdapter *FileDialogAdapterFactory::create() { #if defined(UNIX_X11) if (PlatformChecker::instance()->isSnap()) { return new SnapFileDialogAdapter; } else { return new FileDialogAdapter; } #endif #if defined(_WIN32) || defined(__APPLE__) return new FileDialogAdapter; #endif } ksnip-1.9.2/src/common/adapter/fileDialog/FileDialogAdapterFactory.h000066400000000000000000000023111414701001100253700ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_FILEDIALOGADAPTERFACTORY_H #define KSNIP_FILEDIALOGADAPTERFACTORY_H #include "FileDialogAdapter.h" #if defined(UNIX_X11) #include "src/common/platform/PlatformChecker.h" #include "SnapFileDialogAdapter.h" #endif class FileDialogAdapterFactory { public: FileDialogAdapterFactory() = default; ~FileDialogAdapterFactory() = default; static IFileDialogAdapter* create(); }; #endif //KSNIP_FILEDIALOGADAPTERFACTORY_H ksnip-1.9.2/src/common/adapter/fileDialog/IFileDialogAdapter.h000066400000000000000000000026371414701001100241640ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_IFILEDIALOGADAPTER_H #define KSNIP_IFILEDIALOGADAPTER_H class IFileDialogAdapter { public: virtual ~IFileDialogAdapter() = default; virtual QString getExistingDirectory(QWidget *parent, const QString &title, const QString &directory) = 0; virtual QString getOpenFileName(QWidget *parent, const QString &title, const QString &directory) = 0; virtual QStringList getOpenFileNames(QWidget *parent, const QString &title, const QString &directory, const QString &filter) = 0; virtual QString getSavePath(QWidget *parent, const QString &title, const QString &path, const QString &filter) = 0; }; #endif //KSNIP_IFILEDIALOGADAPTER_H ksnip-1.9.2/src/common/adapter/fileDialog/SnapFileDialogAdapter.cpp000066400000000000000000000016351414701001100252250ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "SnapFileDialogAdapter.h" SnapFileDialogAdapter::SnapFileDialogAdapter() { addOption(QFileDialog::DontUseNativeDialog); } ksnip-1.9.2/src/common/adapter/fileDialog/SnapFileDialogAdapter.h000066400000000000000000000021021414701001100246600ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_SNAPFILEDIALOGADAPTER_H #define KSNIP_SNAPFILEDIALOGADAPTER_H #include "FileDialogAdapter.h" class SnapFileDialogAdapter : public FileDialogAdapter { public: explicit SnapFileDialogAdapter(); ~SnapFileDialogAdapter() override = default; }; #endif //KSNIP_SNAPFILEDIALOGADAPTER_H ksnip-1.9.2/src/common/constants/000077500000000000000000000000001414701001100167275ustar00rootroot00000000000000ksnip-1.9.2/src/common/constants/DefaultValues.h000066400000000000000000000020131414701001100216400ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_DEFAULTVALUES_H #define KSNIP_DEFAULTVALUES_H #include inline namespace DefaultValues { const QString ImgurBaseUrl = QStringLiteral("https://api.imgur.com"); } // namespace Constants #endif //KSNIP_DEFAULTVALUES_H ksnip-1.9.2/src/common/dtos/000077500000000000000000000000001414701001100156645ustar00rootroot00000000000000ksnip-1.9.2/src/common/dtos/CaptureDto.h000066400000000000000000000023041414701001100201060ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_CAPTUREDTO_H #define KSNIP_CAPTUREDTO_H #include "CursorDto.h" struct CaptureDto { QPixmap screenshot; CursorDto cursor; explicit CaptureDto() = default; explicit CaptureDto(const QPixmap &screenshot) { this->screenshot = screenshot.copy(); } virtual bool isValid() const { return !screenshot.isNull(); } bool isCursorValid() const { return cursor.isValid(); } }; #endif //KSNIP_CAPTUREDTO_H ksnip-1.9.2/src/common/dtos/CaptureFromFileDto.h000066400000000000000000000021741414701001100215370ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_CAPTUREFROMFILEDTO_H #define KSNIP_CAPTUREFROMFILEDTO_H #include "CaptureDto.h" #include "FilePathDto.h" struct CaptureFromFileDto : public CaptureDto, public FilePathDto { explicit CaptureFromFileDto(const QPixmap &screenshot, const QString &path) : CaptureDto(screenshot){ this->path = path; } }; #endif //KSNIP_CAPTUREFROMFILEDTO_H ksnip-1.9.2/src/common/dtos/CursorDto.h000066400000000000000000000022001414701001100177530ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_CURSORDTO_H #define KSNIP_CURSORDTO_H #include #include struct CursorDto { QPixmap image; QPoint position; CursorDto& operator =(const CursorDto& other) { image = other.image.copy(); position = other.position; return *this; } bool isValid() const { return !image.isNull(); } }; #endif //KSNIP_CURSORDTO_H ksnip-1.9.2/src/common/dtos/FilePathDto.h000066400000000000000000000016451414701001100202060ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_ABSTRACTFILEPATH_H #define KSNIP_ABSTRACTFILEPATH_H struct FilePathDto { QString path; }; #endif //KSNIP_ABSTRACTFILEPATH_H ksnip-1.9.2/src/common/dtos/RenameResultDto.h000066400000000000000000000021451414701001100211140ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_RENAMERESULTDTO_H #define KSNIP_RENAMERESULTDTO_H #include "FilePathDto.h" struct RenameResultDto : public FilePathDto { bool isSuccessful; explicit RenameResultDto(bool isSuccessful, const QString &path) { this->isSuccessful = isSuccessful; this->path = path; } }; #endif //KSNIP_RENAMERESULTDTO_H ksnip-1.9.2/src/common/dtos/SaveResultDto.h000066400000000000000000000021221414701001100205760ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_SAVERESULTDTO_H #define KSNIP_SAVERESULTDTO_H #include "FilePathDto.h" struct SaveResultDto : public FilePathDto { bool isSuccessful; explicit SaveResultDto(bool isSuccessful, const QString &path) { this->isSuccessful = isSuccessful; this->path = path; } }; #endif //KSNIP_SAVERESULTDTO_H ksnip-1.9.2/src/common/enum/000077500000000000000000000000001414701001100156575ustar00rootroot00000000000000ksnip-1.9.2/src/common/enum/CaptureModes.h000066400000000000000000000023431414701001100204250ustar00rootroot00000000000000/* * Copyright (C) 2017 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_CAPTUREMODES_H #define KSNIP_CAPTUREMODES_H #include #include #include enum class CaptureModes { RectArea, LastRectArea, FullScreen, CurrentScreen, ActiveWindow, WindowUnderCursor, Portal }; inline uint qHash(const CaptureModes captureMode, uint seed) { return qHash(static_cast(captureMode), seed); } Q_DECLARE_METATYPE(CaptureModes) #endif // KSNIP_CAPTUREMODES_H ksnip-1.9.2/src/common/enum/Environment.h000066400000000000000000000016651414701001100203440ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_ENVIRONMENT_H #define KSNIP_ENVIRONMENT_H enum class Environment { Gnome, KDE, Unknown }; #endif //KSNIP_ENVIRONMENT_H ksnip-1.9.2/src/common/enum/MessageBoxResponse.h000066400000000000000000000017041414701001100216060ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_MESSAGEBOXRESPONSE_H #define KSNIP_MESSAGEBOXRESPONSE_H enum class MessageBoxResponse { Yes, No, Cancel }; #endif //KSNIP_MESSAGEBOXRESPONSE_H ksnip-1.9.2/src/common/enum/NotificationTypes.h000066400000000000000000000017171414701001100215110ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_NOTIFICATIONTYPES_H #define KSNIP_NOTIFICATIONTYPES_H enum class NotificationTypes { Information, Warning, Critical }; #endif //KSNIP_NOTIFICATIONTYPES_H ksnip-1.9.2/src/common/enum/PackageManager.h000066400000000000000000000016731414701001100206650ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_PACKAGEMANAGER_H #define KSNIP_PACKAGEMANAGER_H enum class PackageManager { Snap, Flatpak, Unknown }; #endif //KSNIP_PACKAGEMANAGER_H ksnip-1.9.2/src/common/enum/Platform.h000066400000000000000000000016531414701001100176210ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_PLATFORM_H #define KSNIP_PLATFORM_H enum class Platform { X11, Wayland, Unknown }; #endif //KSNIP_PLATFORM_H ksnip-1.9.2/src/common/enum/RunMode.h000066400000000000000000000016261414701001100174060ustar00rootroot00000000000000/* * Copyright (C) 2018 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_RUNMODE_H #define KSNIP_RUNMODE_H enum class RunMode { GUI, CLI, Edit }; #endif //KSNIP_RUNMODE_H ksnip-1.9.2/src/common/enum/SaveQualityMode.h000066400000000000000000000017221414701001100211060ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_SAVEQUALITYMODE_H #define KSNIP_SAVEQUALITYMODE_H enum class SaveQualityMode { Default, Factor }; Q_DECLARE_METATYPE(SaveQualityMode) #endif //KSNIP_SAVEQUALITYMODE_H ksnip-1.9.2/src/common/enum/TrayIconDefaultActionMode.h000066400000000000000000000020101414701001100230210ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_TRAYICONDEFAULTACTIONMODE_H #define KSNIP_TRAYICONDEFAULTACTIONMODE_H enum class TrayIconDefaultActionMode { ShowEditor, Capture }; Q_DECLARE_METATYPE(TrayIconDefaultActionMode) #endif //KSNIP_TRAYICONDEFAULTACTIONMODE_H ksnip-1.9.2/src/common/enum/UploadStatus.h000066400000000000000000000021221414701001100204550ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_UPLOADSTATUS_H #define KSNIP_UPLOADSTATUS_H enum class UploadStatus { NoError, UnableToSaveTemporaryImage, FailedToStart, //### file not found, resource error Crashed, Timedout, ReadError, WriteError, WebError, UnknownError, ScriptWroteToStdErr }; #endif //KSNIP_UPLOADSTATUS_H ksnip-1.9.2/src/common/enum/UploaderType.h000066400000000000000000000017131414701001100204470ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_UPLOADERTYPE_H #define KSNIP_UPLOADERTYPE_H enum class UploaderType { Imgur, Script }; Q_DECLARE_METATYPE(UploaderType) #endif //KSNIP_UPLOADERTYPE_H ksnip-1.9.2/src/common/handler/000077500000000000000000000000001414701001100163305ustar00rootroot00000000000000ksnip-1.9.2/src/common/handler/DelayHandler.cpp000066400000000000000000000020301414701001100213630ustar00rootroot00000000000000/* * Copyright (C) 2018 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "DelayHandler.h" DelayHandler::DelayHandler() { mMinDelayInMs = 200; } int DelayHandler::getDelay(int delay) { return delay < mMinDelayInMs ? mMinDelayInMs : delay; } int DelayHandler::minDelayInMs() const { return mMinDelayInMs; } ksnip-1.9.2/src/common/handler/DelayHandler.h000066400000000000000000000020021414701001100210270ustar00rootroot00000000000000/* * Copyright (C) 2018 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_DELAYHANDLER_H #define KSNIP_DELAYHANDLER_H class DelayHandler { public: explicit DelayHandler(); int getDelay(int delay); int minDelayInMs() const; private: int mMinDelayInMs; }; #endif //KSNIP_DELAYHANDLER_H ksnip-1.9.2/src/common/helper/000077500000000000000000000000001414701001100161725ustar00rootroot00000000000000ksnip-1.9.2/src/common/helper/EnumTranslator.cpp000066400000000000000000000031331414701001100216540ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "EnumTranslator.h" EnumTranslator *EnumTranslator::instance() { static EnumTranslator instance; return &instance; } QString EnumTranslator::toString(CaptureModes captureMode) const { Q_ASSERT(mCaptureModeMap.contains(captureMode)); return mCaptureModeMap.value(captureMode); } EnumTranslator::EnumTranslator() { mCaptureModeMap[CaptureModes::RectArea] = tr("Rectangular Area"); mCaptureModeMap[CaptureModes::LastRectArea] = tr("Last Rectangular Area"); mCaptureModeMap[CaptureModes::FullScreen] = tr("Full Screen (All Monitors)"); mCaptureModeMap[CaptureModes::CurrentScreen] = tr("Current Screen"); mCaptureModeMap[CaptureModes::ActiveWindow] = tr("Active Window"); mCaptureModeMap[CaptureModes::WindowUnderCursor] = tr("Window Under Cursor"); mCaptureModeMap[CaptureModes::Portal] = tr("Screenshot Portal"); } ksnip-1.9.2/src/common/helper/EnumTranslator.h000066400000000000000000000022511414701001100213210ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_ENUMTRANSLATOR_H #define KSNIP_ENUMTRANSLATOR_H #include #include #include "src/common/enum/CaptureModes.h" class EnumTranslator : public QObject { Q_OBJECT public: static EnumTranslator *instance(); QString toString(CaptureModes captureMode) const; private: QHash mCaptureModeMap; EnumTranslator(); }; #endif //KSNIP_ENUMTRANSLATOR_H ksnip-1.9.2/src/common/helper/FileUrlHelper.cpp000066400000000000000000000023401414701001100213770ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "FileUrlHelper.h" QString FileUrlHelper::toPath(const QString &url) { auto path = url; return path.remove(filePrefix()); } QString FileUrlHelper::toFileUrl(const QString &path) { return filePrefix() + path; } QString FileUrlHelper::filePrefix() { #if defined(__APPLE__) return QLatin1String("file://"); #endif #if defined(UNIX_X11) return QLatin1String("file://"); #endif #if defined(_WIN32) return QLatin1String("file:///"); #endif } ksnip-1.9.2/src/common/helper/FileUrlHelper.h000066400000000000000000000020531414701001100210450ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_FILEURLHELPER_H #define KSNIP_FILEURLHELPER_H #include class FileUrlHelper { public: static QString toPath(const QString &url); static QString toFileUrl(const QString &path); private: static QString filePrefix(); }; #endif //KSNIP_FILEURLHELPER_H ksnip-1.9.2/src/common/helper/MathHelper.cpp000066400000000000000000000021211414701001100207230ustar00rootroot00000000000000/* * Copyright (C) 2017 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "MathHelper.h" int MathHelper::divideIntByReal(int integer, qreal real) { return static_cast((double)integer / real); } int MathHelper::multiplyIntWithReal(int integer, qreal real) { return static_cast((double)integer * real); } int MathHelper::randomInt() { return qrand(); } ksnip-1.9.2/src/common/helper/MathHelper.h000066400000000000000000000021271414701001100203760ustar00rootroot00000000000000/* * Copyright (C) 2017 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef MATHHELPER_H #define MATHHELPER_H #include #include #include #include class MathHelper { public: static int divideIntByReal(int integer, qreal real); static int multiplyIntWithReal(int integer, qreal real); static int randomInt(); }; #endif // MATHHELPER_H ksnip-1.9.2/src/common/helper/PathHelper.cpp000066400000000000000000000035001414701001100207300ustar00rootroot00000000000000/* * Copyright (C) 2017 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #include "PathHelper.h" bool PathHelper::isPathValid(const QString &path) { return !path.isNull() && !path.isEmpty(); } bool PathHelper::isPipePath(const QString &path) { return path == QLatin1String("-"); } bool PathHelper::isTempDirectory(const QString &path) { return path.startsWith(QDir::tempPath()); } QString PathHelper::extractParentDirectory(const QString& path) { return path.section(QLatin1Char('/'), 0, -2); } QString PathHelper::extractFilename(const QString& path) { auto filename = extractFilenameWithFormat(path); if (filename.contains(QLatin1Char('.'))) { return filename.section(QLatin1Char('.'), 0, -2); } else { return filename; } } QString PathHelper::extractFilenameWithFormat(const QString &path) { return path.section(QLatin1Char('/'), -1); } QString PathHelper::extractFormat(const QString& path) { auto filename = extractFilenameWithFormat(path); if (filename.contains(QLatin1Char('.'))) { return path.section(QLatin1Char('.'), -1); } else { return {}; } } ksnip-1.9.2/src/common/helper/PathHelper.h000066400000000000000000000025571414701001100204100ustar00rootroot00000000000000/* * Copyright (C) 2017 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef KSNIP_PATHHELPER_H #define KSNIP_PATHHELPER_H #include #include #include #include class PathHelper { public: static bool isPathValid(const QString &path); static bool isPipePath(const QString &path); static bool isTempDirectory(const QString &path); static QString extractParentDirectory(const QString &path); static QString extractFilename(const QString &path); static QString extractFilenameWithFormat(const QString &path); static QString extractFormat(const QString &path); }; #endif // KSNIP_PATHHELPER_H ksnip-1.9.2/src/common/helper/RectHelper.cpp000066400000000000000000000027601414701001100207400ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "RectHelper.h" QPointF RectHelper::topLeft(const QRectF &rect) { return rect.topLeft(); } QPointF RectHelper::top(const QRectF &rect) { return { rect.center().x(), rect.top() }; } QPointF RectHelper::topRight(const QRectF &rect) { return rect.topRight(); } QPointF RectHelper::right(const QRectF &rect) { return { rect.right(), rect.center().y() }; } QPointF RectHelper::bottomRight(const QRectF &rect) { return rect.bottomRight(); } QPointF RectHelper::bottom(const QRectF &rect) { return { rect.center().x(), rect.bottom() }; } QPointF RectHelper::bottomLeft(const QRectF &rect) { return rect.bottomLeft(); } QPointF RectHelper::left(const QRectF &rect) { return { rect.left(), rect.center().y() }; } ksnip-1.9.2/src/common/helper/RectHelper.h000066400000000000000000000025031414701001100204000ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_RECTHELPER_H #define KSNIP_RECTHELPER_H #include class RectHelper { public: static QPointF topLeft(const QRectF &rect); static QPointF top(const QRectF &rect); static QPointF topRight(const QRectF &rect); static QPointF right(const QRectF &rect); static QPointF bottomRight(const QRectF &rect); static QPointF bottom(const QRectF &rect); static QPointF bottomLeft(const QRectF &rect); static QPointF left(const QRectF &rect); protected: RectHelper() = default; ~RectHelper() = default; }; #endif //KSNIP_RECTHELPER_H ksnip-1.9.2/src/common/loader/000077500000000000000000000000001414701001100161615ustar00rootroot00000000000000ksnip-1.9.2/src/common/loader/IconLoader.cpp000066400000000000000000000026511414701001100207100ustar00rootroot00000000000000/* * Copyright (C) 2017 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "IconLoader.h" QIcon IconLoader::load(const QString &name) { return QIcon(QLatin1String(":/icons/") + name); } QIcon IconLoader::loadForTheme(const QString& name) { auto type = getThemePrefix(); return QIcon(QLatin1String(":/icons/") + type + name); } QString IconLoader::getThemePrefix() { return isDarkTheme() ? QLatin1String("dark/") : QLatin1String("light/"); } double IconLoader::getThemeLuma() { auto color = QApplication::palette().background().color(); return 0.2126 * color.redF() + 0.7152 * color.greenF() + 0.0722 * color.blueF(); } bool IconLoader::isDarkTheme() { return getThemeLuma() > 0.4; } ksnip-1.9.2/src/common/loader/IconLoader.h000066400000000000000000000023071414701001100203530ustar00rootroot00000000000000/* * Copyright (C) 2017 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_ICONLOADER_H #define KSNIP_ICONLOADER_H #include #include #include class IconLoader { public: static QIcon load(const QString& name); static QIcon loadForTheme(const QString& name); private: IconLoader() = default; ~IconLoader() = default; static bool isDarkTheme(); static QString getThemePrefix(); static double getThemeLuma(); }; #endif // KSNIP_ICONLOADER_H ksnip-1.9.2/src/common/platform/000077500000000000000000000000001414701001100165375ustar00rootroot00000000000000ksnip-1.9.2/src/common/platform/CommandRunner.cpp000066400000000000000000000021131414701001100220100ustar00rootroot00000000000000/* * Copyright (C) 2017 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "CommandRunner.h" QString CommandRunner::getEnvironmentVariable(const QString& variable) const { return qgetenv(variable.toLatin1()); } bool CommandRunner::isEnvironmentVariableSet(const QString &variable) const { return QProcessEnvironment::systemEnvironment().contains(variable); } ksnip-1.9.2/src/common/platform/CommandRunner.h000066400000000000000000000020741414701001100214630ustar00rootroot00000000000000/* * Copyright (C) 2017 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef COMMANDRUNNER_H #define COMMANDRUNNER_H #include #include class CommandRunner { public: QString getEnvironmentVariable(const QString &variable) const; bool isEnvironmentVariableSet(const QString &variable) const; }; #endif // COMMANDRUNNER_H ksnip-1.9.2/src/common/platform/HdpiScaler.cpp000066400000000000000000000031761414701001100212700ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "HdpiScaler.h" QRect HdpiScaler::unscale(const QRect &rect) const { auto factor = scaleFactor(); return { static_cast(rect.x() / factor), static_cast(rect.y() / factor), static_cast(rect.width() / factor), static_cast(rect.height() / factor) }; } QRect HdpiScaler::scale(const QRect &rect) const { auto factor = scaleFactor(); return { static_cast(rect.x() * factor), static_cast(rect.y() * factor), static_cast(rect.width() * factor), static_cast(rect.height() * factor) }; } qreal HdpiScaler::scaleFactor() const { auto desktopWidget = QApplication::desktop(); #if defined(__APPLE__) auto myWindow = QGuiApplication::topLevelWindows().first(); return myWindow->devicePixelRatio(); #endif #if defined(UNIX_X11) || defined(_WIN32) return desktopWidget->devicePixelRatioF(); #endif } ksnip-1.9.2/src/common/platform/HdpiScaler.h000066400000000000000000000022411414701001100207250ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_HDPISCALER_H #define KSNIP_HDPISCALER_H #include #include #include #include #include class HdpiScaler { public: HdpiScaler() = default; ~HdpiScaler() = default; QRect unscale(const QRect &rect) const; QRect scale(const QRect &rect) const; qreal scaleFactor() const; }; #endif //KSNIP_HDPISCALER_H ksnip-1.9.2/src/common/platform/PlatformChecker.cpp000066400000000000000000000070201414701001100223130ustar00rootroot00000000000000/* * Copyright (C) 2017 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "PlatformChecker.h" PlatformChecker* PlatformChecker::instance() { static PlatformChecker instance; return &instance; } bool PlatformChecker::isX11() const { return mPlatform == Platform::X11; } bool PlatformChecker::isWayland() const { return mPlatform == Platform::Wayland; } bool PlatformChecker::isKde() const { return mEnvironment == Environment::KDE; } bool PlatformChecker::isGnome() const { return mEnvironment == Environment::Gnome; } bool PlatformChecker::isSnap() const { return mPackageManager == PackageManager::Snap; } int PlatformChecker::gnomeVersion() const { return mGnomeVersion; } void PlatformChecker::checkPlatform() { CommandRunner runner; auto output = runner.getEnvironmentVariable(QLatin1String("XDG_SESSION_TYPE")); if (outputContainsValue(output, QLatin1String("x11"))) { mPlatform = Platform::X11; } else if (outputContainsValue(output, QLatin1String("wayland"))) { mPlatform = Platform::Wayland; } else { mPlatform = Platform::Unknown; } } void PlatformChecker::checkEnvironment() { CommandRunner runner; auto output = runner.getEnvironmentVariable(QLatin1String("XDG_CURRENT_DESKTOP")); if (outputContainsValue(output, QLatin1String("kde"))) { mEnvironment = Environment::KDE; } else if (outputContainsValue(output, QLatin1String("gnome")) || outputContainsValue(output, QLatin1String("unity"))) { mEnvironment = Environment::Gnome; } else { mEnvironment = Environment::Unknown; } } void PlatformChecker::checkCheckPackageManager() { CommandRunner runner; if (runner.isEnvironmentVariableSet(QLatin1String("SNAP"))) { mPackageManager = PackageManager::Snap; } else { mPackageManager = PackageManager::Unknown; } } bool PlatformChecker::outputContainsValue(const QString& output, const QString& value) const { return output.contains(value.toLatin1(), Qt::CaseInsensitive); } PlatformChecker::PlatformChecker() : mEnvironment(Environment::Unknown), mPlatform(Platform::Unknown), mPackageManager(PackageManager::Unknown), mGnomeVersion(-1) { checkPlatform(); checkEnvironment(); checkCheckPackageManager(); checkVersion(); } void PlatformChecker::checkVersion() { if(isGnome()) { QFile gnomeVersionFile("/usr/share/gnome/gnome-version.xml"); if (gnomeVersionFile.open(QFile::ReadOnly | QFile::Text)) { QTextStream inputStream(&gnomeVersionFile); QRegularExpression regex("(.+?)"); bool isParseSuccessful; auto value = regex.match(inputStream.readAll()).captured(1).toInt(&isParseSuccessful); if(isParseSuccessful) { mGnomeVersion = value; } } } } ksnip-1.9.2/src/common/platform/PlatformChecker.h000066400000000000000000000032721414701001100217650ustar00rootroot00000000000000/* * Copyright (C) 2017 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_PLATFORMCHECKER_H #define KSNIP_PLATFORMCHECKER_H #include #include "QFile" #include "QTextStream" #include "QRegularExpression" #include "CommandRunner.h" #include "src/common/enum/Platform.h" #include "src/common/enum/Environment.h" #include "src/common/enum/PackageManager.h" class PlatformChecker { public: static PlatformChecker *instance(); bool isX11() const; bool isWayland() const; bool isKde() const; bool isGnome() const; bool isSnap() const; int gnomeVersion() const; private: Platform mPlatform; Environment mEnvironment; PackageManager mPackageManager; int mGnomeVersion; void checkPlatform(); void checkEnvironment(); void checkCheckPackageManager(); bool outputContainsValue(const QString& output, const QString& value) const; void checkVersion(); PlatformChecker(); }; #endif // KSNIP_PLATFORMCHECKER_H ksnip-1.9.2/src/common/provider/000077500000000000000000000000001414701001100165455ustar00rootroot00000000000000ksnip-1.9.2/src/common/provider/ApplicationTitleProvider.cpp000066400000000000000000000024241414701001100242330ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "ApplicationTitleProvider.h" QString ApplicationTitleProvider::getApplicationTitle(const QString &applicationName, const QString &pathToImage, const QString &unsavedString, bool isUnsaved) { auto applicationTitle = applicationName; if(!pathToImage.isEmpty()) { applicationTitle = applicationTitle + QLatin1String(" [") + pathToImage + QLatin1String("]"); } if (isUnsaved) { applicationTitle = QLatin1String("*") + applicationTitle + " - " + unsavedString; } return applicationTitle; } ksnip-1.9.2/src/common/provider/ApplicationTitleProvider.h000066400000000000000000000021451414701001100237000ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_APPLICATIONTITLEPROVIDER_H #define KSNIP_APPLICATIONTITLEPROVIDER_H #include class ApplicationTitleProvider { public: static QString getApplicationTitle(const QString &applicationName, const QString &pathToImage, const QString &unsavedString, bool isUnsaved); }; #endif //KSNIP_APPLICATIONTITLEPROVIDER_H ksnip-1.9.2/src/common/provider/DirectoryPathProvider.cpp000066400000000000000000000021121414701001100235410ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "DirectoryPathProvider.h" QString DirectoryPathProvider::home() { #if defined(UNIX_X11) if (PlatformChecker::instance()->isSnap()) { return qgetenv("SNAP_REAL_HOME"); } else { return QDir::homePath(); } #endif #if defined(_WIN32) || defined(__APPLE__) return QDir::homePath(); #endif } ksnip-1.9.2/src/common/provider/DirectoryPathProvider.h000066400000000000000000000022021414701001100232060ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_DIRECTORYPATHPROVIDER_H #define KSNIP_DIRECTORYPATHPROVIDER_H #include #if defined(UNIX_X11) #include "src/common/platform/PlatformChecker.h" #endif class DirectoryPathProvider { public: static QString home(); private: DirectoryPathProvider() = default; ~DirectoryPathProvider() = default; }; #endif //KSNIP_DIRECTORYPATHPROVIDER_H ksnip-1.9.2/src/common/provider/NewCaptureNameProvider.cpp000066400000000000000000000023021414701001100236370ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "NewCaptureNameProvider.h" NewCaptureNameProvider::NewCaptureNameProvider() : mCaptureNumber(1) { } QString NewCaptureNameProvider::nextName(const QString &path) { auto isPathSet = PathHelper::isPathValid(path); return isPathSet ? PathHelper::extractFilename(path) : getNewName(); } QString NewCaptureNameProvider::getNewName() { return tr("Capture") + QLatin1String(" ") + QString::number(mCaptureNumber++); } ksnip-1.9.2/src/common/provider/NewCaptureNameProvider.h000066400000000000000000000023211414701001100233050ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_NEWCAPTURENAMEPROVIDER_H #define KSNIP_NEWCAPTURENAMEPROVIDER_H #include #include #include "src/common/helper/PathHelper.h" class NewCaptureNameProvider : public QObject { Q_OBJECT public: NewCaptureNameProvider(); ~NewCaptureNameProvider() override = default; QString nextName(const QString &path); private: int mCaptureNumber; QString getNewName(); }; #endif //KSNIP_NEWCAPTURENAMEPROVIDER_H ksnip-1.9.2/src/common/provider/PathFromCaptureProvider.cpp000066400000000000000000000020511414701001100240260ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "PathFromCaptureProvider.h" QString PathFromCaptureProvider::pathFrom(const CaptureDto &capture) const { auto captureFromFileDto = dynamic_cast(&capture); return captureFromFileDto != nullptr ? captureFromFileDto->path : QString(); } ksnip-1.9.2/src/common/provider/PathFromCaptureProvider.h000066400000000000000000000022051414701001100234740ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_PATHFROMCAPTUREPROVIDER_H #define KSNIP_PATHFROMCAPTUREPROVIDER_H #include #include "src/common/dtos/CaptureFromFileDto.h" class PathFromCaptureProvider { public: PathFromCaptureProvider() = default; ~PathFromCaptureProvider() = default; QString pathFrom(const CaptureDto &capture) const; }; #endif //KSNIP_PATHFROMCAPTUREPROVIDER_H ksnip-1.9.2/src/common/provider/ScaledSizeProvider.cpp000066400000000000000000000031251414701001100230130ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "ScaledSizeProvider.h" #if defined(UNIX_X11) #include #include #endif QSize ScaledSizeProvider::scaledSize(const QSize &size) { return size * scaleFactor(); } int ScaledSizeProvider::scaledWidth(int width) { return static_cast(width * scaleFactor()); } qreal ScaledSizeProvider::scaleFactor() { static auto scaleFactor = getScaleFactor(); return scaleFactor; } qreal ScaledSizeProvider::getScaleFactor() { #if defined(UNIX_X11) auto platformChecker = PlatformChecker::instance(); if(platformChecker->isGnome()) { auto screen = QApplication::primaryScreen(); auto logicalDotsPerInch = (int) screen->logicalDotsPerInch(); auto physicalDotsPerInch = (int) screen->physicalDotsPerInch(); return (qreal)logicalDotsPerInch / (qreal)physicalDotsPerInch; } #endif return 1; } ksnip-1.9.2/src/common/provider/ScaledSizeProvider.h000066400000000000000000000022071414701001100224600ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_SCALEDSIZEPROVIDER_H #define KSNIP_SCALEDSIZEPROVIDER_H #include #include "src/common/platform/PlatformChecker.h" class ScaledSizeProvider { public: static QSize scaledSize(const QSize &size); static int scaledWidth(int width); private: static qreal scaleFactor(); static qreal getScaleFactor(); }; #endif //KSNIP_SCALEDSIZEPROVIDER_H ksnip-1.9.2/src/common/provider/TempFileProvider.cpp000066400000000000000000000021421414701001100224700ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "TempFileProvider.h" QString TempFileProvider::tempFile() { QTemporaryFile file(QDir::tempPath() + QDir::separator() + QLatin1String("ksnip_tmp_XXXXXX.png")); file.setAutoRemove(false); if (!file.open()) { qWarning("Failed to created temporary file %s", qPrintable(file.fileName())); } return file.fileName(); } ksnip-1.9.2/src/common/provider/TempFileProvider.h000066400000000000000000000020631414701001100221370ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_TEMPFILEPROVIDER_H #define KSNIP_TEMPFILEPROVIDER_H #include #include class TempFileProvider { public: static QString tempFile(); private: TempFileProvider() = default; ~TempFileProvider() = default; }; #endif //KSNIP_TEMPFILEPROVIDER_H ksnip-1.9.2/src/gui/000077500000000000000000000000001414701001100142075ustar00rootroot00000000000000ksnip-1.9.2/src/gui/IImageProcessor.h000066400000000000000000000020771414701001100174210ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_IIMAGEPROCESSOR_H #define KSNIP_IIMAGEPROCESSOR_H #include "src/common/dtos/CaptureDto.h" class IImageProcessor { public: IImageProcessor() = default; ~IImageProcessor() = default; virtual void processImage(const CaptureDto &capture) = 0; }; #endif //KSNIP_IIMAGEPROCESSOR_H ksnip-1.9.2/src/gui/IToastService.h000066400000000000000000000023331414701001100171050ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_ITOASTSERVICE_H #define KSNIP_ITOASTSERVICE_H class IToastService { public: virtual void showInfoToast(const QString &title, const QString &message, const QString &contentUrl) = 0; virtual void showWarningToast(const QString &title, const QString &message, const QString &contentUrl) = 0; virtual void showCriticalToast(const QString &title, const QString &message, const QString &contentUrl) = 0; }; #endif //KSNIP_ITOASTSERVICE_H ksnip-1.9.2/src/gui/ImgurHistoryDialog.cpp000066400000000000000000000053271414701001100205070ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "ImgurHistoryDialog.h" ImgurHistoryDialog::ImgurHistoryDialog() { setWindowTitle(QApplication::applicationName() + QLatin1String(" - ") + tr("Imgur History")); setMinimumWidth(650); setMinimumHeight(400); ImgurResponseLogger imgurResponseLogger; auto logEntries = imgurResponseLogger.getLogs(); createTable(logEntries.count()); populateTable(logEntries); mCloseButton = new QPushButton(tr("Close")); connect(mCloseButton, &QPushButton::clicked, this, &QDialog::close); mLayout = new QVBoxLayout; mLayout->addWidget(mTableWidget); mLayout->addWidget(mCloseButton); mLayout->setAlignment(Qt::AlignRight); setLayout(mLayout); } ImgurHistoryDialog::~ImgurHistoryDialog() { delete mTableWidget; delete mLayout; delete mCloseButton; } void ImgurHistoryDialog::createTable(int rowCount) { mTableWidget = new QTableWidget(rowCount, 3, this); mTableWidget->setHorizontalHeaderLabels(QStringList{ tr("Time Stamp"), tr("Link"), tr("Delete Link") }); auto header = mTableWidget->horizontalHeader(); header->setStretchLastSection(true); connect(mTableWidget, &QTableWidget::cellClicked, this, &ImgurHistoryDialog::cellClicked); } void ImgurHistoryDialog::populateTable(const QStringList &logEntries) { for (const auto &entry : logEntries) { addEntryToTable(entry, logEntries.indexOf(entry)); } mTableWidget->resizeColumnsToContents(); } void ImgurHistoryDialog::addEntryToTable(const QString &entry, int row) const { auto cells = entry.split(QLatin1String(",")); auto dateCell = new QTableWidgetItem(cells[0]); auto linkCell = new QTableWidgetItem(cells[1]); auto deleteLinkCell = new QTableWidgetItem(cells[2]); mTableWidget->setItem(row, 0, dateCell); mTableWidget->setItem(row, 1, linkCell); mTableWidget->setItem(row, 2, deleteLinkCell); } void ImgurHistoryDialog::cellClicked(int row, int column) const { if (column == 1 || column == 2) { auto cell = mTableWidget->item(row, column); QDesktopServices::openUrl(cell->text()); } } ksnip-1.9.2/src/gui/ImgurHistoryDialog.h000066400000000000000000000030421414701001100201440ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_IMGURHISTORYDIALOG_H #define KSNIP_IMGURHISTORYDIALOG_H #include #include #include #include #include #include #include #include #include "src/backend/uploader/imgur/ImgurResponseLogger.h" class ImgurHistoryDialog : public QDialog { Q_OBJECT public: explicit ImgurHistoryDialog(); ~ImgurHistoryDialog() override; private: QVBoxLayout *mLayout; QTableWidget *mTableWidget; QPushButton *mCloseButton; void addEntryToTable(const QString &entry, int row) const; void populateTable(const QStringList &logEntries); void createTable(int rowCount); private slots: void cellClicked(int row, int column) const; }; #endif //KSNIP_IMGURHISTORYDIALOG_H ksnip-1.9.2/src/gui/MainWindow.cpp000066400000000000000000000636761414701001100170110ustar00rootroot00000000000000/* * Copyright (C) 2016 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #include "MainWindow.h" MainWindow::MainWindow(AbstractImageGrabber *imageGrabber, RunMode mode) : QMainWindow(), mToolBar(nullptr), mImageGrabber(imageGrabber), mServiceLocator(new ServiceLocator), mMode(mode), mImageAnnotator(new KImageAnnotatorAdapter), mSaveAsAction(new QAction(this)), mUploadAction(new QAction(this)), mCopyAsDataUriAction(new QAction(this)), mPrintAction(new QAction(this)), mPrintPreviewAction(new QAction(this)), mQuitAction(new QAction(this)), mCopyPathAction(new QAction(this)), mRenameAction(new QAction(this)), mOpenDirectoryAction(new QAction(this)), mToggleDocksAction(new QAction(this)), mSettingsAction(new QAction(this)), mAboutAction(new QAction(this)), mOpenImageAction(new QAction(this)), mScaleAction(new QAction(this)), mRotateAction(new QAction(this)), mAddWatermarkAction(new QAction(this)), mPasteAction(new QAction(this)), mPasteEmbeddedAction(new QAction(this)), mPinAction(new QAction(this)), mRemoveImageAction(new QAction(this)), mModifyCanvasAction(new QAction(this)), mMainLayout(layout()), mConfig(KsnipConfigProvider::instance()), mActionsMenu(new ActionsMenu(mConfig)), mRecentImagesMenu(new RecentImagesMenu(mServiceLocator->recentImageService(), this)), mClipboard(mServiceLocator->clipboard()), mCapturePrinter(new CapturePrinter(this)), mGlobalHotKeyHandler(new GlobalHotKeyHandler(mImageGrabber->supportedCaptureModes())), mTrayIcon(new TrayIcon(this)), mDragAndDropProcessor(new DragAndDropProcessor(this)), mUploaderProvider(new UploaderProvider), mSessionManagerRequestedQuit(false), mCaptureHandler(CaptureHandlerFactory::create(mImageAnnotator, NotificationServiceFactory::create(mTrayIcon), mServiceLocator, this)), mPinWindowHandler(new PinWindowHandler(this)), mVisibilityHandler(WidgetVisibilityHandlerFactory::create(this)), mFileDialog(FileDialogAdapterFactory::create()), mWindowResizer(new WindowResizer(this, mConfig, this)), mActionProcessor(new ActionProcessor) { // When we run in CLI only mode we don't need to setup gui, but only need // to connect imagegrabber signals to mainwindow slots to handle the // feedback. if (mMode == RunMode::CLI) { connect(mImageGrabber, &AbstractImageGrabber::finished, this, &MainWindow::processInstantCapture); connect(mImageGrabber, &AbstractImageGrabber::canceled, this, &MainWindow::close); return; } initGui(); setWindowIcon(IconLoader::load(QLatin1String("ksnip"))); setPosition(); auto coreApplication = dynamic_cast(QCoreApplication::instance()); connect(coreApplication, &QGuiApplication::commitDataRequest, this, &MainWindow::sessionFinished); setAcceptDrops(true); coreApplication->installEventFilter(mDragAndDropProcessor); connect(mDragAndDropProcessor, &DragAndDropProcessor::fileDropped, this, &MainWindow::loadImageFromFile); connect(mDragAndDropProcessor, &DragAndDropProcessor::imageDropped, this, &MainWindow::loadImageFromPixmap); connect(mConfig, &KsnipConfig::annotatorConfigChanged, this, &MainWindow::setupImageAnnotator); connect(mImageGrabber, &AbstractImageGrabber::finished, this, &MainWindow::processCapture); connect(mImageGrabber, &AbstractImageGrabber::canceled, this, &MainWindow::captureCanceled); connect(mGlobalHotKeyHandler, &GlobalHotKeyHandler::captureTriggered, this, &MainWindow::triggerCapture); connect(mGlobalHotKeyHandler, &GlobalHotKeyHandler::actionTriggered, this, &MainWindow::actionTriggered); connect(mUploaderProvider, &UploaderProvider::finished, this, &MainWindow::uploadFinished); connect(mRecentImagesMenu, &RecentImagesMenu::openRecentSelected, this, &MainWindow::loadImageFromFile); connect(this, &MainWindow::imageLoaded, mActionProcessor, &ActionProcessor::captureFinished); connect(mImageGrabber, &AbstractImageGrabber::canceled, mActionProcessor, &ActionProcessor::captureCanceled); connect(mActionProcessor, &ActionProcessor::triggerCapture, this, &MainWindow::capture); connect(mActionProcessor, &ActionProcessor::triggerPinImage, mPinAction, &QAction::trigger); connect(mActionProcessor, &ActionProcessor::triggerUpload, mUploadAction, &QAction::trigger); connect(mActionProcessor, &ActionProcessor::triggerOpenDirectory, mCaptureHandler, &ICaptureHandler::openDirectory); connect(mActionProcessor, &ActionProcessor::triggerCopyToClipboard, mToolBar->copyToClipboardAction(), &QAction::trigger); connect(mActionProcessor, &ActionProcessor::triggerSave, mToolBar->saveAction(), &QAction::trigger); connect(mActionProcessor, &ActionProcessor::triggerShow, this, &MainWindow::showAfterAction); mCaptureHandler->addListener(this); handleGuiStartup(); setupImageAnnotator(); resize(minimumSize()); loadSettings(); } MainWindow::~MainWindow() { delete mImageAnnotator; delete mUploadAction; delete mCopyAsDataUriAction; delete mPrintAction; delete mPrintPreviewAction; delete mQuitAction; delete mCopyPathAction; delete mRenameAction; delete mOpenDirectoryAction; delete mToggleDocksAction; delete mSettingsAction; delete mAboutAction; delete mOpenImageAction; delete mScaleAction; delete mRotateAction; delete mAddWatermarkAction; delete mSaveAsAction; delete mModifyCanvasAction; delete mCapturePrinter; delete mTrayIcon; delete mDragAndDropProcessor; delete mUploaderProvider; delete mCaptureHandler; delete mVisibilityHandler; delete mFileDialog; delete mWindowResizer; delete mActionProcessor; delete mActionsMenu; } void MainWindow::handleGuiStartup() { if (mMode == RunMode::GUI) { if (mConfig->captureOnStartup()) { triggerCapture(mConfig->captureMode()); } else if (mTrayIcon->isVisible() && mConfig->startMinimizedToTray()) { showHidden(); } else { showEmpty(); } } } void MainWindow::setPosition() { auto position = mConfig->windowPosition(); auto screenGeometry = QApplication::desktop()->screenGeometry(); if(!screenGeometry.contains(position)) { auto screenCenter = screenGeometry.center(); auto mainWindowSize = size(); position = QPoint(screenCenter.x() - mainWindowSize.width() / 2, screenCenter.y() - mainWindowSize.height() / 2); } move(position); } void MainWindow::processInstantCapture(const CaptureDto &capture) { mCaptureHandler->load(capture); mCaptureHandler->save(); mImageAnnotator->close(); close(); } void MainWindow::captureScreenshot(CaptureModes captureMode, bool captureCursor, int delay) { mImageGrabber->grabImage(captureMode, captureCursor, delay); } void MainWindow::quit() { if(!mCaptureHandler->canClose()){ return; } mTrayIcon->hide(); QCoreApplication::exit(0); } void MainWindow::processCapture(const CaptureDto &capture) { if (!capture.isValid()) { auto title = tr("Unable to show image"); auto message = tr("No image provided but one was expected."); NotifyOperation operation(mTrayIcon, title, message, NotificationTypes::Critical); operation.execute(); showEmpty(); return; } processImage(capture); capturePostProcessing(); } void MainWindow::processImage(const CaptureDto &capture) { mCaptureHandler->load(capture); if (!mActionProcessor->isActionInProgress()) { // The action processor handles the showing of the main window showDefault(); } captureChanged(); setEnablements(true); emit imageLoaded(); } DragContent MainWindow::dragContent() const { return DragContent(mCaptureHandler->image(), mCaptureHandler->path(), mCaptureHandler->isSaved()); } void MainWindow::resizeToContent() { if(!mToolBar->isCollapsed() || mImageAnnotator->isVisible()) { mMainLayout->setSizeConstraint(QLayout::SetFixedSize); // Workaround that allows us to return to toolbar only size QMainWindow::adjustSize(); } else { setFixedSize(menuBar()->sizeHint()); } mMainLayout->setSizeConstraint(QLayout::SetMinAndMaxSize); setMinimumSize(minimumSizeHint()); // Workaround for issue #588 } bool MainWindow::isWindowMaximized() { return mVisibilityHandler->isMaximized(); } void MainWindow::capturePostProcessing() { if (mConfig->autoCopyToClipboardNewCaptures()) { copyCaptureToClipboard(); } if (mConfig->autoSaveNewCaptures()) { mCaptureHandler->save(); } } void MainWindow::showEmpty() { mVisibilityHandler->show(); captureChanged(); setEnablements(false); } void MainWindow::showHidden() { captureChanged(); setEnablements(false); mVisibilityHandler->hide(); } void MainWindow::showDefault() { auto enforceVisible = mConfig->showMainWindowAfterTakingScreenshotEnabled(); enforceVisible ? mVisibilityHandler->enforceVisible() : mVisibilityHandler->restoreState(); mWindowResizer->resize(); } QMenu* MainWindow::createPopupMenu() { // Filtering out the option to hide main toolbar which should no be allowed. auto filteredMenu = QMainWindow::createPopupMenu(); filteredMenu->removeAction(mToolBar->toggleViewAction()); return filteredMenu; } QSize MainWindow::sizeHint() const { auto minHeight = mToolBar->sizeHint().height(); auto minWidth = mToolBar->sizeHint().width(); auto annotatorSize = mImageAnnotator->sizeHint(); auto height = minHeight + annotatorSize.height(); auto width = minWidth > annotatorSize.width() ? minWidth : annotatorSize.width(); return { width, height }; } void MainWindow::moveEvent(QMoveEvent* event) { mConfig->setWindowPosition(pos()); QWidget::moveEvent(event); } void MainWindow::closeEvent(QCloseEvent* event) { if (!mSessionManagerRequestedQuit) { event->ignore(); } if (mTrayIcon->isVisible() && mConfig->closeToTray()) { mVisibilityHandler->hide(); } else { quit(); } } void MainWindow::changeEvent(QEvent *event) { if (event->type() == QEvent::WindowStateChange) { if(isMinimized() && mTrayIcon->isVisible() && mConfig->minimizeToTray()) { event->ignore(); mVisibilityHandler->hide(); } mVisibilityHandler->updateState(); } QWidget::changeEvent(event); } void MainWindow::captureChanged() { mToolBar->setSaveActionEnabled(!mCaptureHandler->isSaved()); mCopyPathAction->setEnabled(mCaptureHandler->isPathValid()); mRenameAction->setEnabled(mCaptureHandler->isPathValid()); mOpenDirectoryAction->setEnabled(mCaptureHandler->isPathValid()); mRemoveImageAction->setEnabled(mCaptureHandler->isPathValid()); updateApplicationTitle(); } void MainWindow::updateApplicationTitle() { auto path = mCaptureHandler->path(); auto isUnsaved = !mCaptureHandler->isSaved(); auto applicationTitle = ApplicationTitleProvider::getApplicationTitle(QApplication::applicationName(), path, tr("Unsaved"), isUnsaved); setWindowTitle(applicationTitle); } void MainWindow::setEnablements(bool enabled) { mPrintAction->setEnabled(enabled); mPrintPreviewAction->setEnabled(enabled); mUploadAction->setEnabled(enabled); mCopyAsDataUriAction->setEnabled(enabled); mScaleAction->setEnabled(enabled); mRotateAction->setEnabled(enabled); mAddWatermarkAction->setEnabled(enabled); mToolBar->setCopyActionEnabled(enabled); mToolBar->setCropEnabled(enabled); mSaveAsAction->setEnabled(enabled); mPinAction->setEnabled(enabled); mPasteEmbeddedAction->setEnabled(mClipboard->isPixmap() && mImageAnnotator->isVisible()); mRenameAction->setEnabled(enabled); mModifyCanvasAction->setEnabled(enabled); mActionProcessor->setPostProcessingEnabled(enabled); } void MainWindow::loadSettings() { mToolBar->selectCaptureMode(mConfig->captureMode()); mToolBar->setCaptureDelay(mConfig->captureDelay() / 1000); if(mConfig->autoHideDocks()) { toggleDocks(); } } void MainWindow::triggerCapture(CaptureModes captureMode) { if(!mCaptureHandler->canTakeNew()){ return; } mConfig->setCaptureMode(captureMode); capture(captureMode, mConfig->captureCursor(), mConfig->captureDelay()); } void MainWindow::capture(CaptureModes captureMode, bool captureCursor, int delay) { hideMainWindowIfRequired(); captureScreenshot(captureMode, captureCursor, delay); } void MainWindow::hideMainWindowIfRequired() { if (mConfig->hideMainWindowDuringScreenshot()) { mVisibilityHandler->makeInvisible(); } } void MainWindow::toggleDocks() { auto newIsCollapsedState = !mToolBar->isCollapsed(); mToolBar->setCollapsed(newIsCollapsedState); mImageAnnotator->setSettingsCollapsed(newIsCollapsedState); auto collapsedToggleText = newIsCollapsedState ? tr("Show Docks") : tr("Hide Docks"); mToggleDocksAction->setText(collapsedToggleText); mWindowResizer->resize(); } void MainWindow::initGui() { mToolBar = new MainToolBar(mImageGrabber->supportedCaptureModes(), mImageAnnotator->undoAction(), mImageAnnotator->redoAction()); connect(mToolBar, &MainToolBar::captureModeSelected, this, &MainWindow::triggerCapture); connect(mToolBar, &MainToolBar::saveActionTriggered, this, &MainWindow::saveClicked); connect(mToolBar, &MainToolBar::copyActionTriggered, this, &MainWindow::copyCaptureToClipboard); connect(mToolBar, &MainToolBar::captureDelayChanged, this, &MainWindow::captureDelayChanged); connect(mToolBar, &MainToolBar::cropActionTriggered, mImageAnnotator, &IImageAnnotator::showCropper); mSaveAsAction->setText(tr("Save As...")); mSaveAsAction->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_S); mSaveAsAction->setIcon(IconLoader::loadForTheme(QLatin1String("saveAs"))); connect(mSaveAsAction, &QAction::triggered, this, &MainWindow::saveAsClicked); mUploadAction->setText(tr("Upload")); mUploadAction->setToolTip(tr("Upload triggerCapture to external source")); mUploadAction->setShortcut(Qt::SHIFT + Qt::Key_U); connect(mUploadAction, &QAction::triggered, this, &MainWindow::upload); mCopyAsDataUriAction->setText(tr("Copy as data URI")); mCopyAsDataUriAction->setToolTip(tr("Copy triggerCapture to system clipboard")); connect(mCopyAsDataUriAction, &QAction::triggered, this, &MainWindow::copyAsDataUri); mPrintAction->setText(tr("Print")); mPrintAction->setToolTip(tr("Opens printer dialog and provide option to print image")); mPrintAction->setShortcut(Qt::CTRL + Qt::Key_P); mPrintAction->setIcon(QIcon::fromTheme(QLatin1String("document-print"))); connect(mPrintAction, &QAction::triggered, this, &MainWindow::printClicked); mPrintPreviewAction->setText(tr("Print Preview")); mPrintPreviewAction->setToolTip(tr("Opens Print Preview dialog where the image " "orientation can be changed")); mPrintPreviewAction->setIcon(QIcon::fromTheme(QLatin1String("document-print-preview"))); connect(mPrintPreviewAction, &QAction::triggered, this, &MainWindow::printPreviewClicked); mScaleAction->setText(tr("Scale")); mScaleAction->setToolTip(tr("Scale Image")); mScaleAction->setShortcut(Qt::SHIFT + Qt::Key_S); connect(mScaleAction, &QAction::triggered, this, &MainWindow::showScaleDialog); mRotateAction->setText(tr("Rotate")); mRotateAction->setToolTip(tr("Rotate Image")); mRotateAction->setShortcut(Qt::SHIFT + Qt::Key_O); connect(mRotateAction, &QAction::triggered, this, &MainWindow::showRotateDialog); mAddWatermarkAction->setText(tr("Add Watermark")); mAddWatermarkAction->setToolTip(tr("Add Watermark to captured image. Multiple watermarks can be added.")); mAddWatermarkAction->setShortcut(Qt::SHIFT + Qt::Key_W); connect(mAddWatermarkAction, &QAction::triggered, this, &MainWindow::addWatermark); mQuitAction->setText(tr("Quit")); mQuitAction->setShortcut(Qt::CTRL + Qt::Key_Q); mQuitAction->setIcon(QIcon::fromTheme(QLatin1String("application-exit"))); connect(mQuitAction, &QAction::triggered, this, &MainWindow::quit); mCopyPathAction->setText(tr("Copy Path")); connect(mCopyPathAction, &QAction::triggered, mCaptureHandler, &ICaptureHandler::copyPath); mRenameAction->setText(tr("Rename")); mRenameAction->setShortcut(Qt::Key_F2); connect(mRenameAction, &QAction::triggered, mCaptureHandler, &ICaptureHandler::rename); mOpenDirectoryAction->setText(tr("Open Directory")); connect(mOpenDirectoryAction, &QAction::triggered, mCaptureHandler, &ICaptureHandler::openDirectory); mToggleDocksAction->setText(tr("Hide Docks")); mToggleDocksAction->setShortcut(Qt::Key_Tab); connect(mToggleDocksAction, &QAction::triggered, this, &MainWindow::toggleDocks); mSettingsAction->setText(tr("Settings")); mSettingsAction->setIcon(QIcon::fromTheme(QLatin1String("emblem-system"))); mSettingsAction->setShortcut(Qt::ALT + Qt::Key_F7); connect(mSettingsAction, &QAction::triggered, this, &MainWindow::showSettingsDialog); mAboutAction->setText(tr("&About")); mAboutAction->setIcon(IconLoader::load(QLatin1String("ksnip"))); connect(mAboutAction, &QAction::triggered, this, &MainWindow::showAboutDialog); mOpenImageAction->setText(tr("Open")); mOpenImageAction->setIcon(QIcon::fromTheme(QLatin1String("document-open"))); mOpenImageAction->setShortcut(Qt::CTRL + Qt::Key_O); connect(mOpenImageAction, &QAction::triggered, this, &MainWindow::showOpenImageDialog); mRecentImagesMenu->setTitle(tr("Open &Recent")); mRecentImagesMenu->setIcon(QIcon::fromTheme(QLatin1String("document-open"))); mPasteAction->setText(tr("Paste")); mPasteAction->setIcon(IconLoader::loadForTheme(QLatin1String("paste"))); mPasteAction->setShortcut(Qt::CTRL + Qt::Key_V); mPasteAction->setEnabled(mClipboard->isPixmap()); connect(mPasteAction, &QAction::triggered, this, &MainWindow::pasteFromClipboard); connect(mClipboard, &ClipboardAdapter::changed, mPasteAction, &QAction::setEnabled); mPasteEmbeddedAction->setText(tr("Paste Embedded")); mPasteEmbeddedAction->setIcon(IconLoader::loadForTheme(QLatin1String("pasteEmbedded"))); mPasteEmbeddedAction->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_V); mPasteEmbeddedAction->setEnabled(mClipboard->isPixmap() && mImageAnnotator->isVisible()); connect(mPasteEmbeddedAction, &QAction::triggered, this, &MainWindow::pasteEmbeddedFromClipboard); connect(mClipboard, &ClipboardAdapter::changed, [this] (bool isPixmap){ mPasteEmbeddedAction->setEnabled(isPixmap && mImageAnnotator->isVisible()); }); mPinAction->setText(tr("Pin")); mPinAction->setToolTip(tr("Pin screenshot to foreground in frameless window")); mPinAction->setShortcut(Qt::SHIFT + Qt::Key_P); mPinAction->setIcon(IconLoader::loadForTheme(QLatin1String("pin"))); connect(mPinAction, &QAction::triggered, this, &MainWindow::showPinWindow); mRemoveImageAction->setText(tr("Delete")); mRemoveImageAction->setIcon(IconLoader::loadForTheme(QLatin1String("delete"))); connect(mRemoveImageAction, &QAction::triggered, mCaptureHandler, &ICaptureHandler::removeImage); mModifyCanvasAction->setText(tr("Modify Canvas")); connect(mModifyCanvasAction, &QAction::triggered, mImageAnnotator, &IImageAnnotator::showCanvasModifier); mActionsMenu->setTitle(tr("Actions")); mActionsMenu->setIcon(IconLoader::loadForTheme(QLatin1String("action"))); connect(mActionsMenu, &ActionsMenu::triggered, this, &MainWindow::actionTriggered); auto menu = menuBar()->addMenu(tr("&File")); menu->addAction(mToolBar->newCaptureAction()); menu->addSeparator(); menu->addMenu(mActionsMenu); menu->addSeparator(); menu->addAction(mOpenImageAction); menu->addMenu(mRecentImagesMenu); menu->addAction(mToolBar->saveAction()); menu->addAction(mSaveAsAction); menu->addAction(mUploadAction); menu->addSeparator(); menu->addAction(mPrintAction); menu->addAction(mPrintPreviewAction); menu->addSeparator(); menu->addAction(mQuitAction); menu = menuBar()->addMenu(tr("&Edit")); menu->addAction(mToolBar->undoAction()); menu->addAction(mToolBar->redoAction()); menu->addSeparator(); menu->addAction(mToolBar->copyToClipboardAction()); menu->addAction(mCopyAsDataUriAction); menu->addAction(mCopyPathAction); menu->addAction(mRenameAction); menu->addAction(mPasteAction); menu->addAction(mPasteEmbeddedAction); menu->addSeparator(); menu->addAction(mToolBar->cropAction()); menu->addAction(mScaleAction); menu->addAction(mRotateAction); menu->addAction(mAddWatermarkAction); menu->addSeparator(); menu->addAction(mRemoveImageAction); menu = menuBar()->addMenu(tr("&View")); menu->addAction(mOpenDirectoryAction); menu->addAction(mToggleDocksAction); menu->addAction(mModifyCanvasAction); menu = menuBar()->addMenu(tr("&Options")); menu->addAction(mPinAction); menu->addAction(mSettingsAction); menu = menuBar()->addMenu(tr("&Help")); menu->addAction(mAboutAction); addToolBar(mToolBar); if(mConfig->useTrayIcon()) { connect(mTrayIcon, &TrayIcon::showEditorTriggered, [this](){ mVisibilityHandler->enforceVisible(); }); mTrayIcon->setCaptureActions(mToolBar->captureActions()); mTrayIcon->setOpenAction(mOpenImageAction); mTrayIcon->setSaveAction(mToolBar->saveAction()); mTrayIcon->setPasteAction(mPasteAction); mTrayIcon->setCopyAction(mToolBar->copyToClipboardAction()); mTrayIcon->setUploadAction(mUploadAction); mTrayIcon->setQuitAction(mQuitAction); mTrayIcon->setActionsMenu(mActionsMenu); mTrayIcon->setEnabled(true); } setCentralWidget(mImageAnnotator->widget()); } void MainWindow::copyCaptureToClipboard() { mCaptureHandler->copy(); } void MainWindow::upload() { auto image = mCaptureHandler->image(); UploadOperation operation(image, mUploaderProvider->get()); operation.execute(); } void MainWindow::copyAsDataUri() { auto image = mCaptureHandler->image(); CopyAsDataUriOperation operation(image, mClipboard, mTrayIcon); operation.execute(); } void MainWindow::printClicked() { auto savePath = mSavePathProvider.savePathWithFormat(QLatin1String("pdf")); auto image = mCaptureHandler->image(); mCapturePrinter->print(image, savePath); } void MainWindow::printPreviewClicked() { auto savePath = mSavePathProvider.savePathWithFormat(QLatin1String("pdf")); auto image = mCaptureHandler->image(); mCapturePrinter->printPreview(image, savePath); } void MainWindow::showOpenImageDialog() { auto title = tr("Open Images"); auto directory = mSavePathProvider.saveDirectory(); auto filter = tr("Image Files (*.png *.jpg *.bmp)"); auto pathList = mFileDialog->getOpenFileNames(this, title, directory, filter); for (const auto &path : pathList) { loadImageFromFile(path); } } void MainWindow::setupImageAnnotator() { mImageAnnotator->setSaveToolSelection(mConfig->rememberToolSelection()); mImageAnnotator->setSmoothFactor(mConfig->smoothFactor()); mImageAnnotator->setSmoothPathEnabled(mConfig->smoothPathEnabled()); mImageAnnotator->setSwitchToSelectToolAfterDrawingItem(mConfig->switchToSelectToolAfterDrawingItem()); mImageAnnotator->setSelectItemAfterDrawing(mConfig->selectItemAfterDrawing()); mImageAnnotator->setNumberToolSeedChangeUpdatesAllItems(mConfig->numberToolSeedChangeUpdatesAllItems()); mImageAnnotator->setStickers(mConfig->stickerPaths(), mConfig->useDefaultSticker()); mImageAnnotator->setCanvasColor(mConfig->canvasColor()); } void MainWindow::captureDelayChanged(int delay) { mConfig->setCaptureDelay(delay * 1000); } void MainWindow::addWatermark() { AddWatermarkOperation operation(mImageAnnotator); operation.execute(); } void MainWindow::showDialog(const std::function& showDialogMethod) { mGlobalHotKeyHandler->setEnabled(false); showDialogMethod(); mGlobalHotKeyHandler->setEnabled(true); } void MainWindow::showSettingsDialog() { showDialog([&](){ SettingsDialog settingsDialog(this, mImageGrabber->supportedCaptureModes()); settingsDialog.exec(); }); } void MainWindow::showAboutDialog() { showDialog([&](){ AboutDialog aboutDialog(this); aboutDialog.exec(); }); } void MainWindow::showScaleDialog() { showDialog([&](){ mImageAnnotator->showScaler(); }); } void MainWindow::showRotateDialog() { showDialog([&](){ mImageAnnotator->showRotator(); }); } void MainWindow::pasteFromClipboard() { auto pixmap = mClipboard->pixmap(); if (mClipboard->url().isNull()) { loadImageFromPixmap(pixmap); } else if (!pixmap.isNull()) { CaptureFromFileDto captureDto(pixmap, mClipboard->url()); processImage(captureDto); } } void MainWindow::pasteEmbeddedFromClipboard() { auto pixmap = mClipboard->pixmap(); mCaptureHandler->insertImageItem({}, pixmap); } void MainWindow::saveClicked() { mCaptureHandler->save(); } void MainWindow::saveAsClicked() { mCaptureHandler->saveAs(); } void MainWindow::loadImageFromFile(const QString &path) { LoadImageFromFileOperation operation(this, path, mTrayIcon, mServiceLocator); operation.execute(); } void MainWindow::loadImageFromPixmap(const QPixmap &pixmap) { if (!pixmap.isNull()) { CaptureDto captureDto(pixmap); processImage(captureDto); } else { qWarning("Provided pixmap is not valid."); } } void MainWindow::sessionFinished() { mSessionManagerRequestedQuit = true; } void MainWindow::captureCanceled() { mVisibilityHandler->restoreState(); } void MainWindow::uploadFinished(const UploadResult &result) { HandleUploadResultOperation handleUploadResponseOperation(result, mTrayIcon); handleUploadResponseOperation.execute(); } void MainWindow::captureEmpty() { setEnablements(false); mWindowResizer->resetAndResize(); } void MainWindow::showPinWindow() { mPinWindowHandler->add(QPixmap::fromImage(mCaptureHandler->image())); } void MainWindow::actionTriggered(const Action &action) { if(action.isCaptureEnabled() && !mCaptureHandler->canTakeNew()){ return; } mActionProcessor->process(action); } void MainWindow::showAfterAction(bool minimized) { if (minimized && mTrayIcon->isVisible()) { mVisibilityHandler->hide(); } else if (minimized) { mVisibilityHandler->minimize(); mVisibilityHandler->restoreState(); } else { mVisibilityHandler->restoreState(); } mWindowResizer->resize(); } ksnip-1.9.2/src/gui/MainWindow.h000066400000000000000000000144171414701001100164430ustar00rootroot00000000000000/* * Copyright (C) 2016 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef KSNIP_MAINWINDOW_H #define KSNIP_MAINWINDOW_H #include #include #include "src/gui/actions/ActionProcessor.h" #include "src/gui/actions/ActionsMenu.h" #include "src/gui/TrayIcon.h" #include "src/gui/IImageProcessor.h" #include "src/gui/imageAnnotator/KImageAnnotatorAdapter.h" #include "src/gui/aboutDialog/AboutDialog.h" #include "src/gui/settingsDialog/SettingsDialog.h" #include "src/gui/notificationService/NotificationServiceFactory.h" #include "src/gui/operations/AddWatermarkOperation.h" #include "src/gui/operations/CopyAsDataUriOperation.h" #include "src/gui/operations/UploadOperation.h" #include "src/gui/operations/HandleUploadResultOperation.h" #include "src/gui/operations/LoadImageFromFileOperation.h" #include "src/gui/globalHotKeys/GlobalHotKeyHandler.h" #include "src/gui/captureHandler/CaptureHandlerFactory.h" #include "src/gui/captureHandler/ICaptureChangeListener.h" #include "src/gui/widgetVisibilityHandler/WidgetVisibilityHandlerFactory.h" #include "src/gui/pinWindow/PinWindowHandler.h" #include "src/gui/serviceLocator/ServiceLocator.h" #include "src/gui/RecentImagesMenu.h" #include "src/gui/dragAndDrop/DragAndDropProcessor.h" #include "src/gui/dragAndDrop/IDragContentProvider.h" #include "src/gui/windowResizer/IResizableWindow.h" #include "src/gui/windowResizer/WindowResizer.h" #include "src/widgets/MainToolBar.h" #include "src/backend/imageGrabber/AbstractImageGrabber.h" #include "src/backend/config/KsnipConfigProvider.h" #include "src/backend/uploader/UploaderProvider.h" #include "src/backend/CapturePrinter.h" #include "src/common/loader/IconLoader.h" #include "src/common/enum/RunMode.h" #include "src/common/provider/ApplicationTitleProvider.h" #include "src/common/dtos/CaptureFromFileDto.h" #include "src/common/adapter/fileDialog/FileDialogAdapterFactory.h" class MainWindow : public QMainWindow, public ICaptureChangeListener, public IImageProcessor, public IResizableWindow, public IDragContentProvider { Q_OBJECT public: explicit MainWindow(AbstractImageGrabber *imageGrabber, RunMode mode = RunMode::GUI); ~MainWindow() override; void showEmpty(); void showHidden(); void showDefault(); void captureScreenshot(CaptureModes captureMode, bool captureCursor, int delay); void resizeToContent() override; bool isWindowMaximized() override; void processImage(const CaptureDto &capture) override; DragContent dragContent() const override; public slots: void processCapture(const CaptureDto &capture); void quit(); signals: void imageLoaded() const; protected: void moveEvent(QMoveEvent *event) override; void closeEvent(QCloseEvent *event) override; void changeEvent(QEvent *event) override; QMenu *createPopupMenu() override; QSize sizeHint() const override; private: AbstractImageGrabber *mImageGrabber; IServiceLocator *mServiceLocator; RunMode mMode; bool mSessionManagerRequestedQuit; QAction *mSaveAsAction; QAction *mUploadAction; QAction *mCopyAsDataUriAction; QAction *mPrintAction; QAction *mPrintPreviewAction; QAction *mQuitAction; QAction *mCopyPathAction; QAction *mRenameAction; QAction *mOpenDirectoryAction; QAction *mToggleDocksAction; QAction *mSettingsAction; QAction *mAboutAction; QAction *mOpenImageAction; QAction *mScaleAction; QAction *mRotateAction; QAction *mAddWatermarkAction; QAction *mPasteAction; QAction *mPasteEmbeddedAction; QAction *mPinAction; QAction *mRemoveImageAction; QAction *mModifyCanvasAction; MainToolBar *mToolBar; QLayout *mMainLayout; KsnipConfig *mConfig; ActionsMenu *mActionsMenu; RecentImagesMenu *mRecentImagesMenu; IClipboard *mClipboard; CapturePrinter *mCapturePrinter; IImageAnnotator *mImageAnnotator; SavePathProvider mSavePathProvider; GlobalHotKeyHandler *mGlobalHotKeyHandler; TrayIcon *mTrayIcon; DragAndDropProcessor *mDragAndDropProcessor; UploaderProvider *mUploaderProvider; ICaptureHandler *mCaptureHandler; PinWindowHandler *mPinWindowHandler; WidgetVisibilityHandler *mVisibilityHandler; IFileDialogAdapter *mFileDialog; WindowResizer *mWindowResizer; ActionProcessor *mActionProcessor; void setEnablements(bool enabled); void loadSettings(); void triggerCapture(CaptureModes captureMode); void capture(CaptureModes captureMode, bool captureCursor, int delay); void initGui(); void processInstantCapture(const CaptureDto &capture); void showDialog(const std::function& showDialogMethod); private slots: void captureChanged() override; void captureEmpty() override; void copyCaptureToClipboard(); void upload(); void uploadFinished(const UploadResult &result); void copyAsDataUri(); void printClicked(); void printPreviewClicked(); void showOpenImageDialog(); void pasteFromClipboard(); void pasteEmbeddedFromClipboard(); void setupImageAnnotator(); void captureDelayChanged(int delay); void addWatermark(); void showSettingsDialog(); void showAboutDialog(); void showScaleDialog(); void showRotateDialog(); void setPosition(); void handleGuiStartup(); void saveClicked(); void saveAsClicked(); void updateApplicationTitle(); void capturePostProcessing(); void loadImageFromFile(const QString &path); void loadImageFromPixmap(const QPixmap &pixmap); void sessionFinished(); void captureCanceled(); void showPinWindow(); void hideMainWindowIfRequired(); void toggleDocks(); void actionTriggered(const Action &action); void showAfterAction(bool minimized); }; #endif // KSNIP_MAINWINDOW_H ksnip-1.9.2/src/gui/RecentImagesMenu.cpp000066400000000000000000000031741414701001100201130ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "RecentImagesMenu.h" RecentImagesMenu::RecentImagesMenu(IRecentImageService *recentImageService, QWidget *parent) : QMenu(parent), mRecentImageService(recentImageService) { connect(this, &QMenu::aboutToShow, this, &RecentImagesMenu::populateMenu); } void RecentImagesMenu::populateMenu() { clear(); const auto recentImages = mRecentImageService->getRecentImagesPath(); auto imageIndex = 0; for(const auto& path : recentImages) { auto action = createAction(path, imageIndex++); addAction(action); } setEnabled(recentImages.size() > 0); } QAction *RecentImagesMenu::createAction(const QString &path, int index) { auto action = new QAction(this); action->setText(path); action->setShortcut(Qt::CTRL + Qt::Key_0 + index); connect(action, &QAction::triggered, this, [this, path](){ emit openRecentSelected(path); }); return action; } ksnip-1.9.2/src/gui/RecentImagesMenu.h000066400000000000000000000025401414701001100175540ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_RECENTIMAGESMENU_H #define KSNIP_RECENTIMAGESMENU_H #include #include "src/backend/recentImages/IRecentImageService.h" class RecentImagesMenu : public QMenu { Q_OBJECT public: explicit RecentImagesMenu(IRecentImageService *recentImagesPathStore, QWidget *parent = nullptr); ~RecentImagesMenu() override = default; signals: void openRecentSelected(const QString &path); private: void populateMenu(); IRecentImageService *mRecentImageService; QAction *createAction(const QString &path, int index); }; #endif //KSNIP_RECENTIMAGESMENU_H ksnip-1.9.2/src/gui/TrayIcon.cpp000066400000000000000000000103741414701001100164500ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "TrayIcon.h" TrayIcon::TrayIcon(QObject *parent) : QSystemTrayIcon(parent), mConfig(KsnipConfigProvider::instance()), mOpenAction(nullptr), mSaveAction(nullptr), mPasteAction(nullptr), mCopyAction(nullptr), mUploadAction(nullptr), mShowEditorAction(nullptr), mQuitAction(nullptr), mActionsMenu(nullptr) { auto icon = IconLoader::loadForTheme(QLatin1String("ksnip")); setIcon(icon); mShowEditorAction = new QAction(tr("Show Editor"), this); mShowEditorAction->setIcon(icon); connect(mShowEditorAction, &QAction::triggered, this, &TrayIcon::showEditorTriggered); connect(this, &QSystemTrayIcon::activated, this, &TrayIcon::activatedDefaultAction); connect(this, &QSystemTrayIcon::messageClicked, this, &TrayIcon::openContentUrl); } void TrayIcon::setupMenu() { mMenu.addAction(mShowEditorAction); mMenu.addSeparator(); for(auto captureAction : mCaptureActions) { mMenu.addAction(captureAction); } mMenu.addSeparator(); mMenu.addMenu(mActionsMenu); mMenu.addSeparator(); mMenu.addAction(mOpenAction); mMenu.addAction(mSaveAction); mMenu.addAction(mPasteAction); mMenu.addAction(mCopyAction); mMenu.addAction(mUploadAction); mMenu.addSeparator(); mMenu.addAction(mQuitAction); setContextMenu(&mMenu); } TrayIcon::~TrayIcon() { delete mShowEditorAction; } void TrayIcon::setCaptureActions(const QList &captureActions) { mCaptureActions = captureActions; } void TrayIcon::setOpenAction(QAction *action) { mOpenAction = action; } void TrayIcon::setSaveAction(QAction *action) { mSaveAction = action; } void TrayIcon::setPasteAction(QAction *action) { mPasteAction = action; } void TrayIcon::setCopyAction(QAction *action) { mCopyAction = action; } void TrayIcon::setUploadAction(QAction *action) { mUploadAction = action; } void TrayIcon::setQuitAction(QAction *action) { mQuitAction = action; } void TrayIcon::setActionsMenu(QMenu *actionsMenu) { mActionsMenu = actionsMenu; } void TrayIcon::setEnabled(bool enabled) { if(enabled) { setupMenu(); show(); } else { hide(); } } void TrayIcon::showInfoToast(const QString &title, const QString &message, const QString &contentUrl) { showMessage(title, message, contentUrl, QSystemTrayIcon::Information); } void TrayIcon::showWarningToast(const QString &title, const QString &message, const QString &contentUrl) { showMessage(title, message, contentUrl, QSystemTrayIcon::Warning); } void TrayIcon::showCriticalToast(const QString &title, const QString &message, const QString &contentUrl) { showMessage(title, message, contentUrl, QSystemTrayIcon::Critical); } void TrayIcon::showMessage(const QString &title, const QString &message, const QString &contentUrl, QSystemTrayIcon::MessageIcon messageIcon) { mToastContentUrl = PathHelper::extractParentDirectory(contentUrl); QSystemTrayIcon::showMessage(title, message, messageIcon); } void TrayIcon::activatedDefaultAction(ActivationReason reason) const { if(reason != ActivationReason::Context) { if (mConfig->defaultTrayIconActionMode() == TrayIconDefaultActionMode::ShowEditor) { mShowEditorAction->trigger(); } else { triggerDefaultCaptureMode(); } } } void TrayIcon::triggerDefaultCaptureMode() const { auto captureMode = mConfig->defaultTrayIconCaptureMode(); for(auto action : mCaptureActions) { if (action->data().value() == captureMode) { action->trigger(); return; } } } void TrayIcon::openContentUrl() { if(!mToastContentUrl.isEmpty() && !mToastContentUrl.isNull()) { QDesktopServices::openUrl(mToastContentUrl); } } ksnip-1.9.2/src/gui/TrayIcon.h000066400000000000000000000050411414701001100161100ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_TRAYICON_H #define KSNIP_TRAYICON_H #include #include #include #include #include "IToastService.h" #include "src/backend/config/KsnipConfigProvider.h" #include "src/common/enum/CaptureModes.h" #include "src/common/loader/IconLoader.h" class TrayIcon : public QSystemTrayIcon, public IToastService { Q_OBJECT public: explicit TrayIcon(QObject *parent); ~TrayIcon() override; void setCaptureActions(const QList &captureActions); void setOpenAction(QAction *action); void setSaveAction(QAction *action); void setPasteAction(QAction *action); void setCopyAction(QAction *action); void setUploadAction(QAction *action); void setQuitAction(QAction *action); void setActionsMenu(QMenu *actionsMenu); void setEnabled(bool enabled); void showInfoToast(const QString &title, const QString &message, const QString &contentUrl) override; void showWarningToast(const QString &title, const QString &message, const QString &contentUrl) override; void showCriticalToast(const QString &title, const QString &message, const QString &contentUrl) override; signals: void showEditorTriggered() const; private: KsnipConfig *mConfig; QMenu mMenu; QList mCaptureActions; QAction *mOpenAction; QAction *mSaveAction; QAction *mPasteAction; QAction *mCopyAction; QAction *mUploadAction; QAction *mShowEditorAction; QAction *mQuitAction; QMenu *mActionsMenu; QString mToastContentUrl; void setupMenu(); void triggerDefaultCaptureMode() const; private slots: void activatedDefaultAction(ActivationReason reason) const; void openContentUrl(); void showMessage(const QString &title, const QString &message, const QString &contentUrl, QSystemTrayIcon::MessageIcon messageIcon); }; #endif //KSNIP_TRAYICON_H ksnip-1.9.2/src/gui/aboutDialog/000077500000000000000000000000001414701001100164415ustar00rootroot00000000000000ksnip-1.9.2/src/gui/aboutDialog/AboutDialog.cpp000066400000000000000000000052261414701001100213440ustar00rootroot00000000000000/* * Copyright (C) 2016 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #include "AboutDialog.h" AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent), mMainLayout(new QVBoxLayout), mHeaderLayout(new QHBoxLayout), mTabWidget(new QTabWidget), mAboutTab(new AboutTab), mVersionTab(new VersionTab), mAuthorTab(new AuthorTab), mDonateTab(new DonateTab), mContactTab(new ContactTab), mCloseButton(new QPushButton) { setWindowTitle(tr("About ") + QApplication::applicationName()); createHeader(); mTabWidget->addTab(mAboutTab, tr("About")); mTabWidget->addTab(mVersionTab, tr("Version")); mTabWidget->addTab(mAuthorTab, tr("Author")); mTabWidget->addTab(mDonateTab, tr("Donate")); mTabWidget->addTab(mContactTab, tr("Contact")); mTabWidget->setMinimumSize(mTabWidget->sizeHint()); mCloseButton->setText(tr("Close")); connect(mCloseButton, &QPushButton::clicked, this, &AboutDialog::close); mMainLayout->addLayout(mHeaderLayout); mMainLayout->addWidget(mTabWidget); mMainLayout->addWidget(mCloseButton, 1, Qt::AlignRight); setLayout(mMainLayout); setFixedSize(sizeHint() + QSize(10, 0)); } AboutDialog::~AboutDialog() { delete mMainLayout; delete mCloseButton; delete mAboutTab; delete mVersionTab; delete mAuthorTab; delete mDonateTab; } void AboutDialog::createHeader() { auto pixmap = QPixmap(QLatin1String(":/icons/ksnip")); auto scaledPixmap = pixmap.scaled(64, 64, Qt::KeepAspectRatio, Qt::SmoothTransformation); auto label = new QLabel(); mHeaderLayout = new QHBoxLayout(); label->setPixmap(scaledPixmap); label->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); mHeaderLayout->addWidget(label); label = new QLabel(QLatin1String("

") + QApplication::applicationName() + QLatin1String("

")); label->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); mHeaderLayout->addWidget(label); mHeaderLayout->setAlignment(Qt::AlignLeft); } ksnip-1.9.2/src/gui/aboutDialog/AboutDialog.h000066400000000000000000000030041414701001100210010ustar00rootroot00000000000000/* * Copyright (C) 2016 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef KSNIP_ABOUTDIALOG_H #define KSNIP_ABOUTDIALOG_H #include #include #include #include "AboutTab.h" #include "VersionTab.h" #include "AuthorTab.h" #include "DonateTab.h" #include "ContactTab.h" class QLabel; class MainWindow; class AboutDialog : public QDialog { Q_OBJECT public: explicit AboutDialog(QWidget *parent = nullptr); ~AboutDialog() override; private: QVBoxLayout *mMainLayout; QHBoxLayout *mHeaderLayout; QTabWidget *mTabWidget; QPushButton *mCloseButton; AboutTab *mAboutTab; VersionTab *mVersionTab; AuthorTab *mAuthorTab; DonateTab *mDonateTab; ContactTab *mContactTab; void createHeader(); }; #endif // KSNIP_ABOUTDIALOG_H ksnip-1.9.2/src/gui/aboutDialog/AboutTab.cpp000066400000000000000000000030361414701001100206500ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "AboutTab.h" AboutTab::AboutTab() : mLayout(new QVBoxLayout(this)), mContent(new QLabel(this)) { mContent->setText(QLatin1String("") + QApplication::applicationName() + QLatin1String(" - ") + tr("Screenshot and Annotation Tool") + QLatin1String("

") + QLatin1String("(C) 2021 Damir Porobic") + QLatin1String("

") + tr("License: ") + QLatin1String("GNU General Public License Version 2")); mContent->setTextFormat(Qt::RichText); mContent->setTextInteractionFlags(Qt::TextBrowserInteraction); mContent->setOpenExternalLinks(true); mLayout->addWidget(mContent); setLayout(mLayout); } AboutTab::~AboutTab() { delete mLayout; delete mContent; } ksnip-1.9.2/src/gui/aboutDialog/AboutTab.h000066400000000000000000000021131414701001100203100ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_ABOUTTAB_H #define KSNIP_ABOUTTAB_H #include #include #include #include class AboutTab : public QWidget { Q_OBJECT public: AboutTab(); ~AboutTab() override; private: QLabel *mContent; QVBoxLayout *mLayout; }; #endif //KSNIP_ABOUTTAB_H ksnip-1.9.2/src/gui/aboutDialog/AuthorTab.cpp000066400000000000000000000054621414701001100210450ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "AuthorTab.h" AuthorTab::AuthorTab() { mLayout = new QVBoxLayout(); mContent = new QLabel(); mContent->setText( QLatin1String("") + tr("The Authors:") + QLatin1String("
") + QLatin1String("Damir Porobic ") + createEmailEntry(QLatin1String("damir.porobic@gmx.com")) + QLatin1String("
") + QLatin1String("Stefan Comanescu") + createEmailEntry(QLatin1String("fnkabit@gmail.com")) + QLatin1String("

") + QLatin1String("") + tr("Contributors:") + QLatin1String("
") + createContributorEntry(QLatin1String("Galileo Sartor"), tr("Snap & Flatpak Support")) + createContributorEntry(QLatin1String("Luis Vásquez"), tr("Spanish Translation"), QLatin1String("lvaskz@protonmail.com")) + createContributorEntry(QLatin1String("Heimen Stoffels"), tr("Dutch Translation"), QLatin1String("vistausss@outlook.com")) + createContributorEntry(QLatin1String("Yury Martynov"), tr("Russian Translation"), QLatin1String("email@linxon.ru")) + createContributorEntry(QLatin1String("Allan Nordhøy"), tr("Norwegian Bokmål Translation"), QLatin1String("epost@anotheragency.no")) + createContributorEntry(QLatin1String("4goodapp"), tr("French Translation")) + createContributorEntry(QLatin1String("epsiloneridani"), tr("Polish Translation")) ); mContent->setTextFormat(Qt::RichText); mContent->setTextInteractionFlags(Qt::TextBrowserInteraction); mContent->setOpenExternalLinks(true); mLayout->addWidget(mContent); setLayout(mLayout); } AuthorTab::~AuthorTab() { delete mLayout; delete mContent; } QString AuthorTab::createContributorEntry(const QString &name, const QString &role, const QString &email) const { auto baseEntry = name + QLatin1String(" - ") + role; if(!email.isEmpty()) { baseEntry += QLatin1String(" ") + createEmailEntry(email); } return baseEntry + QLatin1String("
"); } QString AuthorTab::createEmailEntry(const QString &email) { return QLatin1String("(Email))"); } ksnip-1.9.2/src/gui/aboutDialog/AuthorTab.h000066400000000000000000000023461414701001100205100ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_AUTHORTAB_H #define KSNIP_AUTHORTAB_H #include #include #include class AuthorTab : public QWidget { Q_OBJECT public: AuthorTab(); ~AuthorTab() override; private: QLabel *mContent; QVBoxLayout *mLayout; QString createContributorEntry(const QString &name, const QString &role, const QString &email = QString()) const; static QString createEmailEntry(const QString &email) ; }; #endif //KSNIP_AUTHORTAB_H ksnip-1.9.2/src/gui/aboutDialog/ContactTab.cpp000066400000000000000000000034241414701001100211720ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "ContactTab.h" ContactTab::ContactTab() : mLayout(new QVBoxLayout()), mContent(new QLabel()) { mContent->setText( QLatin1String("") + tr("Community") + QLatin1String("
") + tr("If you have general questions, ideas or just want to talk about ksnip,") + QLatin1String("
") + tr("please join our") + QLatin1String(" Discord ") + tr("or our") + QLatin1String(" IRC ") + tr("server") + QLatin1String(".

") + QLatin1String("") + tr("Bug Reports") + QLatin1String("
") + tr("Please use ") + QLatin1String("GitHub") + tr(" to report bugs.")); mContent->setTextFormat(Qt::RichText); mContent->setTextInteractionFlags(Qt::TextBrowserInteraction); mContent->setOpenExternalLinks(true); mLayout->addWidget(mContent); setLayout(mLayout); } ContactTab::~ContactTab() { delete mLayout; delete mContent; } ksnip-1.9.2/src/gui/aboutDialog/ContactTab.h000066400000000000000000000020771414701001100206420ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_CONTACTTAB_H #define KSNIP_CONTACTTAB_H #include #include #include class ContactTab : public QWidget { Q_OBJECT public: ContactTab(); ~ContactTab() override; private: QLabel *mContent; QVBoxLayout *mLayout; }; #endif //KSNIP_CONTACTTAB_H ksnip-1.9.2/src/gui/aboutDialog/DonateTab.cpp000066400000000000000000000042261414701001100210120ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "DonateTab.h" DonateTab::DonateTab() { mLayout = new QVBoxLayout(); mContent = new QLabel(); mContent->setText(QLatin1String("") + tr("Donation") + QLatin1String("") + QLatin1String("
") + tr("ksnip is a non-profitable copylefted libre software project, and
" "still has some costs that need to be covered,
" "like domain costs or hardware costs for cross-platform support.") + QLatin1String("
") + tr("If you want to help or just want to appreciate the work being done
" "by treating developers to a beer or coffee, you can do that") + QLatin1String(" ") + tr("here") + QLatin1String(".

") + tr("Donations are always welcome") + QLatin1String(" :)") + QLatin1String("

") + QLatin1String("") + tr("Become a GitHub Sponsor") + QLatin1String("?") + QLatin1String("
") + tr("Also possible, ") + QLatin1String(" ") + tr("here") + QLatin1String(".")); mContent->setTextFormat(Qt::RichText); mContent->setTextInteractionFlags(Qt::TextBrowserInteraction); mContent->setOpenExternalLinks(true); mLayout->addWidget(mContent); setLayout(mLayout); } DonateTab::~DonateTab() { delete mContent; delete mLayout; } ksnip-1.9.2/src/gui/aboutDialog/DonateTab.h000066400000000000000000000021521414701001100204530ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_DONATETAB_H #define KSNIP_DONATETAB_H #include #include #include #include #include "BuildConfig.h" class DonateTab : public QWidget { Q_OBJECT public: DonateTab(); ~DonateTab() override; private: QLabel *mContent; QVBoxLayout *mLayout; }; #endif //KSNIP_DONATETAB_H ksnip-1.9.2/src/gui/aboutDialog/VersionTab.cpp000066400000000000000000000030611414701001100212210ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "VersionTab.h" VersionTab::VersionTab() { mLayout = new QVBoxLayout(); mContent = new QLabel(); mContent->setText(QLatin1String("") + tr("Version") + QLatin1String(": ") + QApplication::applicationVersion() + QLatin1String("") + QLatin1String("
") + tr("Build") + QLatin1String(": ") + QLatin1String(KSNIP_BUILD_NUMBER) + QLatin1String("") + QLatin1String("

") + tr("Using:") + QLatin1String("
    " "
  • Qt5
  • " "
  • X11
  • " "
  • KDE Wayland
  • " "
  • Gnome Wayland
  • " "
")); mContent->setTextInteractionFlags(Qt::TextSelectableByMouse); mLayout->addWidget(mContent); setLayout(mLayout); } VersionTab::~VersionTab() { delete mContent; delete mLayout; } ksnip-1.9.2/src/gui/aboutDialog/VersionTab.h000066400000000000000000000021601414701001100206650ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_VERSIONTAB_H #define KSNIP_VERSIONTAB_H #include #include #include #include #include "BuildConfig.h" class VersionTab : public QWidget { Q_OBJECT public: VersionTab(); ~VersionTab() override; private: QLabel *mContent; QVBoxLayout *mLayout; }; #endif //KSNIP_VERSIONTAB_H ksnip-1.9.2/src/gui/actions/000077500000000000000000000000001414701001100156475ustar00rootroot00000000000000ksnip-1.9.2/src/gui/actions/Action.cpp000066400000000000000000000071671414701001100176030ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "Action.h" Action::Action() : mIsCaptureEnabled(false), mCaptureDelay(0), mCaptureMode(CaptureModes::RectArea), mIsPinImageEnabled(false), mIsUploadEnabled(false), mIsSaveEnabled(false), mIsCopyToClipboardEnabled(false), mIsOpenDirectoryEnabled(false), mIncludeCursor(false), mIsHideMainWindowEnabled(false) { } QString Action::name() const { return mName; } void Action::setName(const QString &name) { mName = name; } QKeySequence Action::shortcut() const { return mShortcut; } void Action::setShortcut(const QKeySequence &keySequence) { mShortcut = keySequence; } bool Action::isCaptureEnabled() const { return mIsCaptureEnabled; } void Action::setIsCaptureEnabled(bool enabled) { mIsCaptureEnabled = enabled; } int Action::captureDelay() const { return mCaptureDelay; } void Action::setCaptureDelay(int delayInMs) { mCaptureDelay = delayInMs; } bool Action::includeCursor() const { return mIncludeCursor; } void Action::setIncludeCursor(bool enabled) { mIncludeCursor = enabled; } CaptureModes Action::captureMode() const { return mCaptureMode; } void Action::setCaptureMode(CaptureModes mode) { mCaptureMode = mode; } bool Action::isPinImageEnabled() const { return mIsPinImageEnabled; } void Action::setIsPinScreenshotEnabled(bool enabled) { mIsPinImageEnabled = enabled; } bool Action::isUploadEnabled() const { return mIsUploadEnabled; } void Action::setIsUploadEnabled(bool enabled) { mIsUploadEnabled = enabled; } bool Action::isSaveEnabled() const { return mIsSaveEnabled; } void Action::setIsSaveEnabled(bool enabled) { mIsSaveEnabled = enabled; } bool Action::isCopyToClipboardEnabled() const { return mIsCopyToClipboardEnabled; } void Action::setIsCopyToClipboardEnabled(bool enabled) { mIsCopyToClipboardEnabled = enabled; } bool Action::isOpenDirectoryEnabled() const { return mIsOpenDirectoryEnabled; } void Action::setIsOpenDirectoryEnabled(bool enabled) { mIsOpenDirectoryEnabled = enabled; } bool Action::isHideMainWindowEnabled() const { return mIsHideMainWindowEnabled; } void Action::setIsHideMainWindowEnabled(bool enabled) { mIsHideMainWindowEnabled = enabled; } bool operator==(const Action &left, const Action &right) { return left.name() == right.name() && left.shortcut() == right.shortcut() && left.isCaptureEnabled() == right.isCaptureEnabled() && left.includeCursor() == right.includeCursor() && left.captureDelay() == right.captureDelay() && left.captureMode() == right.captureMode() && left.isSaveEnabled() == right.isSaveEnabled() && left.isCopyToClipboardEnabled() == right.isCopyToClipboardEnabled() && left.isPinImageEnabled() == right.isPinImageEnabled() && left.isOpenDirectoryEnabled() == right.isOpenDirectoryEnabled() && left.isUploadEnabled() == right.isUploadEnabled() && left.isHideMainWindowEnabled() == right.isHideMainWindowEnabled(); } ksnip-1.9.2/src/gui/actions/Action.h000066400000000000000000000044751414701001100172470ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_ACTION_H #define KSNIP_ACTION_H #include #include #include "src/common/enum/CaptureModes.h" class Action { public: Action(); ~Action() = default; QString name() const; void setName(const QString &name); QKeySequence shortcut() const; void setShortcut(const QKeySequence &keySequence); bool isCaptureEnabled() const; void setIsCaptureEnabled(bool enabled); int captureDelay() const; void setCaptureDelay(int delayInMs); bool isPinImageEnabled() const; void setIsPinScreenshotEnabled(bool enabled); CaptureModes captureMode() const; void setCaptureMode(CaptureModes mode); bool includeCursor() const; void setIncludeCursor(bool enabled); bool isUploadEnabled() const; void setIsUploadEnabled(bool enabled); bool isSaveEnabled() const; void setIsSaveEnabled(bool enabled); bool isCopyToClipboardEnabled() const; void setIsCopyToClipboardEnabled(bool enabled); bool isOpenDirectoryEnabled() const; void setIsOpenDirectoryEnabled(bool enabled); bool isHideMainWindowEnabled() const; void setIsHideMainWindowEnabled(bool enabled); friend bool operator==(const Action& left, const Action& right); private: QString mName; bool mIsCaptureEnabled; int mCaptureDelay; bool mIncludeCursor; CaptureModes mCaptureMode; bool mIsPinImageEnabled; bool mIsUploadEnabled; bool mIsSaveEnabled; bool mIsCopyToClipboardEnabled; bool mIsOpenDirectoryEnabled; bool mIsHideMainWindowEnabled; QKeySequence mShortcut; }; bool operator==(const Action& left, const Action& right); #endif //KSNIP_ACTION_H ksnip-1.9.2/src/gui/actions/ActionProcessor.cpp000066400000000000000000000050131414701001100214670ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "ActionProcessor.h" ActionProcessor::ActionProcessor() : mIsCaptureInProgress(false), mIsPostProcessingEnabled(false), mIsActionInProgress(false) { } void ActionProcessor::process(const Action &action) { mCurrentAction = action; mIsActionInProgress = true; if (mCurrentAction.isCaptureEnabled()) { preCaptureProcessing(); } else { postCaptureProcessing(); } } void ActionProcessor::setPostProcessingEnabled(bool enabled) { mIsPostProcessingEnabled = enabled; } bool ActionProcessor::isActionInProgress() const { return mIsActionInProgress; } void ActionProcessor::captureFinished() { if(mIsCaptureInProgress) { mIsCaptureInProgress = false; postCaptureProcessing(); } } void ActionProcessor::captureCanceled() { mIsCaptureInProgress = false; mIsActionInProgress = false; } void ActionProcessor::preCaptureProcessing() { mIsCaptureInProgress = true; emit triggerCapture(mCurrentAction.captureMode(), mCurrentAction.includeCursor(), mCurrentAction.captureDelay()); } void ActionProcessor::postCaptureProcessing() { if (!mIsPostProcessingEnabled && !mCurrentAction.isCaptureEnabled()) { mIsActionInProgress = false; return; } if (mCurrentAction.isSaveEnabled()) { emit triggerSave(); } if (mCurrentAction.isCopyToClipboardEnabled()) { emit triggerCopyToClipboard(); } if (mCurrentAction.isOpenDirectoryEnabled()) { emit triggerOpenDirectory(); } if (mCurrentAction.isPinImageEnabled()) { emit triggerPinImage(); } if (mCurrentAction.isUploadEnabled()) { emit triggerUpload(); } if (mCurrentAction.isHideMainWindowEnabled()) { emit triggerShow(true); } if (!mCurrentAction.isHideMainWindowEnabled() && mCurrentAction.isCaptureEnabled()) { emit triggerShow(false); } mIsActionInProgress = false; } ksnip-1.9.2/src/gui/actions/ActionProcessor.h000066400000000000000000000032561414701001100211430ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_ACTIONPROCESSOR_H #define KSNIP_ACTIONPROCESSOR_H #include #include "Action.h" class ActionProcessor : public QObject { Q_OBJECT public: ActionProcessor(); ~ActionProcessor() override = default; void process(const Action &action); void setPostProcessingEnabled(bool enabled); bool isActionInProgress() const; signals: void triggerCapture(CaptureModes mode, bool includeCursor, int delay) const; void triggerPinImage() const; void triggerCopyToClipboard() const; void triggerSave() const; void triggerUpload() const; void triggerOpenDirectory() const; void triggerShow(bool minimized) const; public slots: void captureFinished(); void captureCanceled(); private: bool mIsCaptureInProgress; bool mIsPostProcessingEnabled; bool mIsActionInProgress; Action mCurrentAction; void preCaptureProcessing(); void postCaptureProcessing(); }; #endif //KSNIP_ACTIONPROCESSOR_H ksnip-1.9.2/src/gui/actions/ActionsMenu.cpp000066400000000000000000000023771414701001100206110ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "ActionsMenu.h" ActionsMenu::ActionsMenu(KsnipConfig *config) : mConfig(config) { Q_ASSERT(mConfig != nullptr); connect(mConfig, &KsnipConfig::actionsChanged, this, &ActionsMenu::actionsChanged); actionsChanged(); } void ActionsMenu::actionsChanged() { clear(); auto actions = mConfig->actions(); for (const auto& action : actions) { addAction(action.name(), [this, action]() { emit triggered(action); }, action.shortcut()); } setEnabled(!actions.isEmpty()); } ksnip-1.9.2/src/gui/actions/ActionsMenu.h000066400000000000000000000023121414701001100202430ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_ACTIONSMENU_H #define KSNIP_ACTIONSMENU_H #include #include "src/backend/config/KsnipConfig.h" class ActionsMenu : public QMenu { Q_OBJECT public: explicit ActionsMenu(KsnipConfig *config); ~ActionsMenu() override = default; signals: void triggered(const Action &action); private: KsnipConfig *mConfig; QList mActions; private slots: void actionsChanged(); }; #endif //KSNIP_ACTIONSMENU_H ksnip-1.9.2/src/gui/captureHandler/000077500000000000000000000000001414701001100171505ustar00rootroot00000000000000ksnip-1.9.2/src/gui/captureHandler/CaptureHandlerFactory.cpp000066400000000000000000000023541414701001100241110ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "CaptureHandlerFactory.h" ICaptureHandler * CaptureHandlerFactory::create(IImageAnnotator *imageAnnotator, IToastService *toastService, IServiceLocator *serviceLocator, QWidget *parent) { if(KsnipConfigProvider::instance()->useTabs()) { return new MultiCaptureHandler(imageAnnotator, toastService, serviceLocator, new CaptureTabStateHandler, parent); } else { return new SingleCaptureHandler(imageAnnotator, toastService, serviceLocator, parent); } } ksnip-1.9.2/src/gui/captureHandler/CaptureHandlerFactory.h000066400000000000000000000026551414701001100235620ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_CAPTUREHANDLERFACTORY_H #define KSNIP_CAPTUREHANDLERFACTORY_H #include "src/gui/captureHandler/SingleCaptureHandler.h" #include "src/gui/captureHandler/MultiCaptureHandler.h" #include "src/gui/captureHandler/CaptureTabStateHandler.h" #include "src/gui/serviceLocator/ServiceLocator.h" #include "src/backend/config/KsnipConfigProvider.h" class CaptureHandlerFactory { public: explicit CaptureHandlerFactory() = default; ~CaptureHandlerFactory() = default; static ICaptureHandler *create(IImageAnnotator *imageAnnotator, IToastService *toastService, IServiceLocator *serviceLocator, QWidget *parent); }; #endif //KSNIP_CAPTUREHANDLERFACTORY_H ksnip-1.9.2/src/gui/captureHandler/CaptureTabState.h000066400000000000000000000022351414701001100223560ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_CAPTURETABSTATE_H #define KSNIP_CAPTURETABSTATE_H struct CaptureTabState { int index; QString path; QString filename; bool isSaved; explicit CaptureTabState(int index, const QString &filename, const QString &path, bool isSave) { this->index = index; this->filename = filename; this->path = path; this->isSaved = isSave; } }; #endif //KSNIP_CAPTURETABSTATE_H ksnip-1.9.2/src/gui/captureHandler/CaptureTabStateHandler.cpp000066400000000000000000000076541414701001100242210ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "CaptureTabStateHandler.h" CaptureTabStateHandler::CaptureTabStateHandler() : mCurrentTabIndex(-1) { } void CaptureTabStateHandler::add(int index, const QString &filename, const QString &path, bool isSaved) { auto newState = QSharedPointer(new CaptureTabState(index, filename, path, isSaved)); mCaptureTabStates.append(newState); refreshTabInfo(index); } bool CaptureTabStateHandler::isSaved(int index) { auto tabState = getTabState(index); return tabState.isNull() || tabState->isSaved; } bool CaptureTabStateHandler::isPathValid(int index) { return PathHelper::isPathValid(path(index)); } QString CaptureTabStateHandler::path(int index) { auto tabState = getTabState(index); return tabState.isNull() ? QString() : tabState->path; } QString CaptureTabStateHandler::filename(int index) { auto tabState = getTabState(index); return tabState.isNull() ? QString() : tabState->filename; } void CaptureTabStateHandler::setSaveState(int index, const SaveResultDto &saveResult) { auto tabState = getTabState(index); if (!tabState.isNull()) { tabState->isSaved = saveResult.isSuccessful; if (saveResult.isSuccessful) { tabState->path = saveResult.path; tabState->filename = PathHelper::extractFilename(saveResult.path); refreshTabInfo(index); } } } void CaptureTabStateHandler::renameFile(int index, const RenameResultDto &renameResult) { auto tabState = getTabState(index); if (!tabState.isNull() && renameResult.isSuccessful) { tabState->path = renameResult.path; tabState->filename = PathHelper::extractFilename(renameResult.path); refreshTabInfo(index); } } void CaptureTabStateHandler::tabMoved(int fromIndex, int toIndex) { for (auto& state : mCaptureTabStates) { if(state->index == fromIndex) { state->index = toIndex; } else if(state->index == toIndex) { state->index = fromIndex; } } } void CaptureTabStateHandler::currentTabChanged(int index) { mCurrentTabIndex = index; } void CaptureTabStateHandler::tabRemoved(int index) { auto iterator = mCaptureTabStates.begin(); while (iterator != mCaptureTabStates.end()) { if (iterator->data()->index == index) { iterator = mCaptureTabStates.erase(iterator); } else { if (iterator->data()->index > index) { iterator->data()->index--; } iterator++; } } } void CaptureTabStateHandler::currentTabContentChanged() { auto currentTabState = getTabState(mCurrentTabIndex); if (!currentTabState.isNull()) { currentTabState->isSaved = false; refreshTabInfo(mCurrentTabIndex); } } void CaptureTabStateHandler::refreshTabInfo(int index) { auto tabState = getTabState(index); if (!tabState.isNull()) { auto title = tabState->isSaved ? tabState->filename : tabState->filename + QLatin1String("*"); emit updateTabInfo(tabState->index, title, tabState->path); } } int CaptureTabStateHandler::count() const { return mCaptureTabStates.count(); } int CaptureTabStateHandler::currentTabIndex() const { return mCurrentTabIndex; } QSharedPointer CaptureTabStateHandler::getTabState(int index) { for (auto &state : mCaptureTabStates) { if (state->index == index) { return state; } } return QSharedPointer(nullptr); } ksnip-1.9.2/src/gui/captureHandler/CaptureTabStateHandler.h000066400000000000000000000041741414701001100236600ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_CAPTURETABSTATEHANDLER_H #define KSNIP_CAPTURETABSTATEHANDLER_H #include #include #include #include "ICaptureTabStateHandler.h" #include "CaptureTabState.h" #include "src/common/dtos/SaveResultDto.h" #include "src/common/dtos/RenameResultDto.h" #include "src/common/helper/PathHelper.h" class CaptureTabStateHandler : public ICaptureTabStateHandler { Q_OBJECT public: explicit CaptureTabStateHandler(); ~CaptureTabStateHandler() override = default; void add(int index, const QString &filename, const QString &path, bool isSaved) override; bool isSaved(int index) override; bool isPathValid(int index) override; QString path(int index) override; QString filename(int index) override; void setSaveState(int index, const SaveResultDto &saveResult) override; void renameFile(int index, const RenameResultDto &renameResult) override; int count() const override; int currentTabIndex() const override; public slots: void tabMoved(int fromIndex, int toIndex) override; void currentTabChanged(int index) override; void tabRemoved(int index) override; void currentTabContentChanged() override; private: int mCurrentTabIndex; QList> mCaptureTabStates; void refreshTabInfo(int index); QSharedPointer getTabState(int index); }; #endif //KSNIP_CAPTURETABSTATEHANDLER_H ksnip-1.9.2/src/gui/captureHandler/ICaptureChangeListener.h000066400000000000000000000020561414701001100236540ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_ICAPTURECHANGELISTENER_H #define KSNIP_ICAPTURECHANGELISTENER_H class ICaptureChangeListener { public: virtual ~ICaptureChangeListener() = default; virtual void captureChanged() = 0; virtual void captureEmpty() = 0; }; #endif //KSNIP_ICAPTURECHANGELISTENER_H ksnip-1.9.2/src/gui/captureHandler/ICaptureHandler.h000066400000000000000000000033151414701001100223350ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_ICAPTUREHANDLER_H #define KSNIP_ICAPTUREHANDLER_H #include "src/gui/captureHandler/ICaptureChangeListener.h" #include "src/common/dtos/CaptureDto.h" class ICaptureHandler : public QObject { public: explicit ICaptureHandler() = default; ~ICaptureHandler() override = default; virtual bool canClose() = 0; virtual bool canTakeNew() = 0; virtual bool isSaved() const = 0; virtual QString path() const = 0; virtual bool isPathValid() const = 0; virtual void saveAs() = 0; virtual void save() = 0; virtual void rename() = 0; virtual void copy() = 0; virtual void copyPath() = 0; virtual void openDirectory() = 0; virtual void removeImage() = 0; virtual void load(const CaptureDto &capture) = 0; virtual QImage image() const = 0; virtual void insertImageItem(const QPointF &pos, const QPixmap &pixmap) = 0; virtual void addListener(ICaptureChangeListener *captureChangeListener) = 0; }; #endif //KSNIP_ICAPTUREHANDLER_H ksnip-1.9.2/src/gui/captureHandler/ICaptureTabStateHandler.h000066400000000000000000000036031414701001100237650ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_ICAPTURETABSTATEHANDLER_H #define KSNIP_ICAPTURETABSTATEHANDLER_H #include struct SaveResultDto; struct RenameResultDto; class ICaptureTabStateHandler : public QObject { Q_OBJECT public: explicit ICaptureTabStateHandler() = default; ~ICaptureTabStateHandler() override = default; virtual void add(int index, const QString &filename, const QString &path, bool isSaved) = 0; virtual bool isSaved(int index) = 0; virtual bool isPathValid(int index) = 0; virtual QString path(int index) = 0; virtual QString filename(int index) = 0; virtual void setSaveState(int index, const SaveResultDto &saveResult) = 0; virtual void renameFile(int index, const RenameResultDto &renameResult) = 0; virtual int count() const = 0; virtual int currentTabIndex() const = 0; signals: void updateTabInfo(int index, const QString &title, const QString &toolTip); public slots: virtual void tabMoved(int fromIndex, int toIndex) = 0; virtual void currentTabChanged(int index) = 0; virtual void tabRemoved(int index) = 0; virtual void currentTabContentChanged() = 0; }; #endif //KSNIP_ICAPTURETABSTATEHANDLER_H ksnip-1.9.2/src/gui/captureHandler/MultiCaptureHandler.cpp000066400000000000000000000250051414701001100235720ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "MultiCaptureHandler.h" MultiCaptureHandler::MultiCaptureHandler(IImageAnnotator *imageAnnotator, IToastService *toastService, IServiceLocator *serviceLocator, ICaptureTabStateHandler *captureTabStateHandler, QWidget *parent) : mImageAnnotator(imageAnnotator), mToastService(toastService), mParent(parent), mCaptureChangeListener(nullptr), mTabStateHandler(captureTabStateHandler), mServiceLocator(serviceLocator), mConfig(KsnipConfigProvider::instance()), mClipboard(mServiceLocator->clipboard()), mDesktopService(mServiceLocator->desktopService()), mSaveContextMenuAction(new TabContextMenuAction(this)), mSaveAsContextMenuAction(new TabContextMenuAction(this)), mRenameContextMenuAction(new TabContextMenuAction(this)), mOpenDirectoryContextMenuAction(new TabContextMenuAction(this)), mCopyPathToClipboardContextMenuAction(new TabContextMenuAction(this)), mCopyToClipboardContextMenuAction(new TabContextMenuAction(this)), mDeleteImageContextMenuAction(new TabContextMenuAction(this)), mContextMenuSeparatorAction(new QAction(this)) { connect(mImageAnnotator, &IImageAnnotator::currentTabChanged, mTabStateHandler, &ICaptureTabStateHandler::currentTabChanged); connect(mImageAnnotator, &IImageAnnotator::tabMoved, mTabStateHandler, &ICaptureTabStateHandler::tabMoved); connect(mImageAnnotator, &IImageAnnotator::imageChanged, mTabStateHandler, &ICaptureTabStateHandler::currentTabContentChanged); connect(mTabStateHandler, &ICaptureTabStateHandler::updateTabInfo, mImageAnnotator, &IImageAnnotator::updateTabInfo); connect(mImageAnnotator, &IImageAnnotator::imageChanged, this, &MultiCaptureHandler::captureChanged); connect(mImageAnnotator, &IImageAnnotator::currentTabChanged, this, &MultiCaptureHandler::captureChanged); connect(mImageAnnotator, &IImageAnnotator::tabCloseRequested, this, &MultiCaptureHandler::tabCloseRequested); connect(mImageAnnotator, &IImageAnnotator::tabContextMenuOpened, this, &MultiCaptureHandler::updateContextMenuActions); connect(mConfig, &KsnipConfig::annotatorConfigChanged, this, &MultiCaptureHandler::annotatorConfigChanged); addTabContextMenuActions(); annotatorConfigChanged(); } MultiCaptureHandler::~MultiCaptureHandler() { delete mTabStateHandler; delete mSaveContextMenuAction; delete mSaveAsContextMenuAction; delete mRenameContextMenuAction; delete mOpenDirectoryContextMenuAction; delete mCopyPathToClipboardContextMenuAction; delete mCopyToClipboardContextMenuAction; delete mDeleteImageContextMenuAction; delete mContextMenuSeparatorAction; } bool MultiCaptureHandler::canClose() { while (mTabStateHandler->count() != 0) { int index = mTabStateHandler->currentTabIndex(); if (!discardChanges(index)) { return false; } removeTab(index); } return true; } bool MultiCaptureHandler::canTakeNew() { return true; } bool MultiCaptureHandler::discardChanges(int index) { auto image = mImageAnnotator->imageAt(index); auto isUnsaved = !mTabStateHandler->isSaved(index); auto pathToSource = mTabStateHandler->path(index); auto filename = mTabStateHandler->filename(index); CanDiscardOperation operation(mParent, image, isUnsaved, pathToSource, filename, mToastService, mServiceLocator->recentImageService()); return operation.execute(); } void MultiCaptureHandler::removeTab(int currentTabIndex) { mImageAnnotator->removeTab(currentTabIndex); mTabStateHandler->tabRemoved(currentTabIndex); captureChanged(); if(mTabStateHandler->count() == 0) { mImageAnnotator->hide(); captureEmpty(); } } bool MultiCaptureHandler::isSaved() const { return mTabStateHandler->isSaved(mTabStateHandler->currentTabIndex()); } QString MultiCaptureHandler::path() const { return mTabStateHandler->path(mTabStateHandler->currentTabIndex()); } bool MultiCaptureHandler::isPathValid() const { return mTabStateHandler->isPathValid(mTabStateHandler->currentTabIndex()); } void MultiCaptureHandler::saveAs() { saveAsTab(mTabStateHandler->currentTabIndex()); } void MultiCaptureHandler::save() { saveTab(mTabStateHandler->currentTabIndex()); } void MultiCaptureHandler::rename() { renameTab(mTabStateHandler->currentTabIndex()); } void MultiCaptureHandler::copy() { copyToClipboardTab(mTabStateHandler->currentTabIndex()); } void MultiCaptureHandler::copyPath() { copyPathToClipboardTab(mTabStateHandler->currentTabIndex()); } void MultiCaptureHandler::openDirectory() { openDirectoryTab(mTabStateHandler->currentTabIndex()); } void MultiCaptureHandler::removeImage() { deleteImageTab(mTabStateHandler->currentTabIndex()); } void MultiCaptureHandler::saveAt(int index, bool isInstant) { auto image = mImageAnnotator->imageAt(index); SaveOperation operation(mParent, image, isInstant, mTabStateHandler->path(index), mToastService, mServiceLocator->recentImageService()); auto saveResult = operation.execute(); mTabStateHandler->setSaveState(index, saveResult); captureChanged(); } void MultiCaptureHandler::load(const CaptureDto &capture) { auto path = mPathFromCaptureProvider.pathFrom(capture); auto isSaved = PathHelper::isPathValid(path); auto filename = mNewCaptureNameProvider.nextName(path); auto index = mImageAnnotator->addTab(capture.screenshot, filename, path); mTabStateHandler->add(index, filename, path, isSaved); if (capture.isCursorValid()) { mImageAnnotator->insertImageItem(capture.cursor.position, capture.cursor.image); } } void MultiCaptureHandler::tabCloseRequested(int index) { if (!discardChanges(index)) { return; } removeTab(index); } QImage MultiCaptureHandler::image() const { return mImageAnnotator->image(); } void MultiCaptureHandler::insertImageItem(const QPointF &pos, const QPixmap &pixmap) { mImageAnnotator->insertImageItem(pos, pixmap); } void MultiCaptureHandler::addListener(ICaptureChangeListener *captureChangeListener) { mCaptureChangeListener = captureChangeListener; } void MultiCaptureHandler::captureChanged() { if(mCaptureChangeListener != nullptr) { mCaptureChangeListener->captureChanged(); } } void MultiCaptureHandler::captureEmpty() { if(mCaptureChangeListener != nullptr) { mCaptureChangeListener->captureEmpty(); } } void MultiCaptureHandler::annotatorConfigChanged() { mImageAnnotator->setTabBarAutoHide(mConfig->autoHideTabs()); } void MultiCaptureHandler::addTabContextMenuActions() { mSaveContextMenuAction->setText(tr("Save")); mSaveContextMenuAction->setIcon(IconLoader::loadForTheme(QLatin1String("save.svg"))); mSaveAsContextMenuAction->setText(tr("Save As")); mSaveAsContextMenuAction->setIcon(IconLoader::loadForTheme(QLatin1String("saveAs.svg"))); mRenameContextMenuAction->setText(tr("Rename")); mOpenDirectoryContextMenuAction->setText(tr("Open Directory")); mCopyToClipboardContextMenuAction->setText(tr("Copy")); mCopyToClipboardContextMenuAction->setIcon(IconLoader::loadForTheme(QLatin1String("copy.svg"))); mCopyPathToClipboardContextMenuAction->setText(tr("Copy Path")); mContextMenuSeparatorAction->setSeparator(true); mDeleteImageContextMenuAction->setText(tr("Delete")); mDeleteImageContextMenuAction->setIcon(IconLoader::loadForTheme(QLatin1String("delete.svg"))); connect(mSaveContextMenuAction, &TabContextMenuAction::triggered, this, &MultiCaptureHandler::saveTab); connect(mSaveAsContextMenuAction, &TabContextMenuAction::triggered, this, &MultiCaptureHandler::saveAsTab); connect(mRenameContextMenuAction, &TabContextMenuAction::triggered, this, &MultiCaptureHandler::renameTab); connect(mOpenDirectoryContextMenuAction, &TabContextMenuAction::triggered, this, &MultiCaptureHandler::openDirectoryTab); connect(mCopyPathToClipboardContextMenuAction, &TabContextMenuAction::triggered, this, &MultiCaptureHandler::copyPathToClipboardTab); connect(mCopyToClipboardContextMenuAction, &TabContextMenuAction::triggered, this, &MultiCaptureHandler::copyToClipboardTab); connect(mDeleteImageContextMenuAction, &TabContextMenuAction::triggered, this, &MultiCaptureHandler::deleteImageTab); auto actions = QList{mSaveContextMenuAction, mSaveAsContextMenuAction, mRenameContextMenuAction, mOpenDirectoryContextMenuAction, mCopyToClipboardContextMenuAction, mCopyPathToClipboardContextMenuAction, mContextMenuSeparatorAction, mDeleteImageContextMenuAction }; mImageAnnotator->addTabContextMenuActions(actions); } void MultiCaptureHandler::saveAsTab(int index) { saveAt(index, false); } void MultiCaptureHandler::saveTab(int index) { saveAt(index, true); } void MultiCaptureHandler::renameTab(int index) { RenameOperation operation(mParent, mTabStateHandler->path(index), mTabStateHandler->filename(index), mToastService); auto renameResult = operation.execute(); if(renameResult.isSuccessful) { mTabStateHandler->renameFile(index, renameResult); captureChanged(); } } void MultiCaptureHandler::updateContextMenuActions(int index) { auto isPathValid = mTabStateHandler->isPathValid(index); mSaveContextMenuAction->setEnabled(!mTabStateHandler->isSaved(index)); mRenameContextMenuAction->setEnabled(isPathValid); mOpenDirectoryContextMenuAction->setEnabled(isPathValid); mCopyPathToClipboardContextMenuAction->setEnabled(isPathValid); mDeleteImageContextMenuAction->setEnabled(isPathValid); } void MultiCaptureHandler::openDirectoryTab(int index) { auto path = mTabStateHandler->path(index); mDesktopService->openFile(PathHelper::extractParentDirectory(path)); } void MultiCaptureHandler::copyToClipboardTab(int index) { auto image = mImageAnnotator->imageAt(index); mClipboard->setImage(image); } void MultiCaptureHandler::copyPathToClipboardTab(int index) { auto path = mTabStateHandler->path(index); mClipboard->setText(path); } void MultiCaptureHandler::deleteImageTab(int index) { auto path = mTabStateHandler->path(index); DeleteImageOperation operation(path, mServiceLocator->fileService(), mServiceLocator->messageBoxService()); if(operation.execute()) { removeTab(index); } } ksnip-1.9.2/src/gui/captureHandler/MultiCaptureHandler.h000066400000000000000000000074311414701001100232420ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_MULTICAPTUREHANDLER_H #define KSNIP_MULTICAPTUREHANDLER_H #include "src/gui/captureHandler/ICaptureHandler.h" #include "src/gui/captureHandler/ICaptureTabStateHandler.h" #include "src/gui/captureHandler/TabContextMenuAction.h" #include "src/gui/operations/CanDiscardOperation.h" #include "src/gui/operations/SaveOperation.h" #include "src/gui/operations/RenameOperation.h" #include "src/gui/operations/DeleteImageOperation.h" #include "src/gui/IToastService.h" #include "src/gui/serviceLocator/IServiceLocator.h" #include "src/gui/imageAnnotator/IImageAnnotator.h" #include "src/common/provider/NewCaptureNameProvider.h" #include "src/common/provider/PathFromCaptureProvider.h" #include "src/common/loader/IconLoader.h" #include "src/backend/config/KsnipConfigProvider.h" class MultiCaptureHandler : public ICaptureHandler { Q_OBJECT public: explicit MultiCaptureHandler(IImageAnnotator *imageAnnotator, IToastService *toastService, IServiceLocator *serviceLocator, ICaptureTabStateHandler *captureTabStateHandler, QWidget *parent); ~MultiCaptureHandler() override; bool canClose() override; bool canTakeNew() override; bool isSaved() const override; QString path() const override; bool isPathValid() const override; void saveAs() override; void save() override; void rename() override; void copy() override; void copyPath() override; void openDirectory() override; void removeImage() override; void load(const CaptureDto &capture) override; QImage image() const override; void insertImageItem(const QPointF &pos, const QPixmap &pixmap) override; void addListener(ICaptureChangeListener *captureChangeListener) override; private: IImageAnnotator *mImageAnnotator; ICaptureTabStateHandler *mTabStateHandler; IToastService *mToastService; QWidget *mParent; ICaptureChangeListener *mCaptureChangeListener; NewCaptureNameProvider mNewCaptureNameProvider; PathFromCaptureProvider mPathFromCaptureProvider; IServiceLocator *mServiceLocator; KsnipConfig *mConfig; IClipboard *mClipboard; IDesktopService *mDesktopService; TabContextMenuAction *mSaveContextMenuAction; TabContextMenuAction *mSaveAsContextMenuAction; TabContextMenuAction *mRenameContextMenuAction; TabContextMenuAction *mOpenDirectoryContextMenuAction; TabContextMenuAction *mCopyPathToClipboardContextMenuAction; TabContextMenuAction *mCopyToClipboardContextMenuAction; TabContextMenuAction *mDeleteImageContextMenuAction; QAction *mContextMenuSeparatorAction; bool discardChanges(int index); void removeTab(int currentTabIndex); void saveAt(int index, bool isInstant); private slots: void tabCloseRequested(int index); void captureChanged(); void captureEmpty(); void annotatorConfigChanged(); void addTabContextMenuActions(); void saveAsTab(int index); void renameTab(int index); void saveTab(int index); void openDirectoryTab(int index); void updateContextMenuActions(int index); void copyToClipboardTab(int index); void copyPathToClipboardTab(int index); void deleteImageTab(int index); }; #endif //KSNIP_MULTICAPTUREHANDLER_H ksnip-1.9.2/src/gui/captureHandler/SingleCaptureHandler.cpp000066400000000000000000000105671414701001100237300ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "SingleCaptureHandler.h" SingleCaptureHandler::SingleCaptureHandler(IImageAnnotator *imageAnnotator, IToastService *toastService, IServiceLocator *serviceLocator, QWidget *parent) : mImageAnnotator(imageAnnotator), mToastService(toastService), mParent(parent), mCaptureChangeListener(nullptr), mIsSaved(true), mServiceLocator(serviceLocator), mClipboard(serviceLocator->clipboard()), mDesktopService(serviceLocator->desktopService()) { mImageAnnotator->setTabBarAutoHide(true); connect(mImageAnnotator, &IImageAnnotator::imageChanged, this, &SingleCaptureHandler::markUnsaved); } bool SingleCaptureHandler::canClose() { return discardChanges(); } bool SingleCaptureHandler::canTakeNew() { return discardChanges(); } bool SingleCaptureHandler::isSaved() const { return mIsSaved; } QString SingleCaptureHandler::path() const { return mPath; } bool SingleCaptureHandler::isPathValid() const { return PathHelper::isPathValid(mPath); } void SingleCaptureHandler::saveAs() { innerSave(false); } void SingleCaptureHandler::save() { innerSave(true); } void SingleCaptureHandler::rename() { RenameOperation operation(mParent, mPath, QFileInfo(mPath).fileName(), mToastService); const auto renameResult = operation.execute(); if (renameResult.isSuccessful) { mPath = renameResult.path; captureChanged(); } } void SingleCaptureHandler::copy() { auto image = mImageAnnotator->image(); mClipboard->setImage(image); } void SingleCaptureHandler::copyPath() { mClipboard->setText(mPath); } void SingleCaptureHandler::openDirectory() { mDesktopService->openFile(PathHelper::extractParentDirectory(mPath)); } void SingleCaptureHandler::removeImage() { DeleteImageOperation operation(mPath, mServiceLocator->fileService(), mServiceLocator->messageBoxService()); if(operation.execute()){ reset(); } } void SingleCaptureHandler::reset() { mImageAnnotator->hide(); mPath = QString(); mIsSaved = true; captureEmpty(); captureChanged(); } void SingleCaptureHandler::innerSave(bool isInstant) { auto image = mImageAnnotator->image(); SaveOperation operation(mParent, image, isInstant, mPath, mToastService, mServiceLocator->recentImageService()); auto saveResult = operation.execute(); mIsSaved = saveResult.isSuccessful; if (mIsSaved) { mPath = saveResult.path; captureChanged(); } } void SingleCaptureHandler::load(const CaptureDto &capture) { mPath = mPathFromCaptureProvider.pathFrom(capture); mIsSaved = PathHelper::isPathValid(mPath); mImageAnnotator->loadImage(capture.screenshot); if (capture.isCursorValid()) { mImageAnnotator->insertImageItem(capture.cursor.position, capture.cursor.image); } } QImage SingleCaptureHandler::image() const { return mImageAnnotator->image(); } void SingleCaptureHandler::insertImageItem(const QPointF &pos, const QPixmap &pixmap) { mImageAnnotator->insertImageItem(pos, pixmap); } void SingleCaptureHandler::addListener(ICaptureChangeListener *captureChangeListener) { mCaptureChangeListener = captureChangeListener; } bool SingleCaptureHandler::discardChanges() { auto image = mImageAnnotator->image(); auto filename = PathHelper::extractFilename(mPath); CanDiscardOperation operation(mParent, image, !mIsSaved, mPath, filename, mToastService, mServiceLocator->recentImageService()); return operation.execute(); } void SingleCaptureHandler::captureChanged() { if(mCaptureChangeListener != nullptr) { mCaptureChangeListener->captureChanged(); } } void SingleCaptureHandler::captureEmpty() { if(mCaptureChangeListener != nullptr) { mCaptureChangeListener->captureEmpty(); } } void SingleCaptureHandler::markUnsaved() { mIsSaved = false; captureChanged(); } ksnip-1.9.2/src/gui/captureHandler/SingleCaptureHandler.h000066400000000000000000000050741414701001100233720ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_SINGLECAPTUREHANDLER_H #define KSNIP_SINGLECAPTUREHANDLER_H #include "src/gui/captureHandler/ICaptureHandler.h" #include "src/gui/operations/CanDiscardOperation.h" #include "src/gui/operations/DeleteImageOperation.h" #include "src/gui/operations/RenameOperation.h" #include "src/gui/IToastService.h" #include "src/gui/serviceLocator/IServiceLocator.h" #include "src/gui/imageAnnotator/IImageAnnotator.h" #include "src/common/provider/PathFromCaptureProvider.h" class SingleCaptureHandler : public ICaptureHandler { Q_OBJECT public: explicit SingleCaptureHandler(IImageAnnotator *imageAnnotator, IToastService *toastService, IServiceLocator *serviceLocator, QWidget *parent); ~SingleCaptureHandler() override = default; bool canClose() override; bool canTakeNew() override; bool isSaved() const override; QString path() const override; bool isPathValid() const override; void saveAs() override; void save() override; void rename() override; void copy() override; void copyPath() override; void openDirectory() override; void removeImage() override; void load(const CaptureDto &capture) override; QImage image() const override; void insertImageItem(const QPointF &pos, const QPixmap &pixmap) override; void addListener(ICaptureChangeListener *captureChangeListener) override; private: IImageAnnotator *mImageAnnotator; IToastService *mToastService; QWidget *mParent; ICaptureChangeListener *mCaptureChangeListener; bool mIsSaved; QString mPath; IServiceLocator *mServiceLocator; IClipboard *mClipboard; IDesktopService *mDesktopService; PathFromCaptureProvider mPathFromCaptureProvider; bool discardChanges(); private slots: void captureChanged(); void captureEmpty(); void innerSave(bool isInstant); void markUnsaved(); void reset(); }; #endif //KSNIP_SINGLECAPTUREHANDLER_H ksnip-1.9.2/src/gui/captureHandler/TabContextMenuAction.cpp000066400000000000000000000020631414701001100237130ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "TabContextMenuAction.h" TabContextMenuAction::TabContextMenuAction(QObject *parent) : QAction(parent) { connect(this, &QAction::triggered, this, &TabContextMenuAction::actionTriggered); } void TabContextMenuAction::actionTriggered() { emit triggered(data().toInt()); } ksnip-1.9.2/src/gui/captureHandler/TabContextMenuAction.h000066400000000000000000000022271414701001100233620ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_TABCONTEXTMENUACTION_H #define KSNIP_TABCONTEXTMENUACTION_H #include class TabContextMenuAction : public QAction { Q_OBJECT public: explicit TabContextMenuAction(QObject *parent = nullptr); ~TabContextMenuAction() override = default; signals: void triggered(int index); private slots: void actionTriggered(); }; #endif //KSNIP_TABCONTEXTMENUACTION_H ksnip-1.9.2/src/gui/clipboard/000077500000000000000000000000001414701001100161465ustar00rootroot00000000000000ksnip-1.9.2/src/gui/clipboard/ClipboardAdapter.cpp000066400000000000000000000031441414701001100220540ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "ClipboardAdapter.h" ClipboardAdapter::ClipboardAdapter() : mClipboard(QGuiApplication::clipboard()) { connect(mClipboard, &QClipboard::changed, this, &ClipboardAdapter::selectionChanged); } QPixmap ClipboardAdapter::pixmap() const { auto pixmap = mClipboard->pixmap(); if(pixmap.isNull()) { pixmap = QPixmap(url()); } return pixmap; } QString ClipboardAdapter::url() const { return FileUrlHelper::toPath(mClipboard->text()); } bool ClipboardAdapter::isPixmap() const { return !pixmap().isNull(); } void ClipboardAdapter::setImage(const QImage &image) { mClipboard->setImage(image); } void ClipboardAdapter::selectionChanged(QClipboard::Mode mode) const { if(mode == QClipboard::Mode::Clipboard) { emit changed(isPixmap()); } } void ClipboardAdapter::setText(const QString &text) { mClipboard->setText(text); } ksnip-1.9.2/src/gui/clipboard/ClipboardAdapter.h000066400000000000000000000027511414701001100215240ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_CLIPBOARDADAPTER_H #define KSNIP_CLIPBOARDADAPTER_H #include #include #include #include "IClipboard.h" #include "src/common/dtos/CaptureFromFileDto.h" #include "src/common/helper/FileUrlHelper.h" class ClipboardAdapter : public IClipboard { Q_OBJECT public: explicit ClipboardAdapter(); ~ClipboardAdapter() override = default; QPixmap pixmap() const override; bool isPixmap() const override; void setImage(const QImage &image) override; void setText(const QString &text) override; QString url() const override; private: QClipboard *mClipboard{}; private slots: void selectionChanged(QClipboard::Mode mode) const; }; #endif //KSNIP_CLIPBOARDADAPTER_H ksnip-1.9.2/src/gui/clipboard/IClipboard.h000066400000000000000000000023701414701001100203310ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_ICLIPBOARD_H #define KSNIP_ICLIPBOARD_H #include class IClipboard : public QObject { Q_OBJECT public: explicit IClipboard() = default; ~IClipboard() override = default; virtual QPixmap pixmap() const = 0; virtual bool isPixmap() const = 0; virtual void setImage(const QImage &image) = 0; virtual void setText(const QString &text) = 0; virtual QString url() const = 0; signals: void changed(bool isPixmap) const; }; #endif //KSNIP_ICLIPBOARD_H ksnip-1.9.2/src/gui/desktopService/000077500000000000000000000000001414701001100172015ustar00rootroot00000000000000ksnip-1.9.2/src/gui/desktopService/DesktopServiceAdapter.cpp000066400000000000000000000022251414701001100241410ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "DesktopServiceAdapter.h" void DesktopServiceAdapter::openFile(const QString &path) { // Workaround for issue #432, Qt unable to open file path in snap #if defined(UNIX_X11) if(PlatformChecker::instance()->isSnap()) { mXdgOpenProcess.start(QLatin1String("xdg-open"), QStringList{ path }); return; } #endif QDesktopServices::openUrl(QUrl::fromLocalFile(path)); } ksnip-1.9.2/src/gui/desktopService/DesktopServiceAdapter.h000066400000000000000000000025111414701001100236040ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_DESKTOPSERVICEADAPTER_H #define KSNIP_DESKTOPSERVICEADAPTER_H #include #include #if defined(UNIX_X11) #include #include "src/common/platform/PlatformChecker.h" #endif #include "IDesktopService.h" class DesktopServiceAdapter : public IDesktopService { public: explicit DesktopServiceAdapter() = default; ~DesktopServiceAdapter() override = default; void openFile(const QString &path) override; #if defined(UNIX_X11) private: QProcess mXdgOpenProcess; #endif }; #endif //KSNIP_DESKTOPSERVICEADAPTER_H ksnip-1.9.2/src/gui/desktopService/IDesktopService.h000066400000000000000000000020521414701001100224140ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_IDESKTOPSERVICE_H #define KSNIP_IDESKTOPSERVICE_H class QUrl; class IDesktopService { public: explicit IDesktopService() = default; virtual ~IDesktopService() = default; virtual void openFile(const QString &path) = 0; }; #endif //KSNIP_IDESKTOPSERVICE_H ksnip-1.9.2/src/gui/dragAndDrop/000077500000000000000000000000001414701001100163745ustar00rootroot00000000000000ksnip-1.9.2/src/gui/dragAndDrop/DragAndDropProcessor.cpp000066400000000000000000000112501414701001100231240ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "DragAndDropProcessor.h" DragAndDropProcessor::DragAndDropProcessor(IDragContentProvider *dragContentProvider) : mDragContentProvider(dragContentProvider) { } bool DragAndDropProcessor::eventFilter(QObject *object, QEvent *event) { if(event->type() == QEvent::DragEnter) { return handleDragEnter(dynamic_cast(event)); } else if(event->type() == QEvent::Drop) { return handleDrop(dynamic_cast(event)); } else if(event->type() == QEvent::GraphicsSceneDrop) { return handleDrop(dynamic_cast(event)); } else if (event->type() == QEvent::GraphicsSceneDragEnter) { return handleDragEnter(dynamic_cast(event)); } else if (event->type() == QEvent::MouseButtonPress) { return handleDragStart(dynamic_cast(event)); } else if (event->type() == QEvent::MouseMove) { return handleDragMove(dynamic_cast(event)); } return QObject::eventFilter(object, event); } bool DragAndDropProcessor::handleDragEnter(QDragEnterEvent *event) { if (event->mimeData()->hasUrls()) { event->acceptProposedAction(); return true; } return false; } bool DragAndDropProcessor::handleDragEnter(QGraphicsSceneDragDropEvent *event) { if (event->mimeData()->hasUrls()) { event->acceptProposedAction(); return true; } return false; } bool DragAndDropProcessor::handleDrop(QDropEvent *event) { auto paths = getUrlsFromMimeData(event->mimeData()); processDroppedImagePaths(paths); event->acceptProposedAction(); return true; } bool DragAndDropProcessor::handleDrop(QGraphicsSceneDragDropEvent *event) { auto paths = getUrlsFromMimeData(event->mimeData()); processDroppedImagePaths(paths); event->acceptProposedAction(); return true; } bool DragAndDropProcessor::handleDragStart(QMouseEvent *event) { if (isDragStarting(event)) { mDragStartPosition = event->pos(); return true; } return false; } bool DragAndDropProcessor::handleDragMove(QMouseEvent *event) { if (isDragStarting(event) && isMinDragDistanceReached(event)) { auto dragContent = mDragContentProvider->dragContent(); if (dragContent.isValid()) { createDrag(dragContent); return true; } } return false; } QStringList DragAndDropProcessor::getUrlsFromMimeData(const QMimeData *mimeData) { QStringList urls; for (const auto &url : mimeData->urls()) { urls.push_back(FileUrlHelper::toPath(url.toString())); } return urls; } bool DragAndDropProcessor::isDragStarting(const QMouseEvent *event) { return event->buttons() & Qt::LeftButton && event->modifiers() & Qt::ShiftModifier; } bool DragAndDropProcessor::isMinDragDistanceReached(const QMouseEvent *event) const { return (event->pos() - mDragStartPosition).manhattanLength() >= QApplication::startDragDistance(); } void DragAndDropProcessor::createDrag(const DragContent &dragContent) { auto imagePath = getPathToDraggedImage(dragContent); auto mimeData = new QMimeData; mimeData->setUrls( { QUrl(FileUrlHelper::toFileUrl(imagePath)) }); mimeData->setData(QLatin1String("text/uri-list"), FileUrlHelper::toFileUrl(imagePath).toLatin1()); auto icon = QPixmap::fromImage(dragContent.image).scaled(256, 256, Qt::KeepAspectRatio, Qt::FastTransformation); auto drag = new QDrag(this); drag->setMimeData(mimeData); drag->setPixmap(icon); drag->exec(); } QString DragAndDropProcessor::getPathToDraggedImage(const DragContent &dragContent) { QString imagePath; if (dragContent.isSaved) { imagePath = dragContent.path; } else{ imagePath = TempFileProvider::tempFile(); if(!dragContent.image.save(imagePath)){ qWarning("Failed to save temporary dragImage %s for drag and drop operation.", qPrintable(imagePath)); } } return imagePath; } void DragAndDropProcessor::processDroppedImagePaths(const QStringList &paths) { for(const auto& path: paths) { if (PathHelper::isTempDirectory(path)) { emit imageDropped(QPixmap(path)); } else { emit fileDropped(path); } } } ksnip-1.9.2/src/gui/dragAndDrop/DragAndDropProcessor.h000066400000000000000000000045141414701001100225760ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_DRAGANDDROPPROCESSOR_H #define KSNIP_DRAGANDDROPPROCESSOR_H #include #include #include #include #include #include #include #include #include #include #include "IDragContentProvider.h" #include "src/common/helper/FileUrlHelper.h" #include "src/common/helper/PathHelper.h" #include "src/common/provider/TempFileProvider.h" class DragAndDropProcessor : public QObject { Q_OBJECT public: explicit DragAndDropProcessor(IDragContentProvider *dragContentProvider); ~DragAndDropProcessor() override = default; bool eventFilter(QObject *object, QEvent *event) override; signals: void fileDropped(const QString &path); void imageDropped(const QPixmap &pixmap); private: IDragContentProvider *mDragContentProvider; QPoint mDragStartPosition; static bool handleDragEnter(QDragEnterEvent *event); static bool handleDragEnter(QGraphicsSceneDragDropEvent *event); bool handleDrop(QDropEvent *event); bool handleDrop(QGraphicsSceneDragDropEvent *event); bool handleDragStart(QMouseEvent *event); bool handleDragMove(QMouseEvent *event); static QStringList getUrlsFromMimeData(const QMimeData *mimeData); static bool isDragStarting(const QMouseEvent *event); bool isMinDragDistanceReached(const QMouseEvent *event) const; void createDrag(const DragContent &dragContent); static QString getPathToDraggedImage(const DragContent &dragContent); void processDroppedImagePaths(const QStringList &paths); }; #endif //KSNIP_DRAGANDDROPPROCESSOR_H ksnip-1.9.2/src/gui/dragAndDrop/DragContent.h000066400000000000000000000024001414701001100207510ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_DRAGCONTENT_H #define KSNIP_DRAGCONTENT_H #include struct DragContent { QImage image; QString path; bool isSaved; explicit DragContent() { image = QImage(); path = QString(); isSaved = false; } explicit DragContent(const QImage &image, const QString &path, bool isSaved) { this->image = image.copy(); this->path = path; this->isSaved = isSaved; } virtual bool isValid() const { return !image.isNull(); } }; #endif //KSNIP_DRAGCONTENT_H ksnip-1.9.2/src/gui/dragAndDrop/IDragContentProvider.h000066400000000000000000000021011414701001100225730ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_IDRAGCONTENTPROVIDER_H #define KSNIP_IDRAGCONTENTPROVIDER_H #include "DragContent.h" class IDragContentProvider { public: IDragContentProvider() = default; ~IDragContentProvider() = default; virtual DragContent dragContent() const = 0; }; #endif //KSNIP_IDRAGCONTENTPROVIDER_H ksnip-1.9.2/src/gui/fileService/000077500000000000000000000000001414701001100164475ustar00rootroot00000000000000ksnip-1.9.2/src/gui/fileService/FileService.cpp000066400000000000000000000017371414701001100213630ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "FileService.h" bool FileService::remove(const QString &path) { QFile file(path); return file.remove(); } QPixmap FileService::openPixmap(const QString &path) { return QPixmap(path); } ksnip-1.9.2/src/gui/fileService/FileService.h000066400000000000000000000021701414701001100210200ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_FILESERVICE_H #define KSNIP_FILESERVICE_H #include #include "IFileService.h" class FileService : public IFileService { public: explicit FileService() = default; ~FileService() override = default; bool remove(const QString &path) override; QPixmap openPixmap(const QString &path) override; }; #endif //KSNIP_FILESERVICE_H ksnip-1.9.2/src/gui/fileService/IFileService.h000066400000000000000000000021461414701001100211340ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_IFILESERVICE_H #define KSNIP_IFILESERVICE_H #include #include class IFileService { public: explicit IFileService() = default; virtual ~IFileService() = default; virtual bool remove(const QString &path) = 0; virtual QPixmap openPixmap(const QString &path) = 0; }; #endif //KSNIP_IFILESERVICE_H ksnip-1.9.2/src/gui/globalHotKeys/000077500000000000000000000000001414701001100167565ustar00rootroot00000000000000ksnip-1.9.2/src/gui/globalHotKeys/AbstractKeyHandler.cpp000066400000000000000000000015021414701001100231720ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "AbstractKeyHandler.h" ksnip-1.9.2/src/gui/globalHotKeys/AbstractKeyHandler.h000066400000000000000000000022241414701001100226410ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_ABSTRACTKEYHANDLER_H #define KSNIP_ABSTRACTKEYHANDLER_H #include class AbstractKeyHandler { public: AbstractKeyHandler() = default; virtual ~AbstractKeyHandler() = default; virtual bool registerKey(const QKeySequence &keySequence) = 0; virtual bool isKeyPressed(void* message) = 0; }; #endif //KSNIP_ABSTRACTKEYHANDLER_H ksnip-1.9.2/src/gui/globalHotKeys/DummyKeyHandler.cpp000066400000000000000000000017411414701001100225270ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "DummyKeyHandler.h" bool DummyKeyHandler::registerKey(const QKeySequence &keySequence) { return false; } bool DummyKeyHandler::isKeyPressed(void* message) { return false; }ksnip-1.9.2/src/gui/globalHotKeys/DummyKeyHandler.h000066400000000000000000000022411414701001100221700ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_DUMMYKEYHANDLER_H #define KSNIP_DUMMYKEYHANDLER_H #include "AbstractKeyHandler.h" class DummyKeyHandler : public AbstractKeyHandler { public: DummyKeyHandler() = default; ~DummyKeyHandler() override = default; bool registerKey(const QKeySequence &keySequence) override; bool isKeyPressed(void* message) override; }; #endif //KSNIP_DUMMYKEYHANDLER_H ksnip-1.9.2/src/gui/globalHotKeys/GlobalHotKey.cpp000066400000000000000000000024561414701001100220150ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "GlobalHotKey.h" GlobalHotKey::GlobalHotKey(QCoreApplication *app, const QKeySequence &keySequence) { mApp = app; auto keyHandler = KeyHandlerFactory::create(); keyHandler->registerKey(keySequence); mKeyEventFilter = new NativeKeyEventFilter(keyHandler); mApp->installNativeEventFilter(mKeyEventFilter); connect(mKeyEventFilter, &NativeKeyEventFilter::triggered, this, &GlobalHotKey::pressed); } GlobalHotKey::~GlobalHotKey() { mApp->removeNativeEventFilter(mKeyEventFilter); delete mKeyEventFilter; } ksnip-1.9.2/src/gui/globalHotKeys/GlobalHotKey.h000066400000000000000000000024141414701001100214540ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_GLOBALHOTKEY_H #define KSNIP_GLOBALHOTKEY_H #include #include #include "NativeKeyEventFilter.h" #include "KeyHandlerFactory.h" class GlobalHotKey : public QObject { Q_OBJECT public: explicit GlobalHotKey(QCoreApplication *app, const QKeySequence &keySequence); ~GlobalHotKey() override; signals: void pressed() const; private: QCoreApplication *mApp; NativeKeyEventFilter *mKeyEventFilter; }; #endif //KSNIP_GLOBALHOTKEY_H ksnip-1.9.2/src/gui/globalHotKeys/GlobalHotKeyHandler.cpp000066400000000000000000000061651414701001100233140ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "GlobalHotKeyHandler.h" GlobalHotKeyHandler::GlobalHotKeyHandler(const QList &supportedCaptureModes) { mSupportedCaptureModes = supportedCaptureModes; mConfig = KsnipConfigProvider::instance(); connect(mConfig, &KsnipConfig::hotKeysChanged, this, &GlobalHotKeyHandler::setupHotKeys); setupHotKeys(); } GlobalHotKeyHandler::~GlobalHotKeyHandler() { removeHotKeys(); } void GlobalHotKeyHandler::removeHotKeys() { mGlobalHotKeys.clear(); } void GlobalHotKeyHandler::setupHotKeys() { removeHotKeys(); if(mConfig->globalHotKeysEnabled()) { createHotKey(mConfig->rectAreaHotKey(), CaptureModes::RectArea); createHotKey(mConfig->lastRectAreaHotKey(), CaptureModes::LastRectArea); createHotKey(mConfig->fullScreenHotKey(), CaptureModes::FullScreen); createHotKey(mConfig->currentScreenHotKey(), CaptureModes::CurrentScreen); createHotKey(mConfig->activeWindowHotKey(), CaptureModes::ActiveWindow); createHotKey(mConfig->windowUnderCursorHotKey(), CaptureModes::WindowUnderCursor); createHotKey(mConfig->windowUnderCursorHotKey(), CaptureModes::Portal); auto actions = mConfig->actions(); for (const auto& action : actions) { createHotKey(action); } } } void GlobalHotKeyHandler::createHotKey(const QKeySequence &keySequence, CaptureModes captureMode) { if(mSupportedCaptureModes.contains(captureMode) && !keySequence.isEmpty()) { auto hotKey = QSharedPointer(new GlobalHotKey(QApplication::instance(), keySequence)); connect(hotKey.data(), &GlobalHotKey::pressed, [this, captureMode](){ emit captureTriggered(captureMode); }); mGlobalHotKeys.append(hotKey); } } void GlobalHotKeyHandler::createHotKey(const Action &action) { auto isShortcutSet = !action.shortcut().isEmpty(); auto isPostProcessingOnlyAction = !action.isCaptureEnabled(); auto isRequestedCaptureSupported = action.isCaptureEnabled() && mSupportedCaptureModes.contains(action.captureMode()); if(isShortcutSet && (isPostProcessingOnlyAction || isRequestedCaptureSupported)) { auto hotKey = QSharedPointer(new GlobalHotKey(QApplication::instance(), action.shortcut())); connect(hotKey.data(), &GlobalHotKey::pressed, [this, action](){ emit actionTriggered(action); }); mGlobalHotKeys.append(hotKey); } } void GlobalHotKeyHandler::setEnabled(bool enabled) { if(enabled) { setupHotKeys(); } else { removeHotKeys(); } } ksnip-1.9.2/src/gui/globalHotKeys/GlobalHotKeyHandler.h000066400000000000000000000033111414701001100227470ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_GLOBALHOTKEYHANDLER_H #define KSNIP_GLOBALHOTKEYHANDLER_H #include #include #include #include "GlobalHotKey.h" #include "src/backend/config/KsnipConfigProvider.h" #include "src/common/enum/CaptureModes.h" class GlobalHotKeyHandler : public QObject { Q_OBJECT public: explicit GlobalHotKeyHandler(const QList &supportedCaptureModes); ~GlobalHotKeyHandler() override; void setEnabled(bool enabled); signals: void captureTriggered(CaptureModes captureMode) const; void actionTriggered(const Action &action) const; private: KsnipConfig *mConfig; QList> mGlobalHotKeys; QList mSupportedCaptureModes; void removeHotKeys(); void createHotKey(const QKeySequence &keySequence, CaptureModes captureMode); void createHotKey(const Action &action); private slots: void setupHotKeys(); }; #endif //KSNIP_GLOBALHOTKEYHANDLER_H ksnip-1.9.2/src/gui/globalHotKeys/HotKeyMap.cpp000066400000000000000000000114531414701001100213270ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "HotKeyMap.h" HotKeyMap *HotKeyMap::instance() { static HotKeyMap instance; return &instance; } HotKeyMap::HotKeyMap() { // Numbers mKeyToStringMap[Qt::Key_0] = QLatin1String("0"); mKeyToStringMap[Qt::Key_1] = QLatin1String("1"); mKeyToStringMap[Qt::Key_2] = QLatin1String("2"); mKeyToStringMap[Qt::Key_3] = QLatin1String("3"); mKeyToStringMap[Qt::Key_4] = QLatin1String("4"); mKeyToStringMap[Qt::Key_5] = QLatin1String("5"); mKeyToStringMap[Qt::Key_6] = QLatin1String("6"); mKeyToStringMap[Qt::Key_7] = QLatin1String("7"); mKeyToStringMap[Qt::Key_8] = QLatin1String("8"); mKeyToStringMap[Qt::Key_9] = QLatin1String("9"); // Misc mKeyToStringMap[Qt::Key_Escape] = QLatin1String("ESCAPE"); mKeyToStringMap[Qt::Key_Backspace] = QLatin1String("BACKSPACE"); mKeyToStringMap[Qt::Key_Return] = QLatin1String("RETURN"); mKeyToStringMap[Qt::Key_Enter] = QLatin1String("ENTER"); mKeyToStringMap[Qt::Key_Insert] = QLatin1String("INS"); mKeyToStringMap[Qt::Key_Delete] = QLatin1String("DEL"); mKeyToStringMap[Qt::Key_Pause] = QLatin1String("PAUSE"); mKeyToStringMap[Qt::Key_Print] = QLatin1String("PRINT"); mKeyToStringMap[Qt::Key_Home] = QLatin1String("HOME"); mKeyToStringMap[Qt::Key_End] = QLatin1String("END"); mKeyToStringMap[Qt::Key_Left] = QLatin1String("LEFT"); mKeyToStringMap[Qt::Key_Up] = QLatin1String("UP"); mKeyToStringMap[Qt::Key_Right] = QLatin1String("RIGHT"); mKeyToStringMap[Qt::Key_Down] = QLatin1String("DOWN"); mKeyToStringMap[Qt::Key_PageUp] = QLatin1String("PGUP"); mKeyToStringMap[Qt::Key_PageDown] = QLatin1String("PGDOWN"); mKeyToStringMap[Qt::Key_Comma] = QLatin1String(","); mKeyToStringMap[Qt::Key_Underscore] = QLatin1String("_"); mKeyToStringMap[Qt::Key_Minus] = QLatin1String("-"); mKeyToStringMap[Qt::Key_Period] = QLatin1String("."); mKeyToStringMap[Qt::Key_Slash] = QLatin1String("/"); mKeyToStringMap[Qt::Key_Colon] = QLatin1String(":"); mKeyToStringMap[Qt::Key_Semicolon] = QLatin1String(";"); // F-Keys mKeyToStringMap[Qt::Key_F1] = QLatin1String("F1"); mKeyToStringMap[Qt::Key_F2] = QLatin1String("F2"); mKeyToStringMap[Qt::Key_F3] = QLatin1String("F3"); mKeyToStringMap[Qt::Key_F4] = QLatin1String("F4"); mKeyToStringMap[Qt::Key_F5] = QLatin1String("F5"); mKeyToStringMap[Qt::Key_F6] = QLatin1String("F6"); mKeyToStringMap[Qt::Key_F7] = QLatin1String("F7"); mKeyToStringMap[Qt::Key_F8] = QLatin1String("F8"); mKeyToStringMap[Qt::Key_F9] = QLatin1String("F9"); mKeyToStringMap[Qt::Key_F10] = QLatin1String("F10"); mKeyToStringMap[Qt::Key_F11] = QLatin1String("F11"); mKeyToStringMap[Qt::Key_F12] = QLatin1String("F12"); // Letters mKeyToStringMap[Qt::Key_A] = QLatin1String("A"); mKeyToStringMap[Qt::Key_B] = QLatin1String("B"); mKeyToStringMap[Qt::Key_C] = QLatin1String("C"); mKeyToStringMap[Qt::Key_D] = QLatin1String("D"); mKeyToStringMap[Qt::Key_E] = QLatin1String("E"); mKeyToStringMap[Qt::Key_F] = QLatin1String("F"); mKeyToStringMap[Qt::Key_G] = QLatin1String("G"); mKeyToStringMap[Qt::Key_H] = QLatin1String("H"); mKeyToStringMap[Qt::Key_I] = QLatin1String("I"); mKeyToStringMap[Qt::Key_J] = QLatin1String("J"); mKeyToStringMap[Qt::Key_K] = QLatin1String("K"); mKeyToStringMap[Qt::Key_L] = QLatin1String("L"); mKeyToStringMap[Qt::Key_M] = QLatin1String("M"); mKeyToStringMap[Qt::Key_N] = QLatin1String("N"); mKeyToStringMap[Qt::Key_O] = QLatin1String("O"); mKeyToStringMap[Qt::Key_P] = QLatin1String("P"); mKeyToStringMap[Qt::Key_Q] = QLatin1String("Q"); mKeyToStringMap[Qt::Key_R] = QLatin1String("R"); mKeyToStringMap[Qt::Key_S] = QLatin1String("S"); mKeyToStringMap[Qt::Key_T] = QLatin1String("T"); mKeyToStringMap[Qt::Key_U] = QLatin1String("U"); mKeyToStringMap[Qt::Key_V] = QLatin1String("V"); mKeyToStringMap[Qt::Key_W] = QLatin1String("W"); mKeyToStringMap[Qt::Key_X] = QLatin1String("X"); mKeyToStringMap[Qt::Key_Y] = QLatin1String("Y"); mKeyToStringMap[Qt::Key_Z] = QLatin1String("Z"); } Qt::Key HotKeyMap::getKeyForString(const QString &string) const { return mKeyToStringMap.key(string); } QList HotKeyMap::getAllKeys() const { return mKeyToStringMap.keys(); } ksnip-1.9.2/src/gui/globalHotKeys/HotKeyMap.h000066400000000000000000000022531414701001100207720ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_HOTKEYMAP_H #define KSNIP_HOTKEYMAP_H #include #include #include #include class HotKeyMap { public: static HotKeyMap *instance(); Qt::Key getKeyForString(const QString &string) const; QList getAllKeys() const; private: QHash mKeyToStringMap; HotKeyMap(); ~HotKeyMap() = default; }; #endif //KSNIP_HOTKEYMAP_H ksnip-1.9.2/src/gui/globalHotKeys/KeyCodeCombo.h000066400000000000000000000021231414701001100214300ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_KEYCODECOMBO_H #define KSNIP_KEYCODECOMBO_H struct KeyCodeCombo { unsigned int modifier; unsigned int key; explicit KeyCodeCombo(unsigned int modifier, unsigned int key) { this->modifier = modifier; this->key = key; } explicit KeyCodeCombo() = default; }; #endif //KSNIP_KEYCODECOMBO_H ksnip-1.9.2/src/gui/globalHotKeys/KeyHandlerFactory.cpp000066400000000000000000000022231414701001100230370ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "KeyHandlerFactory.h" AbstractKeyHandler* KeyHandlerFactory::create() { #if defined(__APPLE__) return new DummyKeyHandler; #endif #if defined(UNIX_X11) if(PlatformChecker::instance()->isWayland()) { return new DummyKeyHandler; } else { return new X11KeyHandler; } #endif #if defined(_WIN32) return new WinKeyHandler; #endif } ksnip-1.9.2/src/gui/globalHotKeys/KeyHandlerFactory.h000066400000000000000000000023241414701001100225060ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_KEYHANDLERFACTORY_H #define KSNIP_KEYHANDLERFACTORY_H #if defined(__APPLE__) #include "DummyKeyHandler.h" #endif #if defined(UNIX_X11) #include "X11KeyHandler.h" #include "DummyKeyHandler.h" #include "src/common/platform/PlatformChecker.h" #endif #if defined(_WIN32) #include "WinKeyHandler.h" #endif class KeyHandlerFactory { public: static AbstractKeyHandler* create(); }; #endif //KSNIP_KEYHANDLERFACTORY_H ksnip-1.9.2/src/gui/globalHotKeys/KeySequenceToMacKeyCodeTranslator.cpp000066400000000000000000000032061414701001100261460ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "KeySequenceToMacKeyCodeTranslator.h" KeySequenceToMacKeyCodeTranslator::KeySequenceToMacKeyCodeTranslator() { mHotKeyMap = HotKeyMap::instance(); } KeyCodeCombo KeySequenceToMacKeyCodeTranslator::map(const QKeySequence &keySequence) const { auto sequenceString = keySequence.toString().toUpper(); auto modifierString = sequenceString.section(QLatin1String("+"), 0, -2); auto keyString = sequenceString.section(QLatin1String("+"), -1, -1); auto modifier = getModifier(modifierString); auto key = getKey(keyString); return KeyCodeCombo(modifier, key); } unsigned int KeySequenceToMacKeyCodeTranslator::getModifier(const QString &modifierString) const { unsigned int modifier = 0; return modifier; } unsigned int KeySequenceToMacKeyCodeTranslator::getKey(const QString &keyString) const { auto key = mHotKeyMap->getKeyForString(keyString); return key; } ksnip-1.9.2/src/gui/globalHotKeys/KeySequenceToMacKeyCodeTranslator.h000066400000000000000000000025021414701001100256110ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_KEYSEQUENCETOMACKEYCODETRANSLATOR_H #define KSNIP_KEYSEQUENCETOMACKEYCODETRANSLATOR_H #include "KeyCodeCombo.h" #include "HotKeyMap.h" class KeySequenceToMacKeyCodeTranslator { public: KeySequenceToMacKeyCodeTranslator(); ~KeySequenceToMacKeyCodeTranslator() = default; KeyCodeCombo map(const QKeySequence &keySequence) const; private: HotKeyMap *mHotKeyMap; unsigned int getModifier(const QString &modifierString) const; unsigned int getKey(const QString &keyString) const; }; #endif //KSNIP_KEYSEQUENCETOMACKEYCODETRANSLATOR_H ksnip-1.9.2/src/gui/globalHotKeys/KeySequenceToWinKeyCodeTranslator.cpp000066400000000000000000000063051414701001100262060ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "KeySequenceToWinKeyCodeTranslator.h" KeySequenceToWinKeyCodeTranslator::KeySequenceToWinKeyCodeTranslator() { mHotKeyMap = HotKeyMap::instance(); } KeyCodeCombo KeySequenceToWinKeyCodeTranslator::map(const QKeySequence &keySequence) const { auto sequenceString = keySequence.toString().toUpper(); auto modifierString = sequenceString.section(QLatin1String("+"), 0, -2); auto keyString = sequenceString.section(QLatin1String("+"), -1, -1); auto modifier = getModifier(modifierString); auto key = getKey(keyString); return KeyCodeCombo(modifier, key); } unsigned int KeySequenceToWinKeyCodeTranslator::getModifier(const QString &modifierString) const { unsigned int modifier = MOD_NOREPEAT; if (modifierString.contains(QLatin1String("SHIFT"))) { modifier |= MOD_SHIFT; } if (modifierString.contains(QLatin1String("ALT"))) { modifier |= MOD_ALT; } if (modifierString.contains(QLatin1String("CTRL"))) { modifier |= MOD_CONTROL; } return modifier; } unsigned int KeySequenceToWinKeyCodeTranslator::getKey(const QString &keyString) const { auto key = mHotKeyMap->getKeyForString(keyString); switch (key) { case Qt::Key_F1: return VK_F1; case Qt::Key_F2: return VK_F2; case Qt::Key_F3: return VK_F3; case Qt::Key_F4: return VK_F4; case Qt::Key_F5: return VK_F5; case Qt::Key_F6: return VK_F6; case Qt::Key_F7: return VK_F7; case Qt::Key_F8: return VK_F8; case Qt::Key_F9: return VK_F9; case Qt::Key_F10: return VK_F10; case Qt::Key_F11: return VK_F11; case Qt::Key_F12: return VK_F12; case Qt::Key_Escape: return VK_ESCAPE; case Qt::Key_Backspace: return VK_BACK; case Qt::Key_Return: case Qt::Key_Enter: return VK_RETURN; case Qt::Key_Insert: return VK_INSERT; case Qt::Key_Delete: return VK_DELETE; case Qt::Key_Pause: return VK_PAUSE; case Qt::Key_Print: return VK_SNAPSHOT; case Qt::Key_Home: return VK_HOME; case Qt::Key_End: return VK_END; case Qt::Key_Left: return VK_LEFT; case Qt::Key_Up: return VK_UP; case Qt::Key_Right: return VK_RIGHT; case Qt::Key_Down: return VK_DOWN; case Qt::Key_PageUp: return VK_PRIOR; case Qt::Key_PageDown: return VK_NEXT; case Qt::Key_Comma: case Qt::Key_Semicolon: return VK_OEM_COMMA; case Qt::Key_Minus: case Qt::Key_Underscore: return VK_OEM_MINUS; case Qt::Key_Period: case Qt::Key_Colon: return VK_OEM_PERIOD; default: return key; } } ksnip-1.9.2/src/gui/globalHotKeys/KeySequenceToWinKeyCodeTranslator.h000066400000000000000000000025621414701001100256540ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_KEYSEQUENCETOWINKEYCODETRANSLATOR_H #define KSNIP_KEYSEQUENCETOWINKEYCODETRANSLATOR_H #include #include #include "KeyCodeCombo.h" #include "HotKeyMap.h" class KeySequenceToWinKeyCodeTranslator { public: KeySequenceToWinKeyCodeTranslator(); ~KeySequenceToWinKeyCodeTranslator() = default; KeyCodeCombo map(const QKeySequence &keySequence) const; private: HotKeyMap *mHotKeyMap; unsigned int getModifier(const QString &modifierString) const; unsigned int getKey(const QString &keyString) const; }; #endif //KSNIP_KEYSEQUENCETOWINKEYCODETRANSLATOR_H ksnip-1.9.2/src/gui/globalHotKeys/KeySequenceToX11KeyCodeTranslator.cpp000066400000000000000000000060271414701001100260230ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "KeySequenceToX11KeyCodeTranslator.h" #include KeySequenceToX11KeyCodeTranslator::KeySequenceToX11KeyCodeTranslator() { mHotKeyMap = HotKeyMap::instance(); } KeyCodeCombo KeySequenceToX11KeyCodeTranslator::map(const QKeySequence &keySequence) const { auto sequenceString = keySequence.toString().toUpper(); auto modifierString = sequenceString.section(QLatin1String("+"), 0, -2); auto keyString = sequenceString.section(QLatin1String("+"), -1, -1); auto modifier = getModifier(modifierString); auto key = getKey(keyString); return KeyCodeCombo(modifier, key); } unsigned int KeySequenceToX11KeyCodeTranslator::getModifier(const QString &modifierString) const { unsigned int modifier = 0; if (modifierString.contains(QLatin1String("SHIFT"))) { modifier |= ShiftMask; } if (modifierString.contains(QLatin1String("ALT"))) { modifier |= Mod1Mask; } if (modifierString.contains(QLatin1String("CTRL"))) { modifier |= ControlMask; } if (modifierString.contains(QLatin1String("META"))) { modifier |= Mod4Mask; } return modifier; } unsigned int KeySequenceToX11KeyCodeTranslator::getKey(const QString &keyString) const { auto display = QX11Info::display(); auto keyCode = getKeyCode(keyString); return XKeysymToKeycode(display, keyCode); } unsigned int KeySequenceToX11KeyCodeTranslator::getKeyCode(const QString &keyString) const { auto key = mHotKeyMap->getKeyForString(keyString); switch (key) { case Qt::Key_F1: return XK_F1; case Qt::Key_F2: return XK_F2; case Qt::Key_F3: return XK_F3; case Qt::Key_F4: return XK_F4; case Qt::Key_F5: return XK_F5; case Qt::Key_F6: return XK_F6; case Qt::Key_F7: return XK_F7; case Qt::Key_F8: return XK_F8; case Qt::Key_F9: return XK_F9; case Qt::Key_F10: return XK_F10; case Qt::Key_F11: return XK_F11; case Qt::Key_F12: return XK_F12; case Qt::Key_Delete: return XK_Delete; case Qt::Key_Insert: return XK_Insert; case Qt::Key_Print: return XK_Print; case Qt::Key_Left: return XK_Left; case Qt::Key_Up: return XK_Up; case Qt::Key_Right: return XK_Right; case Qt::Key_Down: return XK_Down; case Qt::Key_PageDown: return XK_Page_Down; case Qt::Key_PageUp: return XK_Page_Up; default: return key; } } ksnip-1.9.2/src/gui/globalHotKeys/KeySequenceToX11KeyCodeTranslator.h000066400000000000000000000026511414701001100254670ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_KEYSEQUENCETOX11KEYCODETRANSLATOR_H #define KSNIP_KEYSEQUENCETOX11KEYCODETRANSLATOR_H #include #include #include "KeyCodeCombo.h" #include "HotKeyMap.h" class KeySequenceToX11KeyCodeTranslator { public: KeySequenceToX11KeyCodeTranslator(); ~KeySequenceToX11KeyCodeTranslator() = default; KeyCodeCombo map(const QKeySequence &keySequence) const; private: HotKeyMap *mHotKeyMap; unsigned int getModifier(const QString &modifierString) const; unsigned int getKey(const QString &keyString) const; unsigned int getKeyCode(const QString &keyString) const; }; #endif //KSNIP_KEYSEQUENCETOX11KEYCODETRANSLATOR_H ksnip-1.9.2/src/gui/globalHotKeys/MacKeyHandler.cpp000066400000000000000000000020611414701001100221300ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "MacKeyHandler.h" MacKeyHandler::~MacKeyHandler() { unregisterKey(); } bool MacKeyHandler::registerKey(const QKeySequence &keySequence) { return false; } bool MacKeyHandler::isKeyPressed(void *message) { return false; } void MacKeyHandler::unregisterKey() const { }ksnip-1.9.2/src/gui/globalHotKeys/MacKeyHandler.h000066400000000000000000000023771414701001100216070ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_MACKEYHANDLER_H #define KSNIP_MACKEYHANDLER_H #include "AbstractKeyHandler.h" #include "KeySequenceToMacKeyCodeTranslator.h" class MacKeyHandler : public AbstractKeyHandler { public: MacKeyHandler() = default; ~MacKeyHandler() override; bool registerKey(const QKeySequence &keySequence) override; bool isKeyPressed(void* message) override; private: KeySequenceToMacKeyCodeTranslator mKeyCodeMapper; void unregisterKey() const; }; #endif //KSNIP_MACKEYHANDLER_H ksnip-1.9.2/src/gui/globalHotKeys/NativeKeyEventFilter.cpp000066400000000000000000000023551414701001100235360ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "NativeKeyEventFilter.h" NativeKeyEventFilter::NativeKeyEventFilter(AbstractKeyHandler *keyHandler) { mKeyHandler = keyHandler; } NativeKeyEventFilter::~NativeKeyEventFilter() { delete mKeyHandler; } bool NativeKeyEventFilter::nativeEventFilter(const QByteArray &eventType, void *message, long *result) { Q_UNUSED(eventType) Q_UNUSED(result) if(mKeyHandler->isKeyPressed(message)) { emit triggered(); } return false; } ksnip-1.9.2/src/gui/globalHotKeys/NativeKeyEventFilter.h000066400000000000000000000025221414701001100231770ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_KEYEVENTFILTER_H #define KSNIP_KEYEVENTFILTER_H #include #include #include "AbstractKeyHandler.h" class NativeKeyEventFilter: public QObject, public QAbstractNativeEventFilter { Q_OBJECT public: explicit NativeKeyEventFilter(AbstractKeyHandler *keyHandler); ~NativeKeyEventFilter() override; bool nativeEventFilter(const QByteArray&, void* message, long*) override; signals: void triggered() const; private: AbstractKeyHandler *mKeyHandler; }; #endif //KSNIP_KEYEVENTFILTER_H ksnip-1.9.2/src/gui/globalHotKeys/WinKeyHandler.cpp000066400000000000000000000024621414701001100221720ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "WinKeyHandler.h" int WinKeyHandler::mNextId = 0; WinKeyHandler::~WinKeyHandler() { UnregisterHotKey(nullptr, mId); } bool WinKeyHandler::registerKey(const QKeySequence &keySequence) { mId = WinKeyHandler::mNextId++; auto keyCodeCombo = mKeyCodeMapper.map(keySequence); return RegisterHotKey(nullptr, mId, keyCodeCombo.modifier, keyCodeCombo.key); } bool WinKeyHandler::isKeyPressed(void* message) { auto msg = static_cast(message); return msg->message == WM_HOTKEY && msg->wParam == mId; } ksnip-1.9.2/src/gui/globalHotKeys/WinKeyHandler.h000066400000000000000000000024541414701001100216400ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_WINKEYHANDLER_H #define KSNIP_WINKEYHANDLER_H #include #include "AbstractKeyHandler.h" #include "KeySequenceToWinKeyCodeTranslator.h" class WinKeyHandler : public AbstractKeyHandler { public: WinKeyHandler() = default; ~WinKeyHandler() override; bool registerKey(const QKeySequence &keySequence) override; bool isKeyPressed(void* message) override; private: int mId; static int mNextId; KeySequenceToWinKeyCodeTranslator mKeyCodeMapper; }; #endif //KSNIP_WINKEYHANDLER_H ksnip-1.9.2/src/gui/globalHotKeys/X11ErrorLogger.cpp000066400000000000000000000023511414701001100222060ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "X11ErrorLogger.h" X11ErrorLogger::X11ErrorLogger() { XSetErrorHandler(errorHandler); } int X11ErrorLogger::errorHandler(Display *d, XErrorEvent *e) { Q_UNUSED(d); switch (e->error_code) { case BadAccess: qCritical("Unable to assign Global Hotkey, key sequence already in use by other Application"); break; default: qCritical("Unknown Global Hotkey Error Code: %s", qPrintable(QString::number(e->error_code))); break; } return 1; } ksnip-1.9.2/src/gui/globalHotKeys/X11ErrorLogger.h000066400000000000000000000020671414701001100216570ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_X11ERRORLOGGER_H #define KSNIP_X11ERRORLOGGER_H #include #include class X11ErrorLogger { public: X11ErrorLogger(); ~X11ErrorLogger() = default; private: static int errorHandler(Display *d, XErrorEvent *e); }; #endif //KSNIP_X11ERRORLOGGER_H ksnip-1.9.2/src/gui/globalHotKeys/X11KeyHandler.cpp000066400000000000000000000053071414701001100220070ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ /* * Inspired by Skycoder42`s QHotKey implementation https://github.com/Skycoder42/QHotkey/blob/master/QHotkey/qhotkey_x11.cpp */ #include "X11KeyHandler.h" #include "X11ErrorLogger.h" X11KeyHandler::X11KeyHandler() : mFixedModifiers({ 0, Mod2Mask, LockMask, (Mod2Mask | LockMask)}) { } X11KeyHandler::~X11KeyHandler() { unregisterKey(); } bool X11KeyHandler::registerKey(const QKeySequence &keySequence) { auto display = QX11Info::display(); if(!display) { return false; } X11ErrorLogger x11ErrorLogger; mKeyCodeCombo = mKeyCodeMapper.map(keySequence); for(auto fixedModifier : mFixedModifiers) { GrabKey(display, fixedModifier); } XSync(display, False); return true; } bool X11KeyHandler::isKeyPressed(void *message) { auto genericEvent = static_cast(message); if (genericEvent->response_type == XCB_KEY_PRESS) { auto keyEvent = static_cast(message); for(auto fixedModifier : mFixedModifiers) { if(isMatching(keyEvent, fixedModifier)) { return true; } } } return false; } bool X11KeyHandler::isMatching(const xcb_key_press_event_t *keyEvent, unsigned int fixedModifier) const { return keyEvent->detail == mKeyCodeCombo.key && keyEvent->state == (mKeyCodeCombo.modifier | fixedModifier); } void X11KeyHandler::unregisterKey() const { auto display = QX11Info::display(); if(!display) { return; } X11ErrorLogger x11ErrorLogger; for(auto fixedModifier : mFixedModifiers) { UngrabKey(display, fixedModifier); } XSync(display, False); } void X11KeyHandler::GrabKey(Display *display, unsigned int fixedModifier) const { XGrabKey(display, mKeyCodeCombo.key, mKeyCodeCombo.modifier | fixedModifier, DefaultRootWindow(display), true, GrabModeAsync, GrabModeAsync); } void X11KeyHandler::UngrabKey(Display *display, unsigned int fixedModifier) const { XUngrabKey(display, mKeyCodeCombo.key, mKeyCodeCombo.modifier | fixedModifier, DefaultRootWindow(display)); } ksnip-1.9.2/src/gui/globalHotKeys/X11KeyHandler.h000066400000000000000000000031341414701001100214500ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_X11KEYHANDLER_H #define KSNIP_X11KEYHANDLER_H #include #include #include #include "AbstractKeyHandler.h" #include "KeySequenceToX11KeyCodeTranslator.h" class X11KeyHandler : public AbstractKeyHandler { public: X11KeyHandler(); ~X11KeyHandler() override; bool registerKey(const QKeySequence &keySequence) override; bool isKeyPressed(void* message) override; private: KeyCodeCombo mKeyCodeCombo; KeySequenceToX11KeyCodeTranslator mKeyCodeMapper; QVector mFixedModifiers; void unregisterKey() const; void GrabKey(Display *display, unsigned int fixedModifier) const; void UngrabKey(Display *display, unsigned int fixedModifier) const; bool isMatching(const xcb_key_press_event_t *keyEvent, unsigned int fixedModifier) const; }; #endif //KSNIP_X11KEYHANDLER_H ksnip-1.9.2/src/gui/imageAnnotator/000077500000000000000000000000001414701001100171575ustar00rootroot00000000000000ksnip-1.9.2/src/gui/imageAnnotator/IImageAnnotator.h000066400000000000000000000054101414701001100223510ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_IIMAGEANNOTATOR_H #define KSNIP_IIMAGEANNOTATOR_H #include class QAction; class IImageAnnotator : public QObject { Q_OBJECT public: explicit IImageAnnotator() = default; ~IImageAnnotator() override = default; virtual QImage image() const = 0; virtual QImage imageAt(int index) const = 0; virtual QAction *undoAction() = 0; virtual QAction *redoAction() = 0; virtual QSize sizeHint() const = 0; virtual void showAnnotator() = 0; virtual void showCropper() = 0; virtual void showScaler() = 0; virtual void showCanvasModifier() = 0; virtual void showRotator() = 0; virtual void setSettingsCollapsed(bool isCollapsed) = 0; virtual void hide() = 0; virtual void close() = 0; virtual bool isVisible() const = 0; virtual QWidget* widget() const = 0; public slots: virtual void loadImage(const QPixmap &pixmap) = 0; virtual int addTab(const QPixmap &pixmap, const QString &title, const QString &toolTip) = 0; virtual void updateTabInfo(int index, const QString &title, const QString &toolTip) = 0; virtual void insertImageItem(const QPointF &position, const QPixmap &pixmap) = 0; virtual void setSmoothPathEnabled(bool enabled) = 0; virtual void setSaveToolSelection(bool enabled) = 0; virtual void setSmoothFactor(int factor) = 0; virtual void setSwitchToSelectToolAfterDrawingItem(bool enabled) = 0; virtual void setSelectItemAfterDrawing(bool enabled) = 0; virtual void setNumberToolSeedChangeUpdatesAllItems(bool enabled) = 0; virtual void setTabBarAutoHide(bool enabled) = 0; virtual void removeTab(int index) = 0; virtual void setStickers(const QStringList &stickerPaths, bool keepDefault) = 0; virtual void addTabContextMenuActions(const QList & actions) = 0; virtual void setCanvasColor(const QColor &color) = 0; signals: void imageChanged() const; void currentTabChanged(int index) const; void tabCloseRequested(int index) const; void tabMoved(int fromIndex, int toIndex); void tabContextMenuOpened(int index) const; }; #endif //KSNIP_IIMAGEANNOTATOR_H ksnip-1.9.2/src/gui/imageAnnotator/KImageAnnotatorAdapter.cpp000066400000000000000000000114001414701001100242030ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "KImageAnnotatorAdapter.h" KImageAnnotatorAdapter::KImageAnnotatorAdapter() : mKImageAnnotator(new KImageAnnotator) { connect(mKImageAnnotator, &KImageAnnotator::imageChanged, this, &KImageAnnotatorAdapter::imageChanged); connect(mKImageAnnotator, &KImageAnnotator::currentTabChanged, this, &KImageAnnotatorAdapter::currentTabChanged); connect(mKImageAnnotator, &KImageAnnotator::tabCloseRequested, this, &KImageAnnotatorAdapter::tabCloseRequested); connect(mKImageAnnotator, &KImageAnnotator::tabMoved, this, &KImageAnnotatorAdapter::tabMoved); connect(mKImageAnnotator, &KImageAnnotator::tabContextMenuOpened, this, &KImageAnnotatorAdapter::tabContextMenuOpened); } KImageAnnotatorAdapter::~KImageAnnotatorAdapter() { delete mKImageAnnotator; } QImage KImageAnnotatorAdapter::image() const { return mKImageAnnotator->image(); } QImage KImageAnnotatorAdapter::imageAt(int index) const { return mKImageAnnotator->imageAt(index); } QAction *KImageAnnotatorAdapter::undoAction() { return mKImageAnnotator->undoAction(); } QAction *KImageAnnotatorAdapter::redoAction() { return mKImageAnnotator->redoAction(); } QSize KImageAnnotatorAdapter::sizeHint() const { return mKImageAnnotator->sizeHint(); } void KImageAnnotatorAdapter::showAnnotator() { mKImageAnnotator->showAnnotator(); } void KImageAnnotatorAdapter::showCropper() { mKImageAnnotator->showCropper(); } void KImageAnnotatorAdapter::showScaler() { mKImageAnnotator->showScaler(); } void KImageAnnotatorAdapter::setSettingsCollapsed(bool isCollapsed) { mKImageAnnotator->setSettingsCollapsed(isCollapsed); } void KImageAnnotatorAdapter::hide() { mKImageAnnotator->hide(); } void KImageAnnotatorAdapter::close() { mKImageAnnotator->close(); } bool KImageAnnotatorAdapter::isVisible() const { return mKImageAnnotator->isVisible(); } QWidget *KImageAnnotatorAdapter::widget() const { return mKImageAnnotator; } void KImageAnnotatorAdapter::loadImage(const QPixmap &pixmap) { mKImageAnnotator->loadImage(pixmap); } int KImageAnnotatorAdapter::addTab(const QPixmap &pixmap, const QString &title, const QString &toolTip) { return mKImageAnnotator->addTab(pixmap, title, toolTip); } void KImageAnnotatorAdapter::updateTabInfo(int index, const QString &title, const QString &toolTip) { mKImageAnnotator->updateTabInfo(index, title, toolTip); } void KImageAnnotatorAdapter::insertImageItem(const QPointF &position, const QPixmap &pixmap) { mKImageAnnotator->insertImageItem(position, pixmap); } void KImageAnnotatorAdapter::setSmoothPathEnabled(bool enabled) { mKImageAnnotator->setSmoothPathEnabled(enabled); } void KImageAnnotatorAdapter::setSaveToolSelection(bool enabled) { mKImageAnnotator->setSaveToolSelection(enabled); } void KImageAnnotatorAdapter::setSmoothFactor(int factor) { mKImageAnnotator->setSmoothFactor(factor); } void KImageAnnotatorAdapter::setSwitchToSelectToolAfterDrawingItem(bool enabled) { mKImageAnnotator->setSwitchToSelectToolAfterDrawingItem(enabled); } void KImageAnnotatorAdapter::setSelectItemAfterDrawing(bool enabled) { mKImageAnnotator->setSelectItemAfterDrawing(enabled); } void KImageAnnotatorAdapter::setNumberToolSeedChangeUpdatesAllItems(bool enabled) { mKImageAnnotator->setNumberToolSeedChangeUpdatesAllItems(enabled); } void KImageAnnotatorAdapter::setTabBarAutoHide(bool enabled) { mKImageAnnotator->setTabBarAutoHide(enabled); } void KImageAnnotatorAdapter::removeTab(int index) { mKImageAnnotator->removeTab(index); } void KImageAnnotatorAdapter::setStickers(const QStringList &stickerPaths, bool keepDefault) { mKImageAnnotator->setStickers(stickerPaths, keepDefault); } void KImageAnnotatorAdapter::addTabContextMenuActions(const QList &actions) { mKImageAnnotator->addTabContextMenuActions(actions); } void KImageAnnotatorAdapter::showCanvasModifier() { mKImageAnnotator->showCanvasModifier(); } void KImageAnnotatorAdapter::showRotator() { mKImageAnnotator->showRotator(); } void KImageAnnotatorAdapter::setCanvasColor(const QColor &color) { mKImageAnnotator->setCanvasColor(color); } ksnip-1.9.2/src/gui/imageAnnotator/KImageAnnotatorAdapter.h000066400000000000000000000051711414701001100236600ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_KIMAGEANNOTATORADAPTER_H #define KSNIP_KIMAGEANNOTATORADAPTER_H #include #include "IImageAnnotator.h" using kImageAnnotator::KImageAnnotator; class KImageAnnotatorAdapter : public IImageAnnotator { Q_OBJECT public: explicit KImageAnnotatorAdapter(); ~KImageAnnotatorAdapter() override; QImage image() const override; QImage imageAt(int index) const override; QAction *undoAction() override; QAction *redoAction() override; QSize sizeHint() const override; void showAnnotator() override; void showCropper() override; void showScaler() override; void showCanvasModifier() override; void showRotator() override; void setSettingsCollapsed(bool isCollapsed) override; void hide() override; void close() override; bool isVisible() const override; QWidget* widget() const override; public slots: void loadImage(const QPixmap &pixmap) override; int addTab(const QPixmap &pixmap, const QString &title, const QString &toolTip) override; void updateTabInfo(int index, const QString &title, const QString &toolTip) override; void insertImageItem(const QPointF &position, const QPixmap &pixmap) override; void setSmoothPathEnabled(bool enabled) override; void setSaveToolSelection(bool enabled) override; void setSmoothFactor(int factor) override; void setSwitchToSelectToolAfterDrawingItem(bool enabled) override; void setSelectItemAfterDrawing(bool enabled) override; void setNumberToolSeedChangeUpdatesAllItems(bool enabled) override; void setTabBarAutoHide(bool enabled) override; void removeTab(int index) override; void setStickers(const QStringList &stickerPaths, bool keepDefault) override; void addTabContextMenuActions(const QList & actions) override; void setCanvasColor(const QColor &color) override; private: KImageAnnotator *mKImageAnnotator; }; #endif //KSNIP_KIMAGEANNOTATORADAPTER_H ksnip-1.9.2/src/gui/messageBoxService/000077500000000000000000000000001414701001100176255ustar00rootroot00000000000000ksnip-1.9.2/src/gui/messageBoxService/IMessageBoxService.h000066400000000000000000000025531414701001100234720ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_IMESSAGEBOXSERVICE_H #define KSNIP_IMESSAGEBOXSERVICE_H #include "src/common/enum/MessageBoxResponse.h" class QString; class IMessageBoxService { public: explicit IMessageBoxService() = default; virtual ~IMessageBoxService() = default; virtual bool yesNo(const QString &title, const QString &question) = 0; virtual MessageBoxResponse yesNoCancel(const QString &title, const QString &question) = 0; virtual void ok(const QString &title, const QString &info) = 0; virtual bool okCancel(const QString &title, const QString &info) = 0; }; #endif //KSNIP_IMESSAGEBOXSERVICE_H ksnip-1.9.2/src/gui/messageBoxService/MessageBoxService.cpp000066400000000000000000000037121414701001100237120ustar00rootroot00000000000000/* * Copyright (C) 2018 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "MessageBoxService.h" bool MessageBoxService::yesNo(const QString &title, const QString &question) { auto reply = QMessageBox::question(nullptr, title, question, QMessageBox::Yes | QMessageBox::No); return reply == QMessageBox::Yes; } MessageBoxResponse MessageBoxService::yesNoCancel(const QString &title, const QString &question) { auto reply = QMessageBox::question(nullptr, title, question, QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel); return mapReplyToMessageBoxResponse(reply); } void MessageBoxService::ok(const QString &title, const QString &info) { QMessageBox::question(nullptr, title, info, QMessageBox::Ok); } bool MessageBoxService::okCancel(const QString &title, const QString &info) { auto reply = QMessageBox::question(nullptr, title, info, QMessageBox::Ok | QMessageBox::Cancel); return reply == QMessageBox::Ok; } MessageBoxResponse MessageBoxService::mapReplyToMessageBoxResponse(int reply) { switch (reply) { case QMessageBox::Yes: return MessageBoxResponse::Yes; case QMessageBox::No: return MessageBoxResponse::No; case QMessageBox::Cancel: return MessageBoxResponse::Cancel; default: return MessageBoxResponse::No; } } ksnip-1.9.2/src/gui/messageBoxService/MessageBoxService.h000066400000000000000000000027621414701001100233630ustar00rootroot00000000000000/* * Copyright (C) 2018 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_MESSAGEBOXSERVICE_H #define KSNIP_MESSAGEBOXSERVICE_H #include #include "IMessageBoxService.h" #include "src/common/enum/MessageBoxResponse.h" class MessageBoxService : public IMessageBoxService { public: explicit MessageBoxService() = default; ~MessageBoxService() override = default; bool yesNo(const QString &title, const QString &question) override; MessageBoxResponse yesNoCancel(const QString &title, const QString &question) override; void ok(const QString &title, const QString &info) override; bool okCancel(const QString &title, const QString &info) override; private: static MessageBoxResponse mapReplyToMessageBoxResponse(int reply); }; #endif //KSNIP_MESSAGEBOXSERVICE_H ksnip-1.9.2/src/gui/notificationService/000077500000000000000000000000001414701001100202165ustar00rootroot00000000000000ksnip-1.9.2/src/gui/notificationService/FreeDesktopNotificationService.cpp000066400000000000000000000053301414701001100270260ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include #include #include #include "FreeDesktopNotificationService.h" #include "src/common/helper/FileUrlHelper.h" FreeDesktopNotificationService::FreeDesktopNotificationService() : mNotificationTimeout(7000) { mDBusInterface = new QDBusInterface(QStringLiteral("org.freedesktop.Notifications"), QStringLiteral("/org/freedesktop/Notifications"), QStringLiteral("org.freedesktop.Notifications"), QDBusConnection::sessionBus() ); } void FreeDesktopNotificationService::showInfoToast(const QString &title, const QString &message, const QString &contentUrl) { showToast(title, message, contentUrl, QStringLiteral("dialog-information")); } void FreeDesktopNotificationService::showWarningToast(const QString &title, const QString &message, const QString &contentUrl) { showToast(title, message, contentUrl, QStringLiteral("dialog-warning")); } void FreeDesktopNotificationService::showCriticalToast(const QString &title, const QString &message, const QString &contentUrl) { showToast(title, message, contentUrl, QStringLiteral("dialog-error")); } void FreeDesktopNotificationService::showToast(const QString &title, const QString &message, const QString &contentUrl, const QString &appIcon) { QList args; QVariantMap hintsMap; if (!contentUrl.isEmpty()) { if (PlatformChecker::instance()->isKde()) { hintsMap[QLatin1String("x-kde-urls")] = QStringList(contentUrl); } else { hintsMap[QLatin1String("image-path")] = FileUrlHelper::toFileUrl(contentUrl); } } args << qAppName() // app_name << static_cast(0) // replaces_id (0 = does not replace existing notification) << appIcon // app_icon << title // summary << message // body << QStringList() // actions << hintsMap // hints << mNotificationTimeout; // expire_timeout mDBusInterface->callWithArgumentList(QDBus::NoBlock, QStringLiteral("Notify"), args); } ksnip-1.9.2/src/gui/notificationService/FreeDesktopNotificationService.h000066400000000000000000000034541414701001100265000ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_FREEDESKTOPNOTIFICATIONSERVICE_H #define KSNIP_FREEDESKTOPNOTIFICATIONSERVICE_H #include #include #include #include #include #include "src/gui/IToastService.h" #include "src/common/platform/PlatformChecker.h" class FreeDesktopNotificationService : public QObject, public IToastService { Q_OBJECT public: FreeDesktopNotificationService(); ~FreeDesktopNotificationService() = default; void showInfoToast(const QString &title, const QString &message, const QString &contentUrl) override; void showWarningToast(const QString &title, const QString &message, const QString &contentUrl) override; void showCriticalToast(const QString &title, const QString &message, const QString &contentUrl) override; protected: void showToast(const QString &title, const QString &message, const QString &contentUrl, const QString &appIcon); private: QDBusInterface *mDBusInterface; const int mNotificationTimeout; }; #endif //KSNIP_FREEDESKTOPNOTIFICATIONSERVICE_H ksnip-1.9.2/src/gui/notificationService/NotificationServiceFactory.cpp000066400000000000000000000024361414701001100262260ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "NotificationServiceFactory.h" #include "src/backend/config/KsnipConfigProvider.h" #if defined(UNIX_X11) #include "FreeDesktopNotificationService.h" #endif IToastService *NotificationServiceFactory::create(IToastService *defaultNotificationService) { #if defined(UNIX_X11) if (KsnipConfigProvider::instance()->platformSpecificNotificationServiceEnabled()) { return new FreeDesktopNotificationService(); } else { return defaultNotificationService; } #else return defaultNotificationService; #endif } ksnip-1.9.2/src/gui/notificationService/NotificationServiceFactory.h000066400000000000000000000022511414701001100256660ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_NOTIFICATIONSERVICEFACTORY_H #define KSNIP_NOTIFICATIONSERVICEFACTORY_H #include #include "src/gui/IToastService.h" class NotificationServiceFactory { public: explicit NotificationServiceFactory() = default; ~NotificationServiceFactory() = default; static IToastService *create(IToastService *defaultNotificationService); }; #endif //KSNIP_NOTIFICATIONSERVICEFACTORY_H ksnip-1.9.2/src/gui/operations/000077500000000000000000000000001414701001100163725ustar00rootroot00000000000000ksnip-1.9.2/src/gui/operations/AddWatermarkOperation.cpp000066400000000000000000000043201414701001100233240ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "AddWatermarkOperation.h" AddWatermarkOperation::AddWatermarkOperation(IImageAnnotator *imageAnnotator) : mImageAnnotator(imageAnnotator), mConfig(KsnipConfigProvider::instance()), mMessageBoxService(new MessageBoxService) { } AddWatermarkOperation::~AddWatermarkOperation() { delete mMessageBoxService; } void AddWatermarkOperation::execute() { auto watermarkImage = mWatermarkImageLoader.load(); if(watermarkImage.isNull()) { NotifyAboutMissingWatermarkImage(); return; } auto availableSpace = mImageAnnotator->image().size(); auto rotated = mConfig->rotateWatermarkEnabled(); auto finishedWatermarkImage = mImagePreparer.prepare(watermarkImage, availableSpace, rotated); auto position = getPositionForWatermark(finishedWatermarkImage, availableSpace); mImageAnnotator->insertImageItem(position, finishedWatermarkImage); } void AddWatermarkOperation::NotifyAboutMissingWatermarkImage() const { mMessageBoxService->ok(tr("Watermark Image Required"), tr("Please add a Watermark Image via Options > Settings > Annotator > Update")); } QPointF AddWatermarkOperation::getPositionForWatermark(const QPixmap &image, const QSize &availableSpace) { auto availableWidth = availableSpace.width() - image.rect().width(); auto availableHeight = availableSpace.height() - image.rect().height(); qreal x = availableWidth <= 0 ? 0 : rand() % availableWidth; qreal y = availableHeight <= 0 ? 0 : rand() % availableHeight; return {x, y}; } ksnip-1.9.2/src/gui/operations/AddWatermarkOperation.h000066400000000000000000000032741414701001100230000ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_ADDWATERMARKOPERATION_H #define KSNIP_ADDWATERMARKOPERATION_H #include #include #include "WatermarkImagePreparer.h" #include "src/gui/messageBoxService/MessageBoxService.h" #include "src/backend/WatermarkImageLoader.h" #include "src/backend/config/KsnipConfigProvider.h" #include "src/gui/imageAnnotator/IImageAnnotator.h" class AddWatermarkOperation : public QObject { Q_OBJECT public: explicit AddWatermarkOperation(IImageAnnotator *imageAnnotator); ~AddWatermarkOperation() override; void execute(); private: IImageAnnotator *mImageAnnotator; WatermarkImagePreparer mImagePreparer; WatermarkImageLoader mWatermarkImageLoader; KsnipConfig *mConfig; IMessageBoxService *mMessageBoxService; static QPointF getPositionForWatermark(const QPixmap &image, const QSize &availableSpace) ; void NotifyAboutMissingWatermarkImage() const; }; #endif //KSNIP_ADDWATERMARKOPERATION_H ksnip-1.9.2/src/gui/operations/CanDiscardOperation.cpp000066400000000000000000000044261414701001100227600ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "CanDiscardOperation.h" CanDiscardOperation::CanDiscardOperation(QWidget *parent, QImage image, bool isUnsaved, QString pathToImageSource, QString filename, IToastService *toastService, IRecentImageService *recentImageService) : mParent(parent), mImage(std::move(image)), mIsUnsaved(isUnsaved), mPathToImageSource(std::move(pathToImageSource)), mFilename(std::move(filename)), mConfig(KsnipConfigProvider::instance()), mToastService(toastService), mMessageBoxService(new MessageBoxService), mRecentImageService(recentImageService) { } CanDiscardOperation::~CanDiscardOperation() { delete mMessageBoxService; } bool CanDiscardOperation::execute() { if (mConfig->promptSaveBeforeExit() && mIsUnsaved) { auto saveBeforeDiscardResponse = getSaveBeforeDiscard(); if (saveBeforeDiscardResponse == MessageBoxResponse::Yes) { return saveImage(); } else if (saveBeforeDiscardResponse == MessageBoxResponse::Cancel) { return false; } } return true; } bool CanDiscardOperation::saveImage() const { SaveOperation operation(mParent, mImage, true, mPathToImageSource, mToastService, mRecentImageService); return operation.execute().isSuccessful; } MessageBoxResponse CanDiscardOperation::getSaveBeforeDiscard() const { auto quote = mFilename.isEmpty() ? QString() : QLatin1String("\""); return mMessageBoxService->yesNoCancel(tr("Warning - ") + QApplication::applicationName(), tr("The capture %1%2%3 has been modified.\nDo you want to save it?").arg(quote).arg(mFilename).arg(quote)); } ksnip-1.9.2/src/gui/operations/CanDiscardOperation.h000066400000000000000000000034071414701001100224230ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_CANDISCARDOPERATION_H #define KSNIP_CANDISCARDOPERATION_H #include #include #include "SaveOperation.h" #include "NotifyOperation.h" #include "src/backend/config/KsnipConfigProvider.h" #include "src/backend/recentImages/IRecentImageService.h" #include "src/gui/messageBoxService/MessageBoxService.h" class CanDiscardOperation : public QObject { Q_OBJECT public: CanDiscardOperation(QWidget *parent, QImage image, bool isUnsaved, QString pathToImageSource, QString filename, IToastService *toastService, IRecentImageService *recentImageService); ~CanDiscardOperation() override; bool execute(); private: KsnipConfig *mConfig; bool mIsUnsaved; QWidget *mParent; QImage mImage; QString mPathToImageSource; QString mFilename; IToastService *mToastService; IMessageBoxService *mMessageBoxService; IRecentImageService *mRecentImageService; MessageBoxResponse getSaveBeforeDiscard() const; bool saveImage() const; }; #endif //KSNIP_CANDISCARDOPERATION_H ksnip-1.9.2/src/gui/operations/CopyAsDataUriOperation.cpp000066400000000000000000000040411414701001100234260ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "CopyAsDataUriOperation.h" CopyAsDataUriOperation::CopyAsDataUriOperation(QImage image, IClipboard *clipboard, IToastService *toastService) : mImage(std::move(image)), mClipboard(clipboard), mToastService(toastService) { } bool CopyAsDataUriOperation::execute() { QByteArray byteArray; QBuffer buffer(&byteArray); buffer.open(QIODevice::WriteOnly); auto saved = mImage.save(&buffer, "PNG"); buffer.close(); if (saved) { QByteArray output = "data:image/png;base64,"; output.append(byteArray.toBase64()); mClipboard->setText(output); notifySuccess(); } else { notifyFailure(); } return saved; } void CopyAsDataUriOperation::notifyFailure() const { auto title = tr("Failed to copy to clipboard"); auto message = tr("Failed to copy to clipboard as base64 encoded image."); notify(title, message, NotificationTypes::Warning); } void CopyAsDataUriOperation::notifySuccess() const { auto title = tr("Copied to clipboard"); auto message = tr("Copied to clipboard as base64 encoded image."); notify(title, message, NotificationTypes::Information); } void CopyAsDataUriOperation::notify(const QString &title, const QString &message, NotificationTypes type) const { NotifyOperation operation(mToastService, title, message, type); operation.execute(); } ksnip-1.9.2/src/gui/operations/CopyAsDataUriOperation.h000066400000000000000000000027731414701001100231050ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_COPYASDATAURIOPERATION_H #define KSNIP_COPYASDATAURIOPERATION_H #include #include #include "src/gui/clipboard/IClipboard.h" #include "src/gui/IToastService.h" #include "src/gui/operations/NotifyOperation.h" class CopyAsDataUriOperation : public QObject { Q_OBJECT public: CopyAsDataUriOperation(QImage image, IClipboard *clipboard, IToastService *toastService); ~CopyAsDataUriOperation() override = default; bool execute(); private: QImage mImage; IClipboard *mClipboard; IToastService *mToastService; void notifySuccess() const; void notifyFailure() const; void notify(const QString &title, const QString &message, NotificationTypes type) const; }; #endif //KSNIP_COPYASDATAURIOPERATION_H ksnip-1.9.2/src/gui/operations/DeleteImageOperation.cpp000066400000000000000000000024641414701001100231320ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "DeleteImageOperation.h" DeleteImageOperation::DeleteImageOperation(QString path, IFileService *fileService, IMessageBoxService *messageBoxService) : mPath(std::move(path)), mFileService(fileService), mMessageBoxService(messageBoxService) { } bool DeleteImageOperation::execute() { auto title = tr("Delete Image"); auto question = tr("The item \'%1\' will be deleted.\nDo you want to continue?").arg(mPath); auto response = mMessageBoxService->okCancel(title, question); return response && mFileService->remove(mPath); } ksnip-1.9.2/src/gui/operations/DeleteImageOperation.h000066400000000000000000000025541414701001100225770ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_DELETEIMAGEOPERATION_H #define KSNIP_DELETEIMAGEOPERATION_H #include #include #include "src/gui/fileService/IFileService.h" #include "src/gui/messageBoxService/IMessageBoxService.h" class DeleteImageOperation : public QObject { Q_OBJECT public: explicit DeleteImageOperation(QString path, IFileService *fileService, IMessageBoxService *messageBoxService); ~DeleteImageOperation() override = default; bool execute(); private: QString mPath; IFileService *mFileService; IMessageBoxService *mMessageBoxService; }; #endif //KSNIP_DELETEIMAGEOPERATION_H ksnip-1.9.2/src/gui/operations/HandleUploadResultOperation.cpp000066400000000000000000000077421414701001100245300ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "HandleUploadResultOperation.h" HandleUploadResultOperation::HandleUploadResultOperation(const UploadResult &result, TrayIcon *trayIcon) : mUploadResult(result), mTrayIcon(trayIcon), mConfig(KsnipConfigProvider::instance()), mClipboard(QApplication::clipboard()) { } bool HandleUploadResultOperation::execute() { switch (mUploadResult.type) { case UploaderType::Imgur: handleImgurResult(); break; case UploaderType::Script: handleScriptResult(); break; } return mUploadResult.status == UploadStatus::NoError; } void HandleUploadResultOperation::handleImgurResult() { if(mUploadResult.status == UploadStatus::NoError) { if (mConfig->imgurOpenLinkInBrowser()) { OpenUrl(mUploadResult.content); } if (mConfig->imgurAlwaysCopyToClipboard()) { copyToClipboard(mUploadResult.content); } notifyImgurSuccessfulUpload(mUploadResult.content); } else { handleUploadError(); } } void HandleUploadResultOperation::handleScriptResult() { if(mUploadResult.status == UploadStatus::NoError) { if (mConfig->uploadScriptCopyOutputToClipboard()) { copyToClipboard(mUploadResult.content); } notifyScriptSuccessfulUpload(); } else { handleUploadError(); } } void HandleUploadResultOperation::notifyScriptSuccessfulUpload() const { NotifyOperation operation(mTrayIcon, tr("Upload Successful"), tr("Upload script ") + mConfig->uploadScriptPath() + tr(" finished successfully."), NotificationTypes::Information); operation.execute(); } void HandleUploadResultOperation::notifyImgurSuccessfulUpload(const QString &url) const { NotifyOperation operation(mTrayIcon, tr("Upload Successful"), tr("Uploaded to") + QLatin1String(" ") + url, url, NotificationTypes::Information); operation.execute(); } void HandleUploadResultOperation::copyToClipboard(const QString &url) const { mClipboard->setText(url); } void HandleUploadResultOperation::OpenUrl(const QString &url) const { QDesktopServices::openUrl(url); } void HandleUploadResultOperation::handleUploadError() { switch (mUploadResult.status) { case UploadStatus::NoError: // Nothing to report all good break; case UploadStatus::UnableToSaveTemporaryImage: notifyFailedUpload(tr("Unable to save temporary image for upload.")); break; case UploadStatus::FailedToStart: notifyFailedUpload(tr("Unable to start process, check path and permissions.")); break; case UploadStatus::Crashed: notifyFailedUpload(tr("Process crashed")); break; case UploadStatus::Timedout: notifyFailedUpload(tr("Process timed out.")); break; case UploadStatus::ReadError: notifyFailedUpload(tr("Process read error.")); break; case UploadStatus::WriteError: notifyFailedUpload(tr("Process write error.")); break; case UploadStatus::WebError: notifyFailedUpload(tr("Web error, check console output.")); break; case UploadStatus::UnknownError: notifyFailedUpload(tr("Unknown process error.")); break; case UploadStatus::ScriptWroteToStdErr: notifyFailedUpload(tr("Script wrote to StdErr.")); break; } } void HandleUploadResultOperation::notifyFailedUpload(const QString &message) const { NotifyOperation operation(mTrayIcon, tr("Upload Failed"), message, NotificationTypes::Warning); operation.execute(); } ksnip-1.9.2/src/gui/operations/HandleUploadResultOperation.h000066400000000000000000000034571414701001100241740ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_HANDLEUPLOADRESULTOPERATION_H #define KSNIP_HANDLEUPLOADRESULTOPERATION_H #include #include #include #include #include "src/backend/config/KsnipConfigProvider.h" #include "src/backend/uploader/UploadResult.h" #include "src/gui/operations/NotifyOperation.h" class HandleUploadResultOperation : public QObject { Q_OBJECT public: explicit HandleUploadResultOperation(const UploadResult &result, TrayIcon *trayIcon); ~HandleUploadResultOperation() override = default; bool execute(); private: UploadResult mUploadResult; TrayIcon *mTrayIcon; KsnipConfig *mConfig; QClipboard *mClipboard; void notifyImgurSuccessfulUpload(const QString &url) const; void handleImgurResult(); void handleScriptResult(); void copyToClipboard(const QString &url) const; void OpenUrl(const QString &url) const; void handleUploadError(); void notifyScriptSuccessfulUpload() const; void notifyFailedUpload(const QString &message) const; }; #endif //KSNIP_HANDLEUPLOADRESULTOPERATION_H ksnip-1.9.2/src/gui/operations/LoadImageFromFileOperation.cpp000066400000000000000000000034251414701001100242310ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "LoadImageFromFileOperation.h" LoadImageFromFileOperation::LoadImageFromFileOperation(IImageProcessor *imageProcessor, const QString &path, IToastService *toastService, IServiceLocator *serviceLocator) : mImageProcessor(imageProcessor), mPath(path), mToastService(toastService), mRecentImageService(serviceLocator->recentImageService()), mFileService(serviceLocator->fileService()) { } bool LoadImageFromFileOperation::execute() { auto pixmap = mFileService->openPixmap(mPath); if(pixmap.isNull()) { notifyAboutInvalidPath(); return false; } else { mRecentImageService->storeImagePath(mPath); CaptureFromFileDto captureDto(pixmap, mPath); mImageProcessor->processImage(captureDto); return true; } } void LoadImageFromFileOperation::notifyAboutInvalidPath() const { auto title = tr("Unable to open image"); auto message = tr("Unable to open image from path %1").arg(mPath); NotifyOperation operation(mToastService, title, message, NotificationTypes::Warning); operation.execute(); } ksnip-1.9.2/src/gui/operations/LoadImageFromFileOperation.h000066400000000000000000000031661414701001100237000ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_LOADIMAGEFROMFILEOPERATION_H #define KSNIP_LOADIMAGEFROMFILEOPERATION_H #include #include "src/gui/serviceLocator/IServiceLocator.h" #include "src/gui/IToastService.h" #include "src/gui/IImageProcessor.h" #include "src/gui/operations/NotifyOperation.h" #include "src/common/dtos/CaptureFromFileDto.h" class LoadImageFromFileOperation : public QObject { Q_OBJECT public: LoadImageFromFileOperation(IImageProcessor *imageProcessor, const QString &path, IToastService *toastService, IServiceLocator *serviceLocator); ~LoadImageFromFileOperation() override = default; bool execute(); private: IImageProcessor *mImageProcessor; QString mPath; IToastService *mToastService; IRecentImageService *mRecentImageService; IFileService *mFileService; void notifyAboutInvalidPath() const; }; #endif //KSNIP_LOADIMAGEFROMFILEOPERATION_H ksnip-1.9.2/src/gui/operations/NotifyOperation.cpp000066400000000000000000000046061414701001100222350ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "NotifyOperation.h" NotifyOperation::NotifyOperation(IToastService *toastService, const QString &title, const QString &message, const QString &contentUrl, NotificationTypes notificationType) : NotifyOperation(toastService, title, message, notificationType) { mContentUrl = contentUrl; } NotifyOperation::NotifyOperation(IToastService *toastService, const QString &title, const QString &message, NotificationTypes notificationType) : mToastService(toastService), mTitle(title), mMessage(message), mNotificationType(notificationType), mConfig(KsnipConfigProvider::instance()) { Q_ASSERT(mToastService != nullptr); } bool NotifyOperation::execute() { if(mConfig->trayIconNotificationsEnabled()) { notifyViaToastMessage(); } notifyViaConsoleMessage(); return true; } void NotifyOperation::notifyViaToastMessage() const { switch (mNotificationType) { case NotificationTypes::Information: mToastService->showInfoToast(mTitle, mMessage, mContentUrl); break; case NotificationTypes::Warning: mToastService->showWarningToast(mTitle, mMessage, mContentUrl); break; case NotificationTypes::Critical: mToastService->showCriticalToast(mTitle, mMessage, mContentUrl); break; } } void NotifyOperation::notifyViaConsoleMessage() const { switch (mNotificationType) { case NotificationTypes::Information: qInfo("%s: %s", qPrintable(mTitle), qPrintable(mMessage)); break; case NotificationTypes::Warning: qWarning("%s: %s", qPrintable(mTitle), qPrintable(mMessage)); break; case NotificationTypes::Critical: qCritical("%s: %s", qPrintable(mTitle), qPrintable(mMessage)); break; } } ksnip-1.9.2/src/gui/operations/NotifyOperation.h000066400000000000000000000030461414701001100216770ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_NOTIFYOPERATION_H #define KSNIP_NOTIFYOPERATION_H #include "src/gui/TrayIcon.h" #include "src/common/enum/NotificationTypes.h" class NotifyOperation { public: NotifyOperation(IToastService *toastService, const QString &title, const QString &message, const QString &contentUrl, NotificationTypes notificationType); NotifyOperation(IToastService *toastService, const QString &title, const QString &message, NotificationTypes notificationType); ~NotifyOperation() = default; bool execute(); private: IToastService *mToastService; QString mTitle; QString mMessage; QString mContentUrl; NotificationTypes mNotificationType; KsnipConfig *mConfig; void notifyViaToastMessage() const; void notifyViaConsoleMessage() const; }; #endif //KSNIP_NOTIFYOPERATION_H ksnip-1.9.2/src/gui/operations/RenameOperation.cpp000066400000000000000000000051451414701001100221730ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "RenameOperation.h" RenameOperation::RenameOperation(QWidget *parent, const QString &pathToImageSource, const QString &imageFilename, IToastService *toastService) : mParent(parent), mPathToImageSource(pathToImageSource), mImageFilename(imageFilename), mToastService(toastService) { } RenameResultDto RenameOperation::execute() { auto newFilename = getNewFilename(); if (newFilename.isNull() || newFilename.isEmpty()) { return RenameResultDto(false, mPathToImageSource); } auto renameSuccessful = rename(newFilename); if (renameSuccessful) { NotifyOperation operation(mToastService, tr("Image Renamed"), tr("Successfully renamed image to ") + newFilename, NotificationTypes::Information); operation.execute(); } else { NotifyOperation operation(mToastService, tr("Image Rename Failed"), tr("Failed to rename image to ") + newFilename, NotificationTypes::Warning); operation.execute(); } return RenameResultDto(renameSuccessful, mPathToImageSource); } QString RenameOperation::getNewFilename() const { QInputDialog dialog; dialog.setInputMode(QInputDialog::TextInput); dialog.setWindowTitle(tr("Rename image")); dialog.setLabelText(tr("New filename:")); dialog.setTextEchoMode(QLineEdit::Normal); dialog.setTextValue(mImageFilename); dialog.resize(270, 0); if (QDialog::Accepted == dialog.exec()) { return dialog.textValue(); } return QString(); } bool RenameOperation::rename(const QString &newFilename) { auto oldFilename = PathHelper::extractFilename(mPathToImageSource); auto newPathToImageSource = mPathToImageSource; newPathToImageSource.replace(oldFilename, newFilename); QFile file(mPathToImageSource); auto renameSuccessful = file.rename(newPathToImageSource); if (renameSuccessful) { mPathToImageSource = newPathToImageSource; } return renameSuccessful; } ksnip-1.9.2/src/gui/operations/RenameOperation.h000066400000000000000000000030551414701001100216360ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_RENAMEOPERATION_H #define KSNIP_RENAMEOPERATION_H #include #include #include #include #include "NotifyOperation.h" #include "src/common/dtos/RenameResultDto.h" #include "src/common/helper/PathHelper.h" #include "src/gui/IToastService.h" class RenameOperation : public QObject { Q_OBJECT public: RenameOperation(QWidget *parent, const QString &pathToImageSource, const QString &imageFilename, IToastService *toastService); ~RenameOperation() override = default; RenameResultDto execute(); private: QWidget* mParent; QString mPathToImageSource; QString mImageFilename; IToastService *mToastService; QString getNewFilename() const; bool rename(const QString &newFilename); }; #endif //KSNIP_RENAMEOPERATION_H ksnip-1.9.2/src/gui/operations/SaveOperation.cpp000066400000000000000000000063751414701001100216700ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "SaveOperation.h" #include SaveOperation::SaveOperation(QWidget *parent, QImage image, bool isInstantSave, IToastService *toastService, IRecentImageService *recentImageService) : mParent(parent), mImage(std::move(image)), mIsInstantSave(isInstantSave), mToastService(toastService), mRecentImageService(recentImageService), mConfig(KsnipConfigProvider::instance()) { Q_ASSERT(mParent != nullptr); } SaveOperation::SaveOperation(QWidget *parent, const QImage &image, bool isInstantSave, const QString &pathToImageSource, IToastService *toastService, IRecentImageService *recentImageService) : SaveOperation(parent, image, isInstantSave, toastService, recentImageService) { mPathToImageSource = pathToImageSource; } SaveResultDto SaveOperation::execute() { auto path = getSavePath(); if(!mIsInstantSave){ auto title = tr("Save As"); auto filter = tr("Images") + QLatin1String(" (*.png *.gif *.jpg);;") + tr("All Files") + QLatin1String("(*)"); auto fileDialogAdapter = FileDialogAdapterFactory::create(); auto selectedSavePath = fileDialogAdapter->getSavePath(mParent, title, path, filter); if (selectedSavePath.isNull()) { return SaveResultDto(false, path); } path = selectedSavePath; } auto saveResult = save(path); updateSaveDirectoryIfRequired(path, saveResult); if (saveResult.isSuccessful) { mRecentImageService->storeImagePath(path); } return saveResult; } void SaveOperation::updateSaveDirectoryIfRequired(const QString &path, const SaveResultDto &saveResult) const { if(!mIsInstantSave && saveResult.isSuccessful && mConfig->rememberLastSaveDirectory()){ auto directory = PathHelper::extractParentDirectory(path); mConfig->setSaveDirectory(directory); } } QString SaveOperation::getSavePath() const { return PathHelper::isPathValid(mPathToImageSource) ? mPathToImageSource : mSavePathProvider.savePath(); } SaveResultDto SaveOperation::save(const QString &path) { auto successful = mImageSaver.save(mImage, path); if(successful) { notify(tr("Image Saved"), tr("Saved to"), path, NotificationTypes::Information); } else { notify(tr("Saving Image Failed"), tr("Failed to save image to"), path, NotificationTypes::Critical); } return SaveResultDto(successful, path); } void SaveOperation::notify(const QString &title, const QString &message, const QString &path, NotificationTypes notificationType) const { NotifyOperation operation(mToastService, title, message + QLatin1String(" ") + path, path, notificationType); operation.execute(); } ksnip-1.9.2/src/gui/operations/SaveOperation.h000066400000000000000000000043651414701001100213320ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_SAVEOPERATION_H #define KSNIP_SAVEOPERATION_H #include #include "NotifyOperation.h" #include "src/common/dtos/SaveResultDto.h" #include "src/common/adapter/fileDialog/FileDialogAdapterFactory.h" #include "src/backend/recentImages/IRecentImageService.h" #include "src/backend/config/KsnipConfig.h" #include "src/backend/saver/SavePathProvider.h" #include "src/backend/saver/ImageSaver.h" #include "src/gui/IToastService.h" class SaveOperation : public QObject { Q_OBJECT public: SaveOperation(QWidget *parent, QImage image, bool isInstantSave, IToastService *toastService, IRecentImageService *recentImageService); SaveOperation(QWidget *parent, const QImage &image, bool isInstantSave, const QString &pathToImageSource, IToastService *toastService, IRecentImageService *recentImageService); ~SaveOperation() override = default; SaveResultDto execute(); private: QWidget* mParent; QImage mImage; SavePathProvider mSavePathProvider; ImageSaver mImageSaver; QString mPathToImageSource; bool mIsInstantSave; IToastService *mToastService; IRecentImageService *mRecentImageService; KsnipConfig *mConfig; void notify(const QString &title, const QString &message, const QString &path, NotificationTypes notificationType) const; SaveResultDto save(const QString &path); QString getSavePath() const; void updateSaveDirectoryIfRequired(const QString &path, const SaveResultDto &saveResult) const; }; #endif //KSNIP_SAVEOPERATION_H ksnip-1.9.2/src/gui/operations/UpdateWatermarkOperation.cpp000066400000000000000000000025471414701001100240670ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "UpdateWatermarkOperation.h" UpdateWatermarkOperation::UpdateWatermarkOperation(QWidget *parent) { mParent = parent; } bool UpdateWatermarkOperation::execute() { auto title = tr("Select Image"); auto filter = tr("Images") + QLatin1String(" (*.png *.gif *.jpg);;") + tr("All Files") + QLatin1String("(*)"); QFileDialog dialog(mParent, title, QString(), filter); dialog.setAcceptMode(QFileDialog::AcceptOpen); if (dialog.exec() != QDialog::Accepted) { return false; } auto pathToImage = dialog.selectedFiles().first(); return mImageLoader.save(QPixmap(pathToImage)); } ksnip-1.9.2/src/gui/operations/UpdateWatermarkOperation.h000066400000000000000000000023711414701001100235270ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_UPDATEWATERMARKOPERATION_H #define KSNIP_UPDATEWATERMARKOPERATION_H #include #include #include "src/backend/WatermarkImageLoader.h" class UpdateWatermarkOperation : public QObject { Q_OBJECT public: explicit UpdateWatermarkOperation(QWidget *parent); ~UpdateWatermarkOperation() override = default; bool execute(); private: QWidget *mParent; WatermarkImageLoader mImageLoader; }; #endif //KSNIP_UPDATEWATERMARKOPERATION_H ksnip-1.9.2/src/gui/operations/UploadOperation.cpp000066400000000000000000000035261414701001100222110ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "UploadOperation.h" UploadOperation::UploadOperation(QImage image, IUploader* uploader) : mImage(std::move(image)), mUploader(uploader), mConfig(KsnipConfigProvider::instance()), mMessageBoxService(new MessageBoxService) { Q_ASSERT(mUploader != nullptr); } UploadOperation::~UploadOperation() { delete mMessageBoxService; } bool UploadOperation::execute() { if (mUploader->type() == UploaderType::Script && !PathHelper::isPathValid(mConfig->uploadScriptPath())) { mMessageBoxService->ok(tr("Upload Script Required"), tr("Please add an upload script via Options > Settings > Upload Script")); } else if (!mImage.isNull() && proceedWithUpload()) { mUploader->upload(mImage); return true; } return false; } bool UploadOperation::proceedWithUpload() const { return !mConfig->confirmBeforeUpload() || askIfCanProceedWithUpload(); } bool UploadOperation::askIfCanProceedWithUpload() const { return mMessageBoxService->yesNo(tr("Capture Upload"), tr("You are about to upload the image to an external destination, do you want to proceed?")); } ksnip-1.9.2/src/gui/operations/UploadOperation.h000066400000000000000000000026661414701001100216620ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_UPLOADOPERATION_H #define KSNIP_UPLOADOPERATION_H #include #include #include #include "src/backend/uploader/IUploader.h" #include "src/backend/config/KsnipConfigProvider.h" #include "src/gui/messageBoxService/MessageBoxService.h" class UploadOperation : public QObject { Q_OBJECT public: UploadOperation(QImage image, IUploader *uploader); ~UploadOperation() override; bool execute(); private: KsnipConfig *mConfig; IUploader *mUploader; QImage mImage; IMessageBoxService *mMessageBoxService; bool proceedWithUpload() const; bool askIfCanProceedWithUpload() const; }; #endif //KSNIP_UPLOADOPERATION_H ksnip-1.9.2/src/gui/operations/WatermarkImagePreparer.cpp000066400000000000000000000045451414701001100235070ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "WatermarkImagePreparer.h" WatermarkImagePreparer::WatermarkImagePreparer() { mOpacity = 0.15; } QPixmap WatermarkImagePreparer::prepare(const QPixmap &image, const QSize &availableSpace, bool rotated) const { auto finishedWatermarkImage = getPreparedWatermarkImage(image, rotated); return fitWatermarkIntoCapture(finishedWatermarkImage, availableSpace); } QPixmap WatermarkImagePreparer::getPreparedWatermarkImage(const QPixmap &watermarkImage, bool rotated) const { auto preparedImage = watermarkImage; if(rotated) { preparedImage = getRotatedImage(watermarkImage); } QPixmap transparentWatermark(preparedImage.size()); transparentWatermark.fill(Qt::transparent); QPainter painter(&transparentWatermark); painter.setOpacity(mOpacity); painter.drawPixmap(0, 0, preparedImage); return transparentWatermark; } QPixmap WatermarkImagePreparer::getRotatedImage(const QPixmap &watermarkImage) const { QTransform transform; transform.rotate(45); return watermarkImage.transformed(transform); } QPixmap &WatermarkImagePreparer::fitWatermarkIntoCapture(QPixmap &finishedWatermarkImage, const QSize &availableSpace) const { auto widthRatio = (qreal) availableSpace.width() / (qreal) finishedWatermarkImage.size().width(); auto heightRatio = (qreal) availableSpace.height() / (qreal) finishedWatermarkImage.size().height(); if (widthRatio < 1 || heightRatio < 1) { auto minRatio = qMin(widthRatio, heightRatio); QTransform transform; transform.scale(minRatio, minRatio); finishedWatermarkImage = finishedWatermarkImage.transformed(transform); } return finishedWatermarkImage; } ksnip-1.9.2/src/gui/operations/WatermarkImagePreparer.h000066400000000000000000000026131414701001100231460ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_WATERMARKIMAGEPREPARER_H #define KSNIP_WATERMARKIMAGEPREPARER_H #include class WatermarkImagePreparer { public: explicit WatermarkImagePreparer(); ~WatermarkImagePreparer() = default; QPixmap prepare(const QPixmap &image, const QSize &availableSpace, bool rotated) const; private: qreal mOpacity; QPixmap getPreparedWatermarkImage(const QPixmap &watermarkImage, bool rotated) const; QPixmap &fitWatermarkIntoCapture(QPixmap &finishedWatermarkImage, const QSize &availableSpace) const; QPixmap getRotatedImage(const QPixmap &watermarkImage) const; }; #endif //KSNIP_WATERMARKIMAGEPREPARER_H ksnip-1.9.2/src/gui/pinWindow/000077500000000000000000000000001414701001100161655ustar00rootroot00000000000000ksnip-1.9.2/src/gui/pinWindow/PinWindow.cpp000066400000000000000000000070061414701001100206120ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "PinWindow.h" PinWindow::PinWindow(const QPixmap &pixmap, const QString &title) : QDialog(nullptr), mLayout(new QVBoxLayout(this)), mCentralWidget(new QLabel(this)), mDropShadowEffect(new QGraphicsDropShadowEffect(this)), mMargin(10), mMinSize(50), mImage(pixmap), mIsMoving(false) { setWindowFlags(windowFlags() | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::CoverWindow); setAttribute(Qt::WA_TranslucentBackground); setModal(false); setWindowTitle(title); setAttribute(Qt::WA_DeleteOnClose); setMouseTracking(true); setCursor(Qt::SizeAllCursor); mCentralWidget->setPixmap(mImage); mLayout->addWidget(mCentralWidget); setContentsMargins(mMargin, mMargin, mMargin, mMargin); addDropShadow(); } PinWindow::~PinWindow() { delete mLayout; delete mCentralWidget; delete mDropShadowEffect; } void PinWindow::addDropShadow() { mDropShadowEffect->setColor(QColor(160, 160, 160)); mDropShadowEffect->setBlurRadius(mMargin * 2); mDropShadowEffect->setOffset(0); setGraphicsEffect(mDropShadowEffect); } void PinWindow::mouseDoubleClickEvent(QMouseEvent *event) { Q_UNUSED(event) emit close(); } void PinWindow::mousePressEvent(QMouseEvent *event) { if(event->button() == Qt::LeftButton) { mIsMoving = true; mMoveOffset = event->globalPos() - pos(); } QWidget::mousePressEvent(event); } void PinWindow::mouseReleaseEvent(QMouseEvent *event) { if(event->button() == Qt::LeftButton) { mIsMoving = false; mMoveOffset = {}; } QWidget::mouseReleaseEvent(event); } void PinWindow::mouseMoveEvent(QMouseEvent *event) { if(mIsMoving) { move(event->globalPos() - mMoveOffset); } QWidget::mouseMoveEvent(event); } void PinWindow::keyPressEvent(QKeyEvent *event) { if(event->key() == Qt::Key_Escape) { emit close(); } } void PinWindow::contextMenuEvent(QContextMenuEvent *event) { QMenu menu; menu.addAction(tr("Close"), this, &PinWindow::closeRequest); menu.addAction(tr("Close Other"), this, &PinWindow::closeOtherRequest); menu.addAction(tr("Close All"), this, &PinWindow::closeAllRequest); menu.exec(event->globalPos()); } void PinWindow::enterEvent(QEvent *event) { mDropShadowEffect->setBlurRadius(mDropShadowEffect->blurRadius() + 4); QWidget::enterEvent(event); } void PinWindow::leaveEvent(QEvent *event) { mDropShadowEffect->setBlurRadius(mDropShadowEffect->blurRadius() - 4); QWidget::leaveEvent(event); } void PinWindow::wheelEvent(QWheelEvent *event) { auto delta = event->delta() / 10; auto scaledSize = QSize(mCentralWidget->width() + delta, mCentralWidget->height() + delta); if(scaledSize.width() > mMinSize && scaledSize.height() > mMinSize) { auto scaledImage = mImage.scaled(scaledSize, Qt::KeepAspectRatio, Qt::SmoothTransformation); mCentralWidget->setPixmap(scaledImage); adjustSize(); } } ksnip-1.9.2/src/gui/pinWindow/PinWindow.h000066400000000000000000000037031414701001100202570ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_PINWINDOW_H #define KSNIP_PINWINDOW_H #include #include #include #include #include #include #include #include #include class PinWindow : public QDialog { Q_OBJECT public: explicit PinWindow(const QPixmap &pixmap, const QString &title); ~PinWindow() override; signals: void closeRequest(); void closeOtherRequest(); void closeAllRequest(); protected: void mouseDoubleClickEvent(QMouseEvent *event) override; void mousePressEvent(QMouseEvent *event) override; void mouseReleaseEvent(QMouseEvent *event) override; void mouseMoveEvent(QMouseEvent *event) override; void contextMenuEvent(QContextMenuEvent *event) override; void keyPressEvent(QKeyEvent *event) override; void enterEvent(QEvent *event) override; void leaveEvent(QEvent *event) override; void wheelEvent(QWheelEvent *event) override; private: QLabel *mCentralWidget; QVBoxLayout *mLayout; QGraphicsDropShadowEffect *mDropShadowEffect; int mMargin; int mMinSize; QPixmap mImage; QPoint mMoveOffset; bool mIsMoving{}; void addDropShadow(); }; #endif //KSNIP_PINWINDOW_H ksnip-1.9.2/src/gui/pinWindow/PinWindowHandler.cpp000066400000000000000000000045151414701001100221120ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "PinWindowHandler.h" PinWindowHandler::PinWindowHandler(QWidget *parent) : QObject(parent), mParent(parent) { } PinWindowHandler::~PinWindowHandler() { mPinWindows.clear(); } void PinWindowHandler::add(const QPixmap &pixmap) { auto pinWindow = CreatePinWindow(pixmap); pinWindow->show(); mPinWindows.append(pinWindow); } QSharedPointer PinWindowHandler::CreatePinWindow(const QPixmap &pixmap) const { auto title = tr("Pin Window %1").arg(QString::number(mPinWindows.count() + 1)); auto pinWindow = QSharedPointer(new PinWindow(pixmap, title)); connect(pinWindow.data(), &PinWindow::closeRequest, this, &PinWindowHandler::closeRequested); connect(pinWindow.data(), &PinWindow::closeOtherRequest, this, &PinWindowHandler::closeOtherRequested); connect(pinWindow.data(), &PinWindow::closeAllRequest, this, &PinWindowHandler::closeAllRequested); return pinWindow; } void PinWindowHandler::closeRequested() { auto caller = dynamic_cast(sender()); caller->hide(); for(const auto& pinWindow : mPinWindows){ if(pinWindow.data() == caller) { mPinWindows.removeOne(pinWindow); break; } } } void PinWindowHandler::closeAllRequested() { for(const auto& pinWindow : mPinWindows){ pinWindow->hide(); } mPinWindows.clear(); } void PinWindowHandler::closeOtherRequested() { auto caller = dynamic_cast(sender()); for (auto iterator = mPinWindows.begin(); iterator != mPinWindows.end(); ++iterator) { if(iterator->data() != caller) { iterator->data()->hide(); mPinWindows.removeOne(*iterator); } } } ksnip-1.9.2/src/gui/pinWindow/PinWindowHandler.h000066400000000000000000000025651414701001100215620ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_PINWINDOWHANDLER_H #define KSNIP_PINWINDOWHANDLER_H #include #include #include #include "PinWindow.h" class PinWindowHandler : public QObject { Q_OBJECT public: explicit PinWindowHandler(QWidget *parent); ~PinWindowHandler() override; void add(const QPixmap &pixmap); public slots: void closeRequested(); void closeAllRequested(); void closeOtherRequested(); private: QWidget *mParent; QList> mPinWindows; QSharedPointer CreatePinWindow(const QPixmap &pixmap) const; }; #endif //KSNIP_PINWINDOWHANDLER_H ksnip-1.9.2/src/gui/serviceLocator/000077500000000000000000000000001414701001100171735ustar00rootroot00000000000000ksnip-1.9.2/src/gui/serviceLocator/IServiceLocator.h000066400000000000000000000027711414701001100224100ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_ISERVICELOCATOR_H #define KSNIP_ISERVICELOCATOR_H #include "src/gui/fileService/IFileService.h" #include "src/gui/messageBoxService/IMessageBoxService.h" #include "src/gui/clipboard/IClipboard.h" #include "src/gui/desktopService/IDesktopService.h" #include "src/backend/recentImages/IRecentImageService.h" class IServiceLocator { public: explicit IServiceLocator() = default; virtual ~IServiceLocator() = default; virtual IMessageBoxService* messageBoxService() const = 0; virtual IFileService* fileService() const = 0; virtual IClipboard* clipboard() const = 0; virtual IDesktopService* desktopService() const = 0; virtual IRecentImageService* recentImageService() const = 0; }; #endif //KSNIP_ISERVICELOCATOR_H ksnip-1.9.2/src/gui/serviceLocator/ServiceLocator.cpp000066400000000000000000000036551414701001100226340ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "ServiceLocator.h" ServiceLocator::ServiceLocator() : mMessageBoxService(new MessageBoxService), mFileService(new FileService), mClipboard(new ClipboardAdapter), mDesktopService(new DesktopServiceAdapter), mRecentImageService(new RecentImagesPathStore(new ImagePathStorage)) { } ServiceLocator::ServiceLocator(ServiceLocator &other) : mMessageBoxService(new MessageBoxService), mFileService(new FileService), mClipboard(new ClipboardAdapter), mDesktopService(new DesktopServiceAdapter), mRecentImageService(new RecentImagesPathStore(new ImagePathStorage)) { } ServiceLocator::~ServiceLocator() { delete mMessageBoxService; delete mFileService; delete mClipboard; delete mDesktopService; delete mRecentImageService; } IMessageBoxService* ServiceLocator::messageBoxService() const { return mMessageBoxService; } IFileService* ServiceLocator::fileService() const { return mFileService; } IClipboard *ServiceLocator::clipboard() const { return mClipboard; } IDesktopService *ServiceLocator::desktopService() const { return mDesktopService; } IRecentImageService *ServiceLocator::recentImageService() const { return mRecentImageService; } ksnip-1.9.2/src/gui/serviceLocator/ServiceLocator.h000066400000000000000000000034511414701001100222730ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_SERVICELOCATOR_H #define KSNIP_SERVICELOCATOR_H #include "IServiceLocator.h" #include "src/gui/fileService/FileService.h" #include "src/gui/messageBoxService/MessageBoxService.h" #include "src/gui/clipboard/ClipboardAdapter.h" #include "src/gui/desktopService/DesktopServiceAdapter.h" #include "src/backend/recentImages/RecentImagesPathStore.h" #include "src/backend/recentImages/ImagePathStorage.h" class ServiceLocator : public IServiceLocator { public: explicit ServiceLocator(); ServiceLocator(ServiceLocator &other); ~ServiceLocator() override; IMessageBoxService* messageBoxService() const override; IFileService* fileService() const override; IClipboard* clipboard() const override; IDesktopService* desktopService() const override; IRecentImageService* recentImageService() const override; private: IFileService *mFileService; IMessageBoxService *mMessageBoxService; IClipboard *mClipboard; IDesktopService *mDesktopService; IRecentImageService *mRecentImageService; }; #endif //KSNIP_SERVICELOCATOR_H ksnip-1.9.2/src/gui/settingsDialog/000077500000000000000000000000001414701001100171675ustar00rootroot00000000000000ksnip-1.9.2/src/gui/settingsDialog/AnnotationSettings.cpp000066400000000000000000000147321414701001100235350ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "AnnotationSettings.h" AnnotationSettings::AnnotationSettings(KsnipConfig *config) : mSmoothPathCheckbox(new QCheckBox(this)), mRememberToolSelectionCheckBox(new QCheckBox(this)), mSwitchToSelectToolAfterDrawingItemCheckBox(new QCheckBox(this)), mNumberToolSeedChangeUpdatesAllItemsCheckBox(new QCheckBox(this)), mSelectItemAfterDrawingCheckBox(new QCheckBox(this)), mSmoothFactorLabel(new QLabel(this)), mCanvasColorLabel(new QLabel(this)), mSmoothFactorCombobox(new NumericComboBox(1, 1, 15)), mCanvasColorButton(new ColorButton(this)), mLayout(new QGridLayout(this)), mConfig(config) { Q_ASSERT(mConfig != nullptr); initGui(); loadConfig(); } AnnotationSettings::~AnnotationSettings() { delete mSmoothPathCheckbox; delete mRememberToolSelectionCheckBox; delete mSwitchToSelectToolAfterDrawingItemCheckBox; delete mNumberToolSeedChangeUpdatesAllItemsCheckBox; delete mSelectItemAfterDrawingCheckBox; delete mSmoothFactorLabel; delete mCanvasColorLabel; delete mSmoothFactorCombobox; delete mCanvasColorButton; delete mLayout; } void AnnotationSettings::saveSettings() { mConfig->setSmoothPathEnabled(mSmoothPathCheckbox->isChecked()); mConfig->setSmoothFactor(mSmoothFactorCombobox->value()); mConfig->setRememberToolSelection(mRememberToolSelectionCheckBox->isChecked()); mConfig->setSwitchToSelectToolAfterDrawingItem(mSwitchToSelectToolAfterDrawingItemCheckBox->isChecked()); mConfig->setNumberToolSeedChangeUpdatesAllItems(mNumberToolSeedChangeUpdatesAllItemsCheckBox->isChecked()); mConfig->setSelectItemAfterDrawing(mSelectItemAfterDrawingCheckBox->isChecked()); mConfig->setCanvasColor(mCanvasColorButton->color()); } void AnnotationSettings::initGui() { auto const fixedButtonWidth = ScaledSizeProvider::scaledWidth(100); mRememberToolSelectionCheckBox->setText(tr("Remember annotation tool selection and load on startup")); mSwitchToSelectToolAfterDrawingItemCheckBox->setText(tr("Switch to Select Tool after drawing Item")); connect(mSwitchToSelectToolAfterDrawingItemCheckBox, &QCheckBox::clicked, this, &AnnotationSettings::switchToSelectToolAfterDrawingItemCheckBoxClicked); mSelectItemAfterDrawingCheckBox->setText(tr("Select Item after drawing")); mSelectItemAfterDrawingCheckBox->setToolTip(tr("With this option enabled the item gets selected after\n" "being created, allowing changing settings.")); mNumberToolSeedChangeUpdatesAllItemsCheckBox->setText(tr("Number Tool Seed change updates all Number Items")); mNumberToolSeedChangeUpdatesAllItemsCheckBox->setToolTip(tr("Disabling this option causes changes of the number tool\n" "seed to affect only new items but not existing items.\n" "Disabling this option allows having duplicate numbers.")); mSmoothPathCheckbox->setText(tr("Smooth Painter Paths")); mSmoothPathCheckbox->setToolTip(tr("When enabled smooths out pen and\n" "marker paths after finished drawing.")); connect(mSmoothPathCheckbox, &QCheckBox::clicked, this, &AnnotationSettings::smoothPathCheckBoxClicked); mSmoothFactorLabel->setText(tr("Smooth Factor") + QLatin1String(":")); mSmoothFactorLabel->setToolTip(tr("Increasing the smooth factor will decrease\n" "precision for pen and marker but will\n" "make them more smooth.")); mSmoothFactorCombobox->setMinimumWidth(fixedButtonWidth); mSmoothFactorCombobox->setToolTip(mSmoothFactorLabel->toolTip()); mCanvasColorLabel->setText(tr("Canvas Color") + QLatin1String(":")); mCanvasColorLabel->setToolTip(tr("Default Canvas background color for annotation area.\n" "Changing color affects only new annotation areas.")); mCanvasColorButton->setMinimumWidth(fixedButtonWidth); mCanvasColorButton->setShowAlphaChannel(true); mLayout->setAlignment(Qt::AlignTop); mLayout->setColumnMinimumWidth(0, 10); mLayout->addWidget(mRememberToolSelectionCheckBox, 0, 0, 1, 6); mLayout->addWidget(mSwitchToSelectToolAfterDrawingItemCheckBox, 1, 0, 1, 6); mLayout->addWidget(mSelectItemAfterDrawingCheckBox, 2, 1, 1, 5); mLayout->addWidget(mNumberToolSeedChangeUpdatesAllItemsCheckBox, 3, 0, 1, 6); mLayout->addWidget(mSmoothPathCheckbox, 4, 0, 1, 6); mLayout->addWidget(mSmoothFactorLabel, 5, 1, 1, 3); mLayout->addWidget(mSmoothFactorCombobox, 5, 3, 1,3, Qt::AlignLeft); mLayout->setRowMinimumHeight(6, 15); mLayout->addWidget(mCanvasColorLabel, 7, 0, 1, 2); mLayout->addWidget(mCanvasColorButton, 7, 3, 1,3, Qt::AlignLeft); setTitle(tr("Annotator Settings")); setLayout(mLayout); } void AnnotationSettings::loadConfig() { mSmoothPathCheckbox->setChecked(mConfig->smoothPathEnabled()); mSmoothFactorCombobox->setValue(mConfig->smoothFactor()); mRememberToolSelectionCheckBox->setChecked(mConfig->rememberToolSelection()); mSwitchToSelectToolAfterDrawingItemCheckBox->setChecked(mConfig->switchToSelectToolAfterDrawingItem()); mNumberToolSeedChangeUpdatesAllItemsCheckBox->setChecked(mConfig->numberToolSeedChangeUpdatesAllItems()); mSelectItemAfterDrawingCheckBox->setChecked(mConfig->selectItemAfterDrawing()); mCanvasColorButton->setColor(mConfig->canvasColor()); smoothPathCheckBoxClicked(mConfig->smoothPathEnabled()); switchToSelectToolAfterDrawingItemCheckBoxClicked(mConfig->switchToSelectToolAfterDrawingItem()); } void AnnotationSettings::smoothPathCheckBoxClicked(bool checked) { mSmoothFactorLabel->setEnabled(checked); mSmoothFactorCombobox->setEnabled(checked); } void AnnotationSettings::switchToSelectToolAfterDrawingItemCheckBoxClicked(bool checked) { mSelectItemAfterDrawingCheckBox->setEnabled(checked); } ksnip-1.9.2/src/gui/settingsDialog/AnnotationSettings.h000066400000000000000000000040561414701001100232000ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_ANNOTATIONSETTINGS_H #define KSNIP_ANNOTATIONSETTINGS_H #include #include #include #include #include #include "src/backend/config/KsnipConfig.h" #include "src/backend/WatermarkImageLoader.h" #include "src/widgets/NumericComboBox.h" #include "src/widgets/ColorButton.h" #include "src/common/loader/IconLoader.h" #include "src/common/provider/ScaledSizeProvider.h" class AnnotationSettings : public QGroupBox { Q_OBJECT public: explicit AnnotationSettings(KsnipConfig *config); ~AnnotationSettings() override; void saveSettings(); private: QCheckBox *mSmoothPathCheckbox; QCheckBox *mRememberToolSelectionCheckBox; QCheckBox *mSwitchToSelectToolAfterDrawingItemCheckBox; QCheckBox *mNumberToolSeedChangeUpdatesAllItemsCheckBox; QCheckBox *mSelectItemAfterDrawingCheckBox; QLabel *mSmoothFactorLabel; QLabel *mCanvasColorLabel; NumericComboBox *mSmoothFactorCombobox; ColorButton *mCanvasColorButton; QGridLayout *mLayout; KsnipConfig *mConfig; void initGui(); void loadConfig(); private slots: void smoothPathCheckBoxClicked(bool checked); void switchToSelectToolAfterDrawingItemCheckBoxClicked(bool checked); }; #endif //KSNIP_ANNOTATIONSETTINGS_H ksnip-1.9.2/src/gui/settingsDialog/ApplicationSettings.cpp000066400000000000000000000150341414701001100236620ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "ApplicationSettings.h" ApplicationSettings::ApplicationSettings(KsnipConfig *ksnipConfig) : mConfig(ksnipConfig), mAutoCopyToClipboardNewCapturesCheckbox(new QCheckBox(this)), mRememberPositionCheckbox(new QCheckBox(this)), mCaptureOnStartupCheckbox(new QCheckBox(this)), mUseTabsCheckbox(new QCheckBox(this)), mAutoHideTabsCheckbox(new QCheckBox(this)), mUseSingleInstanceCheckBox(new QCheckBox(this)), mAutoHideDocksCheckBox(new QCheckBox(this)), mAutoResizeToContentCheckBox(new QCheckBox(this)), mApplicationStyleLabel(new QLabel(this)), mResizeToContentDelayLabel(new QLabel(this)), mApplicationStyleCombobox(new QComboBox(this)), mResizeToContentDelaySpinBox(new CustomSpinBox(0, 1000, this)), mLayout(new QGridLayout) { Q_ASSERT(mConfig != nullptr); initGui(); loadConfig(); } void ApplicationSettings::initGui() { mAutoCopyToClipboardNewCapturesCheckbox->setText(tr("Automatically copy new captures to clipboard")); mRememberPositionCheckbox->setText(tr("Remember Main Window position on move and load on startup")); mCaptureOnStartupCheckbox->setText(tr("Capture screenshot at startup with default mode")); mUseTabsCheckbox->setText(tr("Use Tabs")); mUseTabsCheckbox->setToolTip(tr("Change requires restart.")); mAutoHideTabsCheckbox->setText(tr("Auto hide Tabs")); mAutoHideTabsCheckbox->setToolTip(tr("Hide Tabbar when only one Tab is used.")); mUseSingleInstanceCheckBox->setText(tr("Run ksnip as single instance")); mUseSingleInstanceCheckBox->setToolTip(tr("Enabling this option will allow only one ksnip instance to run,\n" "all other instances started after the first will pass its\n" "arguments to the first and close. Changing this option requires\n" "a new start of all instances.")); mAutoHideDocksCheckBox->setText(tr("Auto hide Docks")); mAutoHideDocksCheckBox->setToolTip(tr("On startup hide Toolbar and Annotation Settings.\n" "Docks visibility can be toggled with the Tab Key.")); mAutoResizeToContentCheckBox->setText(tr("Auto resize to content")); mAutoResizeToContentCheckBox->setToolTip(tr("Automatically resize Main Window to fit content image.")); mResizeToContentDelayLabel->setText(tr("Resize to content delay") + QLatin1String(":")); mResizeToContentDelayLabel->setToolTip(tr("Resizing to content is delay to allow the Window Manager to receive\n" "the new content. In case that the Main Windows is not adjusted correctly\n" "to the new content, increasing this delay might improve the behavior.")); mResizeToContentDelaySpinBox->setSuffix(QLatin1String("ms")); mResizeToContentDelaySpinBox->setToolTip(mResizeToContentDelayLabel->toolTip()); connect(mUseTabsCheckbox, &QCheckBox::stateChanged, this, &ApplicationSettings::useTabsChanged); mApplicationStyleLabel->setText(tr("Application Style") + QLatin1String(":")); mApplicationStyleLabel->setToolTip(tr("Sets the application style which defines the look and feel of the GUI.\n" "Change requires ksnip restart to take effect.")); mApplicationStyleCombobox->addItems(QStyleFactory::keys()); mApplicationStyleCombobox->setToolTip(mApplicationStyleLabel->toolTip()); mApplicationStyleCombobox->setFixedWidth(100); mLayout->setAlignment(Qt::AlignTop); mLayout->setColumnMinimumWidth(0, 10); mLayout->addWidget(mAutoCopyToClipboardNewCapturesCheckbox, 0, 0, 1, 4); mLayout->addWidget(mRememberPositionCheckbox, 1, 0, 1, 4); mLayout->addWidget(mCaptureOnStartupCheckbox, 2, 0, 1, 4); mLayout->addWidget(mUseTabsCheckbox, 3, 0, 1, 4); mLayout->addWidget(mAutoHideTabsCheckbox, 4, 1, 1, 3); mLayout->addWidget(mUseSingleInstanceCheckBox, 5, 0, 1, 4); mLayout->addWidget(mAutoHideDocksCheckBox, 6, 0, 1, 4); mLayout->addWidget(mAutoResizeToContentCheckBox, 7, 0, 1, 4); mLayout->addWidget(mResizeToContentDelayLabel, 8, 0, 1, 2); mLayout->addWidget(mResizeToContentDelaySpinBox, 8, 2, Qt::AlignLeft); mLayout->setRowMinimumHeight(9, 15); mLayout->addWidget(mApplicationStyleLabel, 10, 0, 1, 2); mLayout->addWidget(mApplicationStyleCombobox, 10, 2, Qt::AlignLeft); setTitle(tr("Application Settings")); setLayout(mLayout); } void ApplicationSettings::loadConfig() { mAutoCopyToClipboardNewCapturesCheckbox->setChecked(mConfig->autoCopyToClipboardNewCaptures()); mRememberPositionCheckbox->setChecked(mConfig->rememberPosition()); mCaptureOnStartupCheckbox->setChecked(mConfig->captureOnStartup()); mUseTabsCheckbox->setChecked(mConfig->useTabs()); mAutoHideTabsCheckbox->setChecked(mConfig->autoHideTabs()); mUseSingleInstanceCheckBox->setChecked(mConfig->useSingleInstance()); mAutoHideDocksCheckBox->setChecked(mConfig->autoHideDocks()); mAutoResizeToContentCheckBox->setChecked(mConfig->autoResizeToContent()); mResizeToContentDelaySpinBox->setValue(mConfig->resizeToContentDelay()); mApplicationStyleCombobox->setCurrentText(mConfig->applicationStyle()); useTabsChanged(); } void ApplicationSettings::saveSettings() { mConfig->setAutoCopyToClipboardNewCaptures(mAutoCopyToClipboardNewCapturesCheckbox->isChecked()); mConfig->setRememberPosition(mRememberPositionCheckbox->isChecked()); mConfig->setCaptureOnStartup(mCaptureOnStartupCheckbox->isChecked()); mConfig->setUseSingleInstance(mUseSingleInstanceCheckBox->isChecked()); mConfig->setUseTabs(mUseTabsCheckbox->isChecked()); mConfig->setAutoHideTabs(mAutoHideTabsCheckbox->isChecked()); mConfig->setAutoHideDocks(mAutoHideDocksCheckBox->isChecked()); mConfig->setAutoResizeToContent(mAutoResizeToContentCheckBox->isChecked()); mConfig->setResizeToContentDelay(mResizeToContentDelaySpinBox->value()); mConfig->setApplicationStyle(mApplicationStyleCombobox->currentText()); } void ApplicationSettings::useTabsChanged() { mAutoHideTabsCheckbox->setEnabled(mUseTabsCheckbox->isChecked()); } ksnip-1.9.2/src/gui/settingsDialog/ApplicationSettings.h000066400000000000000000000037501414701001100233310ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_APPLICATIONSETTINGS_H #define KSNIP_APPLICATIONSETTINGS_H #include #include #include #include #include #include #include #include #include #include "src/backend/config/KsnipConfig.h" #include "src/common/helper/EnumTranslator.h" #include "src/widgets/CustomSpinBox.h" class ApplicationSettings : public QGroupBox { Q_OBJECT public: explicit ApplicationSettings(KsnipConfig *ksnipConfig); ~ApplicationSettings() override = default; void saveSettings(); private: QCheckBox *mAutoCopyToClipboardNewCapturesCheckbox; QCheckBox *mRememberPositionCheckbox; QCheckBox *mCaptureOnStartupCheckbox; QCheckBox *mUseTabsCheckbox; QCheckBox *mAutoHideTabsCheckbox; QCheckBox *mUseSingleInstanceCheckBox; QCheckBox *mAutoHideDocksCheckBox; QCheckBox *mAutoResizeToContentCheckBox; QLabel *mApplicationStyleLabel; QLabel *mResizeToContentDelayLabel; QComboBox *mApplicationStyleCombobox; CustomSpinBox *mResizeToContentDelaySpinBox; QGridLayout *mLayout; KsnipConfig *mConfig; void initGui(); void loadConfig(); private slots: void useTabsChanged(); }; #endif //KSNIP_APPLICATIONSETTINGS_H ksnip-1.9.2/src/gui/settingsDialog/HotKeySettings.cpp000066400000000000000000000250421414701001100226220ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "HotKeySettings.h" HotKeySettings::HotKeySettings(KsnipConfig *ksnipConfig, const QList &captureModes) : mConfig(ksnipConfig), mCaptureModes(captureModes), mEnableGlobalHotKeysCheckBox(new QCheckBox(this)), mRectAreaLabel(new QLabel(this)), mLastRectAreaLabel(new QLabel(this)), mFullScreenLabel(new QLabel(this)), mCurrentScreenLabel(new QLabel(this)), mActiveWindowLabel(new QLabel(this)), mWindowUnderCursorLabel(new QLabel(this)), mPortalLabel(new QLabel(this)), mRectAreaClearPushButton(new QPushButton(this)), mLastRectAreaClearPushButton(new QPushButton(this)), mFullScreenClearPushButton(new QPushButton(this)), mCurrentScreenClearPushButton(new QPushButton(this)), mActiveWindowClearPushButton(new QPushButton(this)), mWindowUnderCursorClearPushButton(new QPushButton(this)), mPortalClearPushButton(new QPushButton(this)), mLayout(new QGridLayout(this)) { Q_ASSERT(mConfig != nullptr); initGui(); loadConfig(); } HotKeySettings::~HotKeySettings() { delete mEnableGlobalHotKeysCheckBox; delete mRectAreaLabel; delete mLastRectAreaLabel; delete mFullScreenLabel; delete mCurrentScreenLabel; delete mActiveWindowLabel; delete mWindowUnderCursorLabel; delete mPortalLabel; delete mRectAreaKeySequenceLineEdit; delete mLastRectAreaKeySequenceLineEdit; delete mFullScreenKeySequenceLineEdit; delete mCurrentScreenKeySequenceLineEdit; delete mActiveWindowKeySequenceLineEdit; delete mWindowUnderCursorKeySequenceLineEdit; delete mPortalKeySequenceLineEdit; delete mRectAreaClearPushButton; delete mLastRectAreaClearPushButton; delete mFullScreenClearPushButton; delete mCurrentScreenClearPushButton; delete mActiveWindowClearPushButton; delete mWindowUnderCursorClearPushButton; delete mPortalClearPushButton; delete mLayout; } void HotKeySettings::saveSettings() { mConfig->setGlobalHotKeysEnabled(mEnableGlobalHotKeysCheckBox->isChecked()); mConfig->setRectAreaHotKey(mRectAreaKeySequenceLineEdit->value()); mConfig->setLastRectAreaHotKey(mLastRectAreaKeySequenceLineEdit->value()); mConfig->setFullScreenHotKey(mFullScreenKeySequenceLineEdit->value()); mConfig->setCurrentScreenHotKey(mCurrentScreenKeySequenceLineEdit->value()); mConfig->setActiveWindowHotKey(mActiveWindowKeySequenceLineEdit->value()); mConfig->setWindowUnderCursorHotKey(mWindowUnderCursorKeySequenceLineEdit->value()); mConfig->setPortalHotKey(mPortalKeySequenceLineEdit->value()); } void HotKeySettings::initGui() { auto allowedKeys = HotKeyMap::instance()->getAllKeys(); mRectAreaKeySequenceLineEdit = new KeySequenceLineEdit(this, allowedKeys); mLastRectAreaKeySequenceLineEdit = new KeySequenceLineEdit(this, allowedKeys); mFullScreenKeySequenceLineEdit = new KeySequenceLineEdit(this, allowedKeys); mCurrentScreenKeySequenceLineEdit = new KeySequenceLineEdit(this, allowedKeys); mActiveWindowKeySequenceLineEdit = new KeySequenceLineEdit(this, allowedKeys); mWindowUnderCursorKeySequenceLineEdit = new KeySequenceLineEdit(this, allowedKeys); mPortalKeySequenceLineEdit = new KeySequenceLineEdit(this, allowedKeys); mEnableGlobalHotKeysCheckBox->setText(tr("Enable Global HotKeys")); mEnableGlobalHotKeysCheckBox->setToolTip(tr("HotKeys are currently supported only for Windows and X11.\n" "Disabling this option makes also the action shortcuts ksnip only.")); connect(mEnableGlobalHotKeysCheckBox, &QCheckBox::stateChanged, this, &HotKeySettings::globalHotKeysStateChanged); mRectAreaLabel->setText(tr("Capture Rect Area") + QLatin1String(":")); mLastRectAreaLabel->setText(tr("Capture Last Rect Area") + QLatin1String(":")); mFullScreenLabel->setText(tr("Capture Full Screen") + QLatin1String(":")); mCurrentScreenLabel->setText(tr("Capture current Screen") + QLatin1String(":")); mActiveWindowLabel->setText(tr("Capture active Window") + QLatin1String(":")); mWindowUnderCursorLabel->setText(tr("Capture Window under Cursor") + QLatin1String(":")); mPortalLabel->setText(tr("Capture using Portal") + QLatin1String(":")); auto clearText = tr("Clear"); mRectAreaClearPushButton->setText(clearText); connect(mRectAreaClearPushButton, &QPushButton::clicked, mRectAreaKeySequenceLineEdit, &KeySequenceLineEdit::clear); mLastRectAreaClearPushButton->setText(clearText); connect(mLastRectAreaClearPushButton, &QPushButton::clicked, mLastRectAreaKeySequenceLineEdit, &KeySequenceLineEdit::clear); mFullScreenClearPushButton->setText(clearText); connect(mFullScreenClearPushButton, &QPushButton::clicked, mFullScreenKeySequenceLineEdit, &KeySequenceLineEdit::clear); mCurrentScreenClearPushButton->setText(clearText); connect(mCurrentScreenClearPushButton, &QPushButton::clicked, mCurrentScreenKeySequenceLineEdit, &KeySequenceLineEdit::clear); mActiveWindowClearPushButton->setText(clearText); connect(mActiveWindowClearPushButton, &QPushButton::clicked, mActiveWindowKeySequenceLineEdit, &KeySequenceLineEdit::clear); mWindowUnderCursorClearPushButton->setText(clearText); connect(mWindowUnderCursorClearPushButton, &QPushButton::clicked, mWindowUnderCursorKeySequenceLineEdit, &KeySequenceLineEdit::clear); mPortalClearPushButton->setText(clearText); connect(mPortalClearPushButton, &QPushButton::clicked, mPortalKeySequenceLineEdit, &KeySequenceLineEdit::clear); mLayout->setAlignment(Qt::AlignTop); mLayout->setColumnStretch(1, 1); mLayout->addWidget(mEnableGlobalHotKeysCheckBox, 0, 0, 1, 3); mLayout->addWidget(mRectAreaLabel, 1, 0, 1, 1); mLayout->addWidget(mRectAreaKeySequenceLineEdit, 1, 1, 1, 1); mLayout->addWidget(mRectAreaClearPushButton, 1, 2, 1, 1); mLayout->addWidget(mLastRectAreaLabel, 2, 0,1,1); mLayout->addWidget(mLastRectAreaKeySequenceLineEdit, 2, 1, 1, 1); mLayout->addWidget(mLastRectAreaClearPushButton, 2, 2, 1, 1); mLayout->addWidget(mFullScreenLabel, 3, 0, 1, 1); mLayout->addWidget(mFullScreenKeySequenceLineEdit, 3, 1, 1, 1); mLayout->addWidget(mFullScreenClearPushButton, 3, 2, 1, 1); mLayout->addWidget(mCurrentScreenLabel, 4, 0, 1, 1); mLayout->addWidget(mCurrentScreenKeySequenceLineEdit, 4, 1, 1, 1); mLayout->addWidget(mCurrentScreenClearPushButton, 4, 2, 1, 1); mLayout->addWidget(mActiveWindowLabel, 5, 0, 1, 1); mLayout->addWidget(mActiveWindowKeySequenceLineEdit, 5, 1, 1, 1); mLayout->addWidget(mActiveWindowClearPushButton, 5, 2, 1, 1); mLayout->addWidget(mWindowUnderCursorLabel, 6, 0, 1, 1); mLayout->addWidget(mWindowUnderCursorKeySequenceLineEdit, 6, 1, 1, 1); mLayout->addWidget(mWindowUnderCursorClearPushButton, 6, 2, 1, 1); mLayout->addWidget(mPortalLabel, 7, 0, 1, 1); mLayout->addWidget(mPortalKeySequenceLineEdit, 7, 1, 1, 1); mLayout->addWidget(mPortalClearPushButton, 7, 2, 1, 1); setTitle(tr("Global HotKeys")); setLayout(mLayout); } void HotKeySettings::loadConfig() { mEnableGlobalHotKeysCheckBox->setChecked(mConfig->globalHotKeysEnabled()); mEnableGlobalHotKeysCheckBox->setEnabled(!mConfig->isGlobalHotKeysEnabledReadOnly()); mRectAreaKeySequenceLineEdit->setValue(mConfig->rectAreaHotKey()); mLastRectAreaKeySequenceLineEdit->setValue(mConfig->lastRectAreaHotKey()); mFullScreenKeySequenceLineEdit->setValue(mConfig->fullScreenHotKey()); mCurrentScreenKeySequenceLineEdit->setValue(mConfig->currentScreenHotKey()); mActiveWindowKeySequenceLineEdit->setValue(mConfig->activeWindowHotKey()); mWindowUnderCursorKeySequenceLineEdit->setValue(mConfig->windowUnderCursorHotKey()); mPortalKeySequenceLineEdit->setValue(mConfig->portalHotKey()); globalHotKeysStateChanged(); } void HotKeySettings::globalHotKeysStateChanged() { auto hotKeysEnabled = mEnableGlobalHotKeysCheckBox->isChecked() && mEnableGlobalHotKeysCheckBox->isEnabled(); auto isRectAreaSupported = mCaptureModes.contains(CaptureModes::RectArea); auto isLastRectAreaSupported = mCaptureModes.contains(CaptureModes::LastRectArea); auto isFullScreenSupported = mCaptureModes.contains(CaptureModes::FullScreen); auto isCurrentScreenSupported = mCaptureModes.contains(CaptureModes::CurrentScreen); auto isActiveWindowSupported = mCaptureModes.contains(CaptureModes::ActiveWindow); auto isWindowUnderCursorSupported = mCaptureModes.contains(CaptureModes::WindowUnderCursor); auto isPortalSupported = mCaptureModes.contains(CaptureModes::Portal); mRectAreaLabel->setEnabled(hotKeysEnabled && isRectAreaSupported); mRectAreaKeySequenceLineEdit->setEnabled(hotKeysEnabled && isRectAreaSupported); mRectAreaClearPushButton->setEnabled(hotKeysEnabled && isRectAreaSupported); mLastRectAreaLabel->setEnabled(hotKeysEnabled && isLastRectAreaSupported); mLastRectAreaKeySequenceLineEdit->setEnabled(hotKeysEnabled && isLastRectAreaSupported); mLastRectAreaClearPushButton->setEnabled(hotKeysEnabled && isLastRectAreaSupported); mFullScreenLabel->setEnabled(hotKeysEnabled && isFullScreenSupported); mFullScreenKeySequenceLineEdit->setEnabled(hotKeysEnabled && isFullScreenSupported); mFullScreenClearPushButton->setEnabled(hotKeysEnabled && isFullScreenSupported); mCurrentScreenLabel->setEnabled(hotKeysEnabled && isCurrentScreenSupported); mCurrentScreenKeySequenceLineEdit->setEnabled(hotKeysEnabled && isCurrentScreenSupported); mCurrentScreenClearPushButton->setEnabled(hotKeysEnabled && isCurrentScreenSupported); mActiveWindowLabel->setEnabled(hotKeysEnabled && isActiveWindowSupported); mActiveWindowKeySequenceLineEdit->setEnabled(hotKeysEnabled && isActiveWindowSupported); mActiveWindowClearPushButton->setEnabled(hotKeysEnabled && isActiveWindowSupported); mWindowUnderCursorLabel->setEnabled(hotKeysEnabled && isWindowUnderCursorSupported); mWindowUnderCursorKeySequenceLineEdit->setEnabled(hotKeysEnabled && isWindowUnderCursorSupported); mWindowUnderCursorClearPushButton->setEnabled(hotKeysEnabled && isWindowUnderCursorSupported); mPortalLabel->setEnabled(hotKeysEnabled && isPortalSupported); mPortalKeySequenceLineEdit->setEnabled(hotKeysEnabled && isPortalSupported); mPortalClearPushButton->setEnabled(hotKeysEnabled && isPortalSupported); } ksnip-1.9.2/src/gui/settingsDialog/HotKeySettings.h000066400000000000000000000046161414701001100222730ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_HOTKEYSETTINGS_H #define KSNIP_HOTKEYSETTINGS_H #include #include #include #include #include #include "src/backend/config/KsnipConfig.h" #include "src/widgets/KeySequenceLineEdit.h" #include "src/gui/globalHotKeys/HotKeyMap.h" class HotKeySettings : public QGroupBox { Q_OBJECT public: explicit HotKeySettings(KsnipConfig *ksnipConfig, const QList &captureModes); ~HotKeySettings() override; void saveSettings(); private: QCheckBox *mEnableGlobalHotKeysCheckBox; QLabel *mRectAreaLabel; QLabel *mLastRectAreaLabel; QLabel *mFullScreenLabel; QLabel *mCurrentScreenLabel; QLabel *mActiveWindowLabel; QLabel *mWindowUnderCursorLabel; QLabel *mPortalLabel; KeySequenceLineEdit *mRectAreaKeySequenceLineEdit; KeySequenceLineEdit *mLastRectAreaKeySequenceLineEdit; KeySequenceLineEdit *mFullScreenKeySequenceLineEdit; KeySequenceLineEdit *mCurrentScreenKeySequenceLineEdit; KeySequenceLineEdit *mActiveWindowKeySequenceLineEdit; KeySequenceLineEdit *mWindowUnderCursorKeySequenceLineEdit; KeySequenceLineEdit *mPortalKeySequenceLineEdit; QPushButton *mRectAreaClearPushButton; QPushButton *mLastRectAreaClearPushButton; QPushButton *mFullScreenClearPushButton; QPushButton *mCurrentScreenClearPushButton; QPushButton *mActiveWindowClearPushButton; QPushButton *mWindowUnderCursorClearPushButton; QPushButton *mPortalClearPushButton; QGridLayout *mLayout; QList mCaptureModes; KsnipConfig *mConfig; void initGui(); void loadConfig(); private slots: void globalHotKeysStateChanged(); }; #endif //KSNIP_HOTKEYSETTINGS_H ksnip-1.9.2/src/gui/settingsDialog/ImageGrabberSettings.cpp000066400000000000000000000122661414701001100237320ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "ImageGrabberSettings.h" ImageGrabberSettings::ImageGrabberSettings(KsnipConfig *config) : mCaptureCursorCheckbox(new QCheckBox(this)), mHideMainWindowDuringScreenshotCheckbox(new QCheckBox(this)), mShowMainWindowAfterTakingScreenshotCheckbox(new QCheckBox(this)), mForceGenericWaylandCheckbox(new QCheckBox(this)), mScaleGenericWaylandScreenshotsCheckbox(new QCheckBox(this)), mLayout(new QGridLayout(this)), mConfig(config) { Q_ASSERT(mConfig != nullptr); initGui(); loadConfig(); } ImageGrabberSettings::~ImageGrabberSettings() { delete mCaptureCursorCheckbox; delete mHideMainWindowDuringScreenshotCheckbox; delete mShowMainWindowAfterTakingScreenshotCheckbox; delete mForceGenericWaylandCheckbox; delete mScaleGenericWaylandScreenshotsCheckbox; delete mLayout; } void ImageGrabberSettings::saveSettings() { mConfig->setHideMainWindowDuringScreenshot(mHideMainWindowDuringScreenshotCheckbox->isChecked()); mConfig->setCaptureCursor(mCaptureCursorCheckbox->isChecked()); mConfig->setShowMainWindowAfterTakingScreenshotEnabled(mShowMainWindowAfterTakingScreenshotCheckbox->isChecked()); mConfig->setForceGenericWaylandEnabled(mForceGenericWaylandCheckbox->isChecked()); mConfig->setScaleGenericWaylandScreenshots(mScaleGenericWaylandScreenshotsCheckbox->isChecked()); } void ImageGrabberSettings::initGui() { mCaptureCursorCheckbox->setText(tr("Capture mouse cursor on screenshot")); mCaptureCursorCheckbox->setToolTip(tr("Should mouse cursor be visible on\n" "screenshots.")); mShowMainWindowAfterTakingScreenshotCheckbox->setText(tr("Show Main Window after capturing screenshot")); mShowMainWindowAfterTakingScreenshotCheckbox->setToolTip(tr("Show Main Window after capturing a new screenshot\n" "when the Main Window was hidden or minimize.")); mForceGenericWaylandCheckbox->setText(tr("Force Generic Wayland (xdg-desktop-portal) Screenshot")); mForceGenericWaylandCheckbox->setToolTip(tr("GNOME and KDE Plasma support their own Wayland\n" "and the Generic XDG-DESKTOP-PORTAL screenshots.\n" "Enabling this option will force KDE Plasma and\n" "GNOME to use the XDG-DESKTOP-PORTAL screenshots.\n" "Change in this option require a ksnip restart.")); mScaleGenericWaylandScreenshotsCheckbox->setText(tr("Scale Generic Wayland (xdg-desktop-portal) Screenshots")); mScaleGenericWaylandScreenshotsCheckbox->setToolTip(tr("Generic Wayland implementations that use\n" "XDG-DESKTOP-PORTAL handle screen scaling\n" "differently. Enabling this option will\n" "determine the current screen scaling and\n" "apply that to the screenshot in ksnip.")); mHideMainWindowDuringScreenshotCheckbox->setText(tr("Hide Main Window during screenshot")); mHideMainWindowDuringScreenshotCheckbox->setToolTip(tr("Hide Main Window when capturing a new screenshot.")); mLayout->setAlignment(Qt::AlignTop); mLayout->setColumnMinimumWidth(0, 10); mLayout->addWidget(mCaptureCursorCheckbox, 0, 0, 1, 3); mLayout->addWidget(mShowMainWindowAfterTakingScreenshotCheckbox, 1, 0, 1, 3); mLayout->addWidget(mHideMainWindowDuringScreenshotCheckbox, 2, 0, 1, 3); mLayout->addWidget(mForceGenericWaylandCheckbox, 3, 0, 1, 3); mLayout->addWidget(mScaleGenericWaylandScreenshotsCheckbox, 4, 0, 1, 3); setTitle(tr("Image Grabber")); setLayout(mLayout); } void ImageGrabberSettings::loadConfig() { mHideMainWindowDuringScreenshotCheckbox->setChecked(mConfig->hideMainWindowDuringScreenshot()); mCaptureCursorCheckbox->setChecked(mConfig->captureCursor()); mShowMainWindowAfterTakingScreenshotCheckbox->setChecked(mConfig->showMainWindowAfterTakingScreenshotEnabled()); mForceGenericWaylandCheckbox->setChecked(mConfig->forceGenericWaylandEnabled()); mForceGenericWaylandCheckbox->setEnabled(!mConfig->isForceGenericWaylandEnabledReadOnly()); mScaleGenericWaylandScreenshotsCheckbox->setChecked(mConfig->scaleGenericWaylandScreenshotsEnabled()); mScaleGenericWaylandScreenshotsCheckbox->setEnabled(!mConfig->isScaleGenericWaylandScreenshotEnabledReadOnly()); } ksnip-1.9.2/src/gui/settingsDialog/ImageGrabberSettings.h000066400000000000000000000027741414701001100234020ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_IMAGEGRABBERSETTINGS_H #define KSNIP_IMAGEGRABBERSETTINGS_H #include #include #include #include "src/backend/config/KsnipConfig.h" class ImageGrabberSettings : public QGroupBox { Q_OBJECT public: explicit ImageGrabberSettings(KsnipConfig *config); ~ImageGrabberSettings() override; void saveSettings(); private: QCheckBox *mCaptureCursorCheckbox; QCheckBox *mHideMainWindowDuringScreenshotCheckbox; QCheckBox *mShowMainWindowAfterTakingScreenshotCheckbox; QCheckBox *mForceGenericWaylandCheckbox; QCheckBox *mScaleGenericWaylandScreenshotsCheckbox; QGridLayout *mLayout; KsnipConfig *mConfig; void initGui(); void loadConfig(); }; #endif //KSNIP_IMAGEGRABBERSETTINGS_H ksnip-1.9.2/src/gui/settingsDialog/ImgurUploaderSettings.cpp000066400000000000000000000215251414701001100242000ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "ImgurUploaderSettings.h" ImgurUploaderSettings::ImgurUploaderSettings(KsnipConfig *ksnipConfig) : mConfig(ksnipConfig), mForceAnonymousCheckbox(new QCheckBox(this)), mDirectLinkToImageCheckbox(new QCheckBox(this)), mAlwaysCopyToClipboardCheckBox(new QCheckBox(this)), mOpenLinkInBrowserCheckbox(new QCheckBox(this)), mClientIdLineEdit(new QLineEdit(this)), mClientSecretLineEdit(new QLineEdit(this)), mPinLineEdit(new QLineEdit(this)), mUsernameLineEdit(new QLineEdit(this)), mBaseUrlLineEdit(new CustomLineEdit(this)), mUsernameLabel(new QLabel(this)), mBaseUrlLabel(new QLabel(this)), mGetPinButton(new QPushButton(this)), mGetTokenButton(new QPushButton(this)), mClearTokenButton(new QPushButton(this)), mHistoryButton(new QPushButton(this)), mImgurWrapper(new ImgurWrapper(mConfig->imgurBaseUrl(), this)), mLayout(new QGridLayout(this)) { Q_ASSERT(mConfig != nullptr); initGui(); loadConfig(); } ImgurUploaderSettings::~ImgurUploaderSettings() { delete mForceAnonymousCheckbox; delete mDirectLinkToImageCheckbox; delete mAlwaysCopyToClipboardCheckBox; delete mOpenLinkInBrowserCheckbox; delete mClientIdLineEdit; delete mClientSecretLineEdit; delete mPinLineEdit; delete mUsernameLineEdit; delete mBaseUrlLineEdit; delete mUsernameLabel; delete mBaseUrlLabel; delete mGetPinButton; delete mGetTokenButton; delete mClearTokenButton; delete mHistoryButton; delete mImgurWrapper; delete mLayout; } void ImgurUploaderSettings::saveSettings() { mConfig->setImgurForceAnonymous(mForceAnonymousCheckbox->isChecked()); mConfig->setImgurLinkDirectlyToImage(mDirectLinkToImageCheckbox->isChecked()); mConfig->setImgurAlwaysCopyToClipboard(mAlwaysCopyToClipboardCheckBox->isChecked()); mConfig->setImgurOpenLinkInBrowser(mOpenLinkInBrowserCheckbox->isChecked()); mConfig->setImgurBaseUrl(mBaseUrlLineEdit->textOrPlaceholderText()); } void ImgurUploaderSettings::initGui() { connect(mImgurWrapper, &ImgurWrapper::tokenUpdated, this, &ImgurUploaderSettings::imgurTokenUpdated); connect(mImgurWrapper, &ImgurWrapper::error, this, &ImgurUploaderSettings::imgurTokenError); mForceAnonymousCheckbox->setText(tr("Force anonymous upload")); mOpenLinkInBrowserCheckbox->setText(tr("After uploading open Imgur link in default browser")); mDirectLinkToImageCheckbox->setText(tr("Link directly to image")); mAlwaysCopyToClipboardCheckBox->setText(tr("Always copy Imgur link to clipboard")); mBaseUrlLabel->setText(tr("Base Url:")); mBaseUrlLabel->setToolTip(tr("Base url that will be used for communication with Imgur.\n" "Changing requires restart.")); mClientIdLineEdit->setPlaceholderText(tr("Client ID")); connect(mClientIdLineEdit, &QLineEdit::textChanged, this, &ImgurUploaderSettings::imgurClientEntered); mClientSecretLineEdit->setPlaceholderText(tr("Client Secret")); connect(mClientSecretLineEdit, &QLineEdit::textChanged, this, &ImgurUploaderSettings::imgurClientEntered); mPinLineEdit->setPlaceholderText(tr("PIN")); mPinLineEdit->setToolTip(tr("Enter imgur Pin which will be exchanged for a token.")); connect(mPinLineEdit, &QLineEdit::textChanged, [this](const QString & text) { mGetTokenButton->setEnabled(text.length() > 8); }); mBaseUrlLineEdit->setPlaceholderText(DefaultValues::ImgurBaseUrl); mBaseUrlLineEdit->setToolTip(mBaseUrlLabel->toolTip()); mUsernameLabel->setText(tr("Username") + QLatin1String(":")); mUsernameLineEdit->setReadOnly(true); connect(mUsernameLineEdit, &QLineEdit::textChanged, this, &ImgurUploaderSettings::usernameChanged); mGetPinButton->setText(tr("Get PIN")); connect(mGetPinButton, &QPushButton::clicked, this, &ImgurUploaderSettings::requestImgurPin); mGetPinButton->setEnabled(false); mGetTokenButton->setText(tr("Get Token")); connect(mGetTokenButton, &QPushButton::clicked, this, &ImgurUploaderSettings::getImgurToken); mGetTokenButton->setEnabled(false); mClearTokenButton->setText(tr("Clear Token")); connect(mClearTokenButton, &QPushButton::clicked, this, &ImgurUploaderSettings::clearImgurToken); mHistoryButton->setText(tr("Imgur History")); connect(mHistoryButton, &QPushButton::clicked, this, &ImgurUploaderSettings::showImgurHistoryDialog); mLayout->setAlignment(Qt::AlignTop); mLayout->setColumnMinimumWidth(0, 10); mLayout->addWidget(mForceAnonymousCheckbox, 0, 0, 1, 3); mLayout->addWidget(mOpenLinkInBrowserCheckbox, 1, 0, 1, 3); mLayout->addWidget(mDirectLinkToImageCheckbox, 2, 0, 1, 3); mLayout->addWidget(mAlwaysCopyToClipboardCheckBox, 3, 0, 1, 3); mLayout->setRowMinimumHeight(4, 15); mLayout->addWidget(mBaseUrlLabel, 5, 0, 1, 1); mLayout->addWidget(mBaseUrlLineEdit, 5, 1, 1, 2); mLayout->setRowMinimumHeight(6, 15); mLayout->addWidget(mUsernameLabel, 7, 0, 1, 1); mLayout->addWidget(mUsernameLineEdit, 7, 1, 1, 2); mLayout->addWidget(mClearTokenButton, 7, 3, 1, 1); mLayout->addWidget(mClientIdLineEdit, 8, 0, 1, 3); mLayout->addWidget(mClientSecretLineEdit, 9, 0, 1, 3); mLayout->addWidget(mGetPinButton, 9, 3, 1, 1); mLayout->addWidget(mPinLineEdit, 10, 0, 1, 3); mLayout->addWidget(mGetTokenButton, 10, 3, 1, 1); mLayout->addWidget(mHistoryButton, 11, 3, 1, 1); setTitle(tr("Imgur Uploader")); setLayout(mLayout); } void ImgurUploaderSettings::loadConfig() { mForceAnonymousCheckbox->setChecked(mConfig->imgurForceAnonymous()); mOpenLinkInBrowserCheckbox->setChecked(mConfig->imgurOpenLinkInBrowser()); mDirectLinkToImageCheckbox->setChecked(mConfig->imgurLinkDirectlyToImage()); mAlwaysCopyToClipboardCheckBox->setChecked(mConfig->imgurAlwaysCopyToClipboard()); mUsernameLineEdit->setText(mConfig->imgurUsername()); mBaseUrlLineEdit->setText(mConfig->imgurBaseUrl()); if(!mConfig->imgurClientId().isEmpty()) { mClientIdLineEdit->setPlaceholderText(mConfig->imgurClientId()); } usernameChanged(); } /* * Based on the entered client id and client secret we create a pin request and open it up in the * default browser. */ void ImgurUploaderSettings::requestImgurPin() { // Save client ID and Secret to config file mConfig->setImgurClientId(mClientIdLineEdit->text().toUtf8()); mConfig->setImgurClientSecret(mClientSecretLineEdit->text().toUtf8()); // Open the pin request in the default browser QDesktopServices::openUrl(mImgurWrapper->pinRequestUrl(mClientIdLineEdit->text())); // Cleanup line edits mClientIdLineEdit->setPlaceholderText(mClientIdLineEdit->text()); mClientIdLineEdit->clear(); mClientSecretLineEdit->clear(); } /* * Request a new token from imgur.com when clicked. */ void ImgurUploaderSettings::getImgurToken() { mImgurWrapper->getAccessToken(mPinLineEdit->text().toUtf8(), mConfig->imgurClientId(), mConfig->imgurClientSecret()); mPinLineEdit->clear(); qInfo("%s", qPrintable(tr("Waiting for imgur.com…"))); } void ImgurUploaderSettings::clearImgurToken() { mConfig->setImgurAccessToken({}); mConfig->setImgurRefreshToken({}); mConfig->setImgurUsername({}); mUsernameLineEdit->setText({}); } void ImgurUploaderSettings::imgurClientEntered(const QString&) { mGetPinButton->setEnabled(!mClientIdLineEdit->text().isEmpty() && !mClientSecretLineEdit->text().isEmpty()); } /* * We have received a new token from imgur.com, now we save it to config for * later use and inform the user about it. */ void ImgurUploaderSettings::imgurTokenUpdated(const QString& accessToken, const QString& refreshToken, const QString& username) { mConfig->setImgurAccessToken(accessToken.toUtf8()); mConfig->setImgurRefreshToken(refreshToken.toUtf8()); mConfig->setImgurUsername(username); mUsernameLineEdit->setText(username); qInfo("%s", qPrintable(tr("Imgur.com token successfully updated."))); } /* * Something went wrong while requesting a new token, we write the message to * shell. */ void ImgurUploaderSettings::imgurTokenError(const QString& message) { qCritical("SettingsDialog returned error: '%s'", qPrintable(message)); qInfo("%s", qPrintable(tr("Imgur.com token update error."))); } void ImgurUploaderSettings::showImgurHistoryDialog() { ImgurHistoryDialog dialog; dialog.exec(); } void ImgurUploaderSettings::usernameChanged() { mClearTokenButton->setEnabled(!mUsernameLineEdit->text().isEmpty()); } ksnip-1.9.2/src/gui/settingsDialog/ImgurUploaderSettings.h000066400000000000000000000046101414701001100236410ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_IMGURUPLOADERSETTINGS_H #define KSNIP_IMGURUPLOADERSETTINGS_H #include #include #include #include #include #include #include #include "src/backend/config/KsnipConfig.h" #include "src/backend/uploader/imgur/ImgurWrapper.h" #include "src/gui/ImgurHistoryDialog.h" #include "src/widgets/CustomLineEdit.h" #include "src/common/constants/DefaultValues.h" class ImgurUploaderSettings : public QGroupBox { Q_OBJECT public: explicit ImgurUploaderSettings(KsnipConfig *ksnipConfig); ~ImgurUploaderSettings() override; void saveSettings(); private: KsnipConfig *mConfig; QCheckBox *mForceAnonymousCheckbox; QCheckBox *mDirectLinkToImageCheckbox; QCheckBox *mAlwaysCopyToClipboardCheckBox; QCheckBox *mOpenLinkInBrowserCheckbox; QLineEdit *mClientIdLineEdit; QLineEdit *mClientSecretLineEdit; QLineEdit *mPinLineEdit; QLineEdit *mUsernameLineEdit; CustomLineEdit *mBaseUrlLineEdit; QLabel *mUsernameLabel; QLabel *mBaseUrlLabel; QPushButton *mGetPinButton; QPushButton *mGetTokenButton; QPushButton *mClearTokenButton; QPushButton *mHistoryButton; ImgurWrapper *mImgurWrapper; QGridLayout *mLayout; void initGui(); void loadConfig(); private slots: void requestImgurPin(); void getImgurToken(); void clearImgurToken(); void imgurClientEntered(const QString &text); void imgurTokenUpdated(const QString &accessToken, const QString &refreshToken, const QString &username); void imgurTokenError(const QString &message); void showImgurHistoryDialog(); void usernameChanged(); }; #endif //KSNIP_IMGURUPLOADERSETTINGS_H ksnip-1.9.2/src/gui/settingsDialog/SaverSettings.cpp000066400000000000000000000146041414701001100225010ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "SaverSettings.h" SaverSettings::SaverSettings(KsnipConfig *ksnipConfig) : mConfig(ksnipConfig), mAutoSaveNewCapturesCheckbox(new QCheckBox(this)), mPromptToSaveBeforeExitCheckbox(new QCheckBox(this)), mRememberSaveDirectoryCheckbox(new QCheckBox(this)), mSaveQualityDefaultRadioButton(new QRadioButton(this)), mSaveQualityFactorRadioButton(new QRadioButton(this)), mSaveLocationLabel(new QLabel(this)), mSaveLocationLineEdit(new QLineEdit(this)), mBrowseButton(new QPushButton(this)), mSaveQualityFactorSpinBox(new CustomSpinBox(0, 100, this)), mLayout(new QGridLayout), mSaveQualityLayout(new QGridLayout), mSaveQualityGroupBox(new QGroupBox(this)), mFileDialog(FileDialogAdapterFactory::create()) { Q_ASSERT(mConfig != nullptr); initGui(); loadConfig(); } SaverSettings::~SaverSettings() { delete mAutoSaveNewCapturesCheckbox; delete mPromptToSaveBeforeExitCheckbox; delete mRememberSaveDirectoryCheckbox; delete mSaveQualityDefaultRadioButton; delete mSaveQualityFactorRadioButton; delete mSaveLocationLabel; delete mSaveLocationLineEdit; delete mBrowseButton; delete mSaveQualityGroupBox; delete mFileDialog; } void SaverSettings::initGui() { mAutoSaveNewCapturesCheckbox->setText(tr("Automatically save new captures to default location")); mPromptToSaveBeforeExitCheckbox->setText(tr("Prompt to save before discarding unsaved changes")); mSaveQualityDefaultRadioButton->setText(tr("Default")); mSaveQualityFactorRadioButton->setText(tr("Factor")); mSaveQualityFactorRadioButton->setToolTip(tr("Specify 0 to obtain small compressed files, 100 for large uncompressed files.\n" "Not all image formats support the full range, JPEG does.")); mSaveQualityFactorSpinBox->setToolTip(mSaveQualityFactorRadioButton->toolTip()); mSaveQualityGroupBox->setTitle(tr("Save Quality")); mRememberSaveDirectoryCheckbox->setText(tr("Remember last Save Directory")); mRememberSaveDirectoryCheckbox->setToolTip(tr("When enabled will overwrite the save directory stored in settings\n" "with the latest save directory, for every save.")); mSaveLocationLabel->setText(tr("Capture save location and filename") + QLatin1String(":")); mSaveLocationLineEdit->setToolTip(tr("Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default.\n" "Filename can contain following wildcards:\n" "- $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format.\n" "- Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002.")); mBrowseButton->setText(tr("Browse")); connect(mBrowseButton, &QPushButton::clicked, this, &SaverSettings::chooseSaveDirectory); mSaveQualityLayout->addWidget(mSaveQualityDefaultRadioButton, 0, 0, 1, 1); mSaveQualityLayout->addWidget(mSaveQualityFactorRadioButton, 1, 0, 1, 1); mSaveQualityLayout->addWidget(mSaveQualityFactorSpinBox, 1, 1, 1, 1); mSaveQualityLayout->setColumnStretch(2, 1); mSaveQualityGroupBox->setLayout(mSaveQualityLayout); mLayout->setAlignment(Qt::AlignTop); mLayout->addWidget(mAutoSaveNewCapturesCheckbox, 0, 0, 1, 4); mLayout->addWidget(mPromptToSaveBeforeExitCheckbox, 1, 0, 1, 4); mLayout->addWidget(mRememberSaveDirectoryCheckbox, 2, 0, 1, 4); mLayout->setRowMinimumHeight(3, 15); mLayout->addWidget(mSaveQualityGroupBox, 4, 0, 1, 4); mLayout->setRowMinimumHeight(5, 15); mLayout->addWidget(mSaveLocationLabel, 6, 0, 1, 4); mLayout->addWidget(mSaveLocationLineEdit, 7, 0, 1, 3); mLayout->addWidget(mBrowseButton, 7, 3); setTitle(tr("Saver Settings")); setLayout(mLayout); } void SaverSettings::loadConfig() { mAutoSaveNewCapturesCheckbox->setChecked(mConfig->autoSaveNewCaptures()); mPromptToSaveBeforeExitCheckbox->setChecked(mConfig->promptSaveBeforeExit()); mRememberSaveDirectoryCheckbox->setChecked(mConfig->rememberLastSaveDirectory()); mSaveQualityFactorSpinBox->setValue(mConfig->saveQualityFactor()); mSaveQualityDefaultRadioButton->setChecked(mConfig->saveQualityMode() == SaveQualityMode::Default); mSaveQualityFactorRadioButton->setChecked(mConfig->saveQualityMode() == SaveQualityMode::Factor); mSaveLocationLineEdit->setText(mConfig->saveDirectory() + mConfig->saveFilename() + QLatin1String(".") + mConfig->saveFormat()); } void SaverSettings::saveSettings() { mConfig->setAutoSaveNewCaptures(mAutoSaveNewCapturesCheckbox->isChecked()); mConfig->setPromptSaveBeforeExit(mPromptToSaveBeforeExitCheckbox->isChecked()); mConfig->setRememberLastSaveDirectory(mRememberSaveDirectoryCheckbox->isChecked()); mConfig->setSaveQualityMode(getSaveQualityMode()); mConfig->setSaveQualityFactor(mSaveQualityFactorSpinBox->value()); mConfig->setSaveDirectory(PathHelper::extractParentDirectory(mSaveLocationLineEdit->displayText())); mConfig->setSaveFilename(PathHelper::extractFilename(mSaveLocationLineEdit->displayText())); mConfig->setSaveFormat(PathHelper::extractFormat(mSaveLocationLineEdit->displayText())); } void SaverSettings::chooseSaveDirectory() { auto path = mFileDialog->getExistingDirectory(this, tr("Capture save location"), mConfig->saveDirectory()); if(!path.isEmpty()) { auto filename = PathHelper::extractFilename(mSaveLocationLineEdit->text()); auto format = PathHelper::extractFormat(mSaveLocationLineEdit->text()); if(!filename.isEmpty()) { path.append(QLatin1Char('/')).append(filename); } if(!format.isEmpty()) { path.append(QLatin1Char('.')).append(format); } mSaveLocationLineEdit->setText(path); } } SaveQualityMode SaverSettings::getSaveQualityMode() { return mSaveQualityDefaultRadioButton->isChecked() ? SaveQualityMode::Default : SaveQualityMode::Factor; } ksnip-1.9.2/src/gui/settingsDialog/SaverSettings.h000066400000000000000000000037561414701001100221540ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_SAVERSETTINGS_H #define KSNIP_SAVERSETTINGS_H #include #include #include #include #include #include #include #include #include "src/backend/config/KsnipConfig.h" #include "src/common/adapter/fileDialog/FileDialogAdapterFactory.h" #include "src/widgets/CustomSpinBox.h" class SaverSettings : public QGroupBox { Q_OBJECT public: explicit SaverSettings(KsnipConfig *ksnipConfig); ~SaverSettings() override; void saveSettings(); private: QCheckBox *mAutoSaveNewCapturesCheckbox; QCheckBox *mPromptToSaveBeforeExitCheckbox; QCheckBox *mRememberSaveDirectoryCheckbox; QRadioButton *mSaveQualityDefaultRadioButton; QRadioButton *mSaveQualityFactorRadioButton; QLabel *mSaveLocationLabel; QLineEdit *mSaveLocationLineEdit; QPushButton *mBrowseButton; CustomSpinBox *mSaveQualityFactorSpinBox; QGridLayout *mLayout; QGridLayout *mSaveQualityLayout; QGroupBox *mSaveQualityGroupBox; KsnipConfig *mConfig; IFileDialogAdapter *mFileDialog; void initGui(); void loadConfig(); private slots: void chooseSaveDirectory(); SaveQualityMode getSaveQualityMode(); }; #endif //KSNIP_SAVERSETTINGS_H ksnip-1.9.2/src/gui/settingsDialog/ScriptUploaderSettings.cpp000066400000000000000000000110761414701001100243610ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "ScriptUploaderSettings.h" ScriptUploaderSettings::ScriptUploaderSettings(KsnipConfig *ksnipConfig) : mConfig(ksnipConfig), mLayout(new QGridLayout(this)), mCopyOutputToClipboardCheckbox(new QCheckBox(this)), mStopOnStdErrCheckbox(new QCheckBox(this)), mCopyOutputFilterLabel(new QLabel(this)), mScriptPathLabel(new QLabel(this)), mCopyOutputFilterLineEdit(new QLineEdit(this)), mUploadScriptPathLineEdit(new QLineEdit(this)), mBrowseButton(new QPushButton(this)), mFileDialog(FileDialogAdapterFactory::create()) { initGui(); loadConfig(); } ScriptUploaderSettings::~ScriptUploaderSettings() { delete mLayout; delete mCopyOutputToClipboardCheckbox; delete mStopOnStdErrCheckbox; delete mCopyOutputFilterLabel; delete mScriptPathLabel; delete mCopyOutputFilterLineEdit; delete mUploadScriptPathLineEdit; delete mBrowseButton; } void ScriptUploaderSettings::saveSettings() { mConfig->setUploadScriptStopOnStdErr(mStopOnStdErrCheckbox->isChecked()); mConfig->setUploadScriptCopyOutputToClipboard(mCopyOutputToClipboardCheckbox->isChecked()); mConfig->setUploadScriptCopyOutputFilter(mCopyOutputFilterLineEdit->text()); mConfig->setUploadScriptPath(mUploadScriptPathLineEdit->text()); } void ScriptUploaderSettings::initGui() { mStopOnStdErrCheckbox->setText(tr("Stop when upload script writes to StdErr")); mStopOnStdErrCheckbox->setToolTip(tr("Marks the upload as failed when script writes to StdErr.\n" "Without this setting errors in the script will be unnoticed.")); mCopyOutputToClipboardCheckbox->setText(tr("Copy script output to clipboard")); connect(mCopyOutputToClipboardCheckbox, &QCheckBox::stateChanged, this, &ScriptUploaderSettings::copyToClipboardChanged); mCopyOutputFilterLabel->setText(tr("Filter:")); mCopyOutputFilterLabel->setToolTip(tr("RegEx Expression. Only copy to clipboard what matches the RegEx Expression.\n" "When omitted, everything is copied.")); mCopyOutputFilterLineEdit->setToolTip(mCopyOutputFilterLabel->toolTip()); mScriptPathLabel->setText(tr("Script:")); mScriptPathLabel->setToolTip(tr("Path to script that will be called for uploading. During upload the script will be called\n" "with the path to a temporary png file as a single argument.")); mUploadScriptPathLineEdit->setToolTip(mScriptPathLabel->toolTip()); mBrowseButton->setText(tr("Browse")); connect(mBrowseButton, &QPushButton::clicked, this, &ScriptUploaderSettings::ShowScriptSelectionDialog); mLayout->setAlignment(Qt::AlignTop); mLayout->setColumnMinimumWidth(0, 10); mLayout->addWidget(mStopOnStdErrCheckbox, 0, 0, 1, 3); mLayout->addWidget(mCopyOutputToClipboardCheckbox, 1, 0, 1, 3); mLayout->addWidget(mCopyOutputFilterLabel, 2, 1, 1, 1); mLayout->addWidget(mCopyOutputFilterLineEdit, 2, 2, 1, 1); mLayout->addWidget(mScriptPathLabel, 3, 0, 1, 1); mLayout->addWidget(mUploadScriptPathLineEdit, 3, 1, 1, 2); mLayout->addWidget(mBrowseButton, 3, 3, 1, 1); setTitle(tr("Script Uploader")); setLayout(mLayout); } void ScriptUploaderSettings::loadConfig() { mStopOnStdErrCheckbox->setChecked(mConfig->uploadScriptStopOnStdErr()); mCopyOutputToClipboardCheckbox->setChecked(mConfig->uploadScriptCopyOutputToClipboard()); mCopyOutputFilterLineEdit->setText(mConfig->uploadScriptCopyOutputFilter()); mUploadScriptPathLineEdit->setText(mConfig->uploadScriptPath()); copyToClipboardChanged(); } void ScriptUploaderSettings::ShowScriptSelectionDialog() { auto path = mFileDialog->getOpenFileName(this, tr("Select Upload Script"), mConfig->uploadScriptPath()); if(PathHelper::isPathValid(path)) { mUploadScriptPathLineEdit->setText(path); } } void ScriptUploaderSettings::copyToClipboardChanged() { auto enabled = mCopyOutputToClipboardCheckbox->isChecked(); mCopyOutputFilterLabel->setEnabled(enabled); mCopyOutputFilterLineEdit->setEnabled(enabled); } ksnip-1.9.2/src/gui/settingsDialog/ScriptUploaderSettings.h000066400000000000000000000034371414701001100240300ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_SCRIPTUPLOADERSETTINGS_H #define KSNIP_SCRIPTUPLOADERSETTINGS_H #include #include #include #include #include #include #include #include "src/backend/config/KsnipConfig.h" #include "src/common/adapter/fileDialog/FileDialogAdapterFactory.h" class ScriptUploaderSettings : public QGroupBox { Q_OBJECT public: explicit ScriptUploaderSettings(KsnipConfig *ksnipConfig); ~ScriptUploaderSettings() override; void saveSettings(); private: QGridLayout *mLayout; KsnipConfig *mConfig; QCheckBox *mCopyOutputToClipboardCheckbox; QCheckBox *mStopOnStdErrCheckbox; QLineEdit *mCopyOutputFilterLineEdit; QLineEdit *mUploadScriptPathLineEdit; QLabel *mCopyOutputFilterLabel; QLabel *mScriptPathLabel; QPushButton *mBrowseButton; IFileDialogAdapter *mFileDialog; void initGui(); void loadConfig(); private slots: void ShowScriptSelectionDialog(); void copyToClipboardChanged(); }; #endif //KSNIP_SCRIPTUPLOADERSETTINGS_H ksnip-1.9.2/src/gui/settingsDialog/SettingsDialog.cpp000066400000000000000000000152051414701001100226160ustar00rootroot00000000000000/* * Copyright (C) 2016 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #include "SettingsDialog.h" SettingsDialog::SettingsDialog(QWidget *parent, const QList &captureModes) : QDialog(parent, Qt::WindowTitleHint | Qt::WindowCloseButtonHint), mOkButton(new QPushButton), mCancelButton(new QPushButton), mTreeWidget(new QTreeWidget), mStackedLayout(new QStackedLayout), mConfig(KsnipConfigProvider::instance()), mApplicationSettings(new ApplicationSettings(mConfig)), mImageGrabberSettings(new ImageGrabberSettings(mConfig)), mImgurUploaderSettings(new ImgurUploaderSettings(mConfig)), mScriptUploaderSettings(new ScriptUploaderSettings(mConfig)), mAnnotationSettings(new AnnotationSettings(mConfig)), mHotKeySettings(new HotKeySettings(mConfig, captureModes)), mUploaderSettings(new UploaderSettings(mConfig)), mSaverSettings(new SaverSettings(mConfig)), mStickerSettings(new StickerSettings(mConfig)), mTrayIconSettings(new TrayIconSettings(mConfig, captureModes)), mSnippingAreaSettings(new SnippingAreaSettings(mConfig)), mWatermarkSettings(new WatermarkSettings(mConfig)), mActionsSettings(new ActionsSettings(mConfig, captureModes)) { setWindowTitle(QApplication::applicationName() + QLatin1String(" - ") + tr("Settings")); initGui(); connect(mTreeWidget, &QTreeWidget::itemSelectionChanged, this, &SettingsDialog::switchTab); } SettingsDialog::~SettingsDialog() { delete mOkButton; delete mCancelButton; delete mTreeWidget; delete mStackedLayout; delete mApplicationSettings; delete mImageGrabberSettings; delete mImgurUploaderSettings; delete mAnnotationSettings; delete mHotKeySettings; delete mUploaderSettings; delete mSaverSettings; delete mStickerSettings; delete mTrayIconSettings; delete mSnippingAreaSettings; delete mWatermarkSettings; delete mActionsSettings; } void SettingsDialog::saveSettings() { mApplicationSettings->saveSettings(); mImageGrabberSettings->saveSettings(); mUploaderSettings->saveSettings(); mImgurUploaderSettings->saveSettings(); mScriptUploaderSettings->saveSettings(); mAnnotationSettings->saveSettings(); mHotKeySettings->saveSettings(); mSaverSettings->saveSettings(); mStickerSettings->saveSettings(); mTrayIconSettings->saveSettings(); mSnippingAreaSettings->saveSettings(); mWatermarkSettings->saveSettings(); mActionsSettings->saveSettings(); } void SettingsDialog::initGui() { mOkButton->setText(tr("OK")); connect(mOkButton, &QPushButton::clicked, this, &SettingsDialog::okClicked); mCancelButton->setText(tr("Cancel")); connect(mCancelButton, &QPushButton::clicked, this, &SettingsDialog::cancelClicked); auto buttonLayout = new QHBoxLayout; buttonLayout->addWidget(mOkButton); buttonLayout->addWidget(mCancelButton); buttonLayout->setAlignment(Qt::AlignRight); mStackedLayout->addWidget(mApplicationSettings); mStackedLayout->addWidget(mSaverSettings); mStackedLayout->addWidget(mTrayIconSettings); mStackedLayout->addWidget(mImageGrabberSettings); mStackedLayout->addWidget(mSnippingAreaSettings); mStackedLayout->addWidget(mUploaderSettings); mStackedLayout->addWidget(mImgurUploaderSettings); mStackedLayout->addWidget(mScriptUploaderSettings); mStackedLayout->addWidget(mAnnotationSettings); mStackedLayout->addWidget(mStickerSettings); mStackedLayout->addWidget(mWatermarkSettings); mStackedLayout->addWidget(mHotKeySettings); mStackedLayout->addWidget(mActionsSettings); auto application = new QTreeWidgetItem(mTreeWidget, { tr("Application") }); auto saver = new QTreeWidgetItem(application, { tr("Saver") }); auto trayIcon = new QTreeWidgetItem(application, { tr("Tray Icon") }); auto imageGrabber = new QTreeWidgetItem(mTreeWidget, { tr("Image Grabber") }); auto snippingArea = new QTreeWidgetItem(imageGrabber, { tr("Snipping Area") }); auto uploader = new QTreeWidgetItem(mTreeWidget, { tr("Uploader") }); auto imgurUploader = new QTreeWidgetItem(uploader, { tr("Imgur Uploader") }); auto scriptUploader = new QTreeWidgetItem(uploader, { tr("Script Uploader") }); auto annotator = new QTreeWidgetItem(mTreeWidget, { tr("Annotator") }); auto stickers = new QTreeWidgetItem(annotator, { tr("Stickers") }); auto watermark = new QTreeWidgetItem(annotator, { tr("Watermark") }); auto hotkeys = new QTreeWidgetItem(mTreeWidget, { tr("HotKeys") }); auto actions = new QTreeWidgetItem(mTreeWidget, { tr("Actions") }); mNavigatorItems.append(application); mNavigatorItems.append(saver); mNavigatorItems.append(trayIcon); mNavigatorItems.append(imageGrabber); mNavigatorItems.append(snippingArea); mNavigatorItems.append(uploader); mNavigatorItems.append(imgurUploader); mNavigatorItems.append(scriptUploader); mNavigatorItems.append(annotator); mNavigatorItems.append(stickers); mNavigatorItems.append(watermark); mNavigatorItems.append(hotkeys); mNavigatorItems.append(actions); mTreeWidget->addTopLevelItem(application); mTreeWidget->addTopLevelItem(imageGrabber); mTreeWidget->addTopLevelItem(uploader); mTreeWidget->addTopLevelItem(annotator); mTreeWidget->addTopLevelItem(hotkeys); mTreeWidget->addTopLevelItem(actions); mTreeWidget->setHeaderHidden(true); mTreeWidget->setItemSelected(mNavigatorItems[0], true); mTreeWidget->setFixedWidth(mTreeWidget->minimumSizeHint().width() + ScaledSizeProvider::scaledWidth(100)); mTreeWidget->expandAll(); auto listAndStackLayout = new QHBoxLayout; listAndStackLayout->addWidget(mTreeWidget); listAndStackLayout->addLayout(mStackedLayout); auto mainLayout = new QVBoxLayout(); mainLayout->addLayout(listAndStackLayout); mainLayout->addLayout(buttonLayout); setLayout(mainLayout); } void SettingsDialog::switchTab() { mStackedLayout->setCurrentIndex(mNavigatorItems.indexOf(mTreeWidget->currentItem())); } void SettingsDialog::okClicked() { saveSettings(); close(); } void SettingsDialog::cancelClicked() { close(); } ksnip-1.9.2/src/gui/settingsDialog/SettingsDialog.h000066400000000000000000000050221414701001100222570ustar00rootroot00000000000000/* * Copyright (C) 2016 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef KSNIP_SETTINGSDIALOG_H #define KSNIP_SETTINGSDIALOG_H #include #include #include #include #include "AnnotationSettings.h" #include "ApplicationSettings.h" #include "ImageGrabberSettings.h" #include "ImgurUploaderSettings.h" #include "ScriptUploaderSettings.h" #include "HotKeySettings.h" #include "UploaderSettings.h" #include "SaverSettings.h" #include "StickerSettings.h" #include "TrayIconSettings.h" #include "SnippingAreaSettings.h" #include "WatermarkSettings.h" #include "actions/ActionsSettings.h" #include "src/backend/config/KsnipConfigProvider.h" #include "src/common/provider/ScaledSizeProvider.h" class SettingsDialog : public QDialog { Q_OBJECT public: explicit SettingsDialog(QWidget *parent, const QList &captureModes); ~SettingsDialog() override; private: KsnipConfig *mConfig; QPushButton *mOkButton; QPushButton *mCancelButton; ApplicationSettings *mApplicationSettings; ImageGrabberSettings *mImageGrabberSettings; ImgurUploaderSettings *mImgurUploaderSettings; ScriptUploaderSettings *mScriptUploaderSettings; HotKeySettings *mHotKeySettings; AnnotationSettings *mAnnotationSettings; UploaderSettings *mUploaderSettings; SaverSettings *mSaverSettings; StickerSettings *mStickerSettings; TrayIconSettings *mTrayIconSettings; SnippingAreaSettings *mSnippingAreaSettings; WatermarkSettings *mWatermarkSettings; ActionsSettings *mActionsSettings; QTreeWidget *mTreeWidget; QStackedLayout *mStackedLayout; QList mNavigatorItems; void saveSettings(); void initGui(); private slots: void switchTab(); void cancelClicked(); void okClicked(); }; #endif // KSNIP_SETTINGSDIALOG_H ksnip-1.9.2/src/gui/settingsDialog/SnippingAreaSettings.cpp000066400000000000000000000224321414701001100237770ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "SnippingAreaSettings.h" SnippingAreaSettings::SnippingAreaSettings(KsnipConfig *config) : mConfig(config), mFreezeImageWhileSnippingCheckbox(new QCheckBox(this)), mSnippingAreaRulersCheckbox(new QCheckBox(this)), mSnippingAreaPositionAndSizeInfoCheckbox(new QCheckBox(this)), mSnippingAreaMagnifyingGlassCheckbox(new QCheckBox(this)), mAllowResizingRectSelectionCheckbox(new QCheckBox(this)), mShowSnippingAreaInfoTextCheckbox(new QCheckBox(this)), mSnippingCursorSizeLabel(new QLabel(this)), mSnippingCursorColorLabel(new QLabel(this)), mSnippingAdornerColorLabel(new QLabel(this)), mSnippingAreaTransparencyLabel(new QLabel(this)), mSnippingCursorSizeCombobox(new NumericComboBox(1, 2, 3)), mSnippingCursorColorButton(new ColorButton(this)), mSnippingAdornerColorButton(new ColorButton(this)), mSnippingAreaTransparencySpinBox(new QSpinBox(this)), mLayout(new QGridLayout(this)) { Q_ASSERT(mConfig != nullptr); initGui(); loadConfig(); } SnippingAreaSettings::~SnippingAreaSettings() { delete mFreezeImageWhileSnippingCheckbox; delete mSnippingAreaPositionAndSizeInfoCheckbox; delete mSnippingAreaRulersCheckbox; delete mSnippingAreaMagnifyingGlassCheckbox; delete mAllowResizingRectSelectionCheckbox; delete mShowSnippingAreaInfoTextCheckbox; delete mSnippingCursorSizeLabel; delete mSnippingCursorColorLabel; delete mSnippingAdornerColorLabel; delete mSnippingAreaTransparencyLabel; delete mSnippingCursorColorButton; delete mSnippingAdornerColorButton; delete mSnippingCursorSizeCombobox; delete mSnippingAreaTransparencySpinBox; } void SnippingAreaSettings::saveSettings() { mConfig->setFreezeImageWhileSnippingEnabled(mFreezeImageWhileSnippingCheckbox->isChecked()); mConfig->setSnippingAreaMagnifyingGlassEnabled(mSnippingAreaMagnifyingGlassCheckbox->isChecked()); mConfig->setSnippingAreaRulersEnabled(mSnippingAreaRulersCheckbox->isChecked()); mConfig->setSnippingAreaPositionAndSizeInfoEnabled(mSnippingAreaPositionAndSizeInfoCheckbox->isChecked()); mConfig->setAllowResizingRectSelection(mAllowResizingRectSelectionCheckbox->isChecked()); mConfig->setShowSnippingAreaInfoText(mShowSnippingAreaInfoTextCheckbox->isChecked()); mConfig->setSnippingCursorColor(mSnippingCursorColorButton->color()); mConfig->setSnippingAdornerColor(mSnippingAdornerColorButton->color()); mConfig->setSnippingCursorSize(mSnippingCursorSizeCombobox->value()); mConfig->setSnippingAreaTransparency(mSnippingAreaTransparencySpinBox->value()); } void SnippingAreaSettings::initGui() { auto const fixedButtonWidth = ScaledSizeProvider::scaledWidth(70); mFreezeImageWhileSnippingCheckbox->setText(tr("Freeze Image while snipping")); mFreezeImageWhileSnippingCheckbox->setToolTip(tr("When enabled will freeze the background while\n" "selecting a rectangular region. It also changes\n" "the behavior of delayed screenshots, with this\n" "option enabled the delay happens before the\n" "snipping area is shown and with the option disabled\n" "the delay happens after the snipping area is shown.\n" "This feature is always disabled for Wayland and always\n" "enabled for MacOs.")); connect(mFreezeImageWhileSnippingCheckbox, &QCheckBox::stateChanged, this, &SnippingAreaSettings::freezeImageWhileSnippingStateChanged); mSnippingAreaMagnifyingGlassCheckbox->setText(tr("Show magnifying glass on snipping area")); mSnippingAreaMagnifyingGlassCheckbox->setToolTip(tr("Show a magnifying glass which zooms into\n" "the background image. This option only works\n" "with 'Freeze Image while snipping' enabled.")); mSnippingAreaRulersCheckbox->setText(tr("Show Snipping Area rulers")); mSnippingAreaRulersCheckbox->setToolTip(tr("Horizontal and vertical lines going from\n" "desktop edges to cursor on snipping area.")); mSnippingAreaPositionAndSizeInfoCheckbox->setText(tr("Show Snipping Area position and size info")); mSnippingAreaPositionAndSizeInfoCheckbox->setToolTip(tr("When left mouse button is not pressed the position\n" "is shown, when the mouse button is pressed,\n" "the size of the select area is shown left\n" "and above from the captured area.")); mAllowResizingRectSelectionCheckbox->setText(tr("Allow resizing rect area selection by default")); mAllowResizingRectSelectionCheckbox->setToolTip(tr("When enabled will, after selecting a rect\n" "area, allow resizing the selection. When\n" "done resizing the selection can be confirmed\n" "by pressing return.")); mShowSnippingAreaInfoTextCheckbox->setText(tr("Show Snipping Area info text")); mSnippingCursorColorLabel->setText(tr("Snipping Area cursor color") + QLatin1String(":")); mSnippingCursorColorLabel->setToolTip(tr("Sets the color of the snipping area cursor.")); mSnippingCursorColorButton->setMinimumWidth(fixedButtonWidth); mSnippingCursorColorButton->setToolTip(mSnippingCursorColorLabel->toolTip()); mSnippingAdornerColorLabel->setText(tr("Snipping Area adorner color") + QLatin1String(":")); mSnippingAdornerColorLabel->setToolTip(tr("Sets the color of all adorner elements\n" "on the snipping area.")); mSnippingAdornerColorButton->setMinimumWidth(fixedButtonWidth); mSnippingAdornerColorButton->setToolTip(mSnippingAdornerColorLabel->toolTip()); mSnippingCursorSizeLabel->setText(tr("Snipping Area cursor thickness") + QLatin1String(":")); mSnippingCursorSizeLabel->setToolTip(tr("Sets the thickness of the snipping area cursor.")); mSnippingCursorSizeCombobox->setMinimumWidth(fixedButtonWidth); mSnippingCursorSizeCombobox->setToolTip(mSnippingCursorSizeLabel->toolTip()); mSnippingAreaTransparencyLabel->setText(tr("Snipping Area Transparency")); mSnippingAreaTransparencyLabel->setToolTip(tr("Alpha for not selected region on snipping area.\n" "Smaller number is more transparent.")); mSnippingAreaTransparencySpinBox->setMinimum(0); mSnippingAreaTransparencySpinBox->setMaximum(200); mSnippingAreaTransparencySpinBox->setToolTip(mSnippingAreaTransparencyLabel->toolTip()); mSnippingAreaTransparencySpinBox->setMinimumWidth(fixedButtonWidth); mLayout->setAlignment(Qt::AlignTop); mLayout->setColumnMinimumWidth(0, 10); mLayout->addWidget(mFreezeImageWhileSnippingCheckbox, 0, 0, 1, 3); mLayout->addWidget(mSnippingAreaMagnifyingGlassCheckbox, 1, 1, 1, 3); mLayout->addWidget(mSnippingAreaRulersCheckbox, 2, 0, 1, 3); mLayout->addWidget(mSnippingAreaPositionAndSizeInfoCheckbox, 3, 0, 1, 3); mLayout->addWidget(mAllowResizingRectSelectionCheckbox, 4, 0, 1, 3); mLayout->addWidget(mShowSnippingAreaInfoTextCheckbox, 5, 0, 1, 3); mLayout->setRowMinimumHeight(6, 15); mLayout->addWidget(mSnippingAdornerColorLabel, 7, 0, 1, 2); mLayout->addWidget(mSnippingAdornerColorButton, 7, 2, Qt::AlignLeft); mLayout->addWidget(mSnippingCursorColorLabel, 8, 0, 1, 2); mLayout->addWidget(mSnippingCursorColorButton, 8, 2, Qt::AlignLeft); mLayout->addWidget(mSnippingCursorSizeLabel, 9, 0, 1, 2); mLayout->addWidget(mSnippingCursorSizeCombobox, 9, 2, Qt::AlignLeft); mLayout->addWidget(mSnippingAreaTransparencyLabel, 10, 0, 1, 2); mLayout->addWidget(mSnippingAreaTransparencySpinBox, 10, 2, Qt::AlignLeft); setTitle(tr("Snipping Area")); setLayout(mLayout); } void SnippingAreaSettings::freezeImageWhileSnippingStateChanged() { mSnippingAreaMagnifyingGlassCheckbox->setEnabled(mFreezeImageWhileSnippingCheckbox->isChecked()); } void SnippingAreaSettings::loadConfig() { mFreezeImageWhileSnippingCheckbox->setChecked(mConfig->freezeImageWhileSnippingEnabled()); mFreezeImageWhileSnippingCheckbox->setEnabled(!mConfig->isFreezeImageWhileSnippingEnabledReadOnly()); mSnippingAreaMagnifyingGlassCheckbox->setChecked(mConfig->snippingAreaMagnifyingGlassEnabled()); mSnippingAreaMagnifyingGlassCheckbox->setEnabled(!mConfig->isSnippingAreaMagnifyingGlassEnabledReadOnly()); mSnippingAreaRulersCheckbox->setChecked(mConfig->snippingAreaRulersEnabled()); mSnippingAreaPositionAndSizeInfoCheckbox->setChecked(mConfig->snippingAreaPositionAndSizeInfoEnabled()); mAllowResizingRectSelectionCheckbox->setChecked(mConfig->allowResizingRectSelection()); mShowSnippingAreaInfoTextCheckbox->setChecked(mConfig->showSnippingAreaInfoText()); mSnippingCursorColorButton->setColor(mConfig->snippingCursorColor()); mSnippingAdornerColorButton->setColor(mConfig->snippingAdornerColor()); mSnippingCursorSizeCombobox->setValue(mConfig->snippingCursorSize()); mSnippingAreaTransparencySpinBox->setValue(mConfig->snippingAreaTransparency()); freezeImageWhileSnippingStateChanged(); } ksnip-1.9.2/src/gui/settingsDialog/SnippingAreaSettings.h000066400000000000000000000041251414701001100234430ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_SNIPPINGAREASETTINGS_H #define KSNIP_SNIPPINGAREASETTINGS_H #include #include #include #include #include #include "src/backend/config/KsnipConfig.h" #include "src/widgets/ColorButton.h" #include "src/widgets/NumericComboBox.h" #include "src/common/provider/ScaledSizeProvider.h" class SnippingAreaSettings : public QGroupBox { Q_OBJECT public: explicit SnippingAreaSettings(KsnipConfig *config); ~SnippingAreaSettings() override; void saveSettings(); private: QCheckBox *mFreezeImageWhileSnippingCheckbox; QCheckBox *mSnippingAreaRulersCheckbox; QCheckBox *mSnippingAreaPositionAndSizeInfoCheckbox; QCheckBox *mSnippingAreaMagnifyingGlassCheckbox; QCheckBox *mAllowResizingRectSelectionCheckbox; QCheckBox *mShowSnippingAreaInfoTextCheckbox; QLabel *mSnippingCursorSizeLabel; QLabel *mSnippingCursorColorLabel; QLabel *mSnippingAdornerColorLabel; QLabel *mSnippingAreaTransparencyLabel; ColorButton *mSnippingCursorColorButton; ColorButton *mSnippingAdornerColorButton; NumericComboBox *mSnippingCursorSizeCombobox; QSpinBox *mSnippingAreaTransparencySpinBox; QGridLayout *mLayout; KsnipConfig *mConfig; void initGui(); void loadConfig(); private slots: void freezeImageWhileSnippingStateChanged(); }; #endif //KSNIP_SNIPPINGAREASETTINGS_H ksnip-1.9.2/src/gui/settingsDialog/StickerSettings.cpp000066400000000000000000000126251414701001100230260ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "StickerSettings.h" StickerSettings::StickerSettings(KsnipConfig *config) : mConfig(config), mListWidget(new QListWidget(this)), mAddButton(new QPushButton(this)), mRemoveButton(new QPushButton(this)), mUpButton(new QPushButton(this)), mDownButton(new QPushButton(this)), mUseDefaultStickerCheckBox(new QCheckBox(this)), mLayout(new QGridLayout), mPathDataKey(1001), mIsSavedDataKey(1002), mIsRemovedDataKey(1003) { initGui(); loadConfig(); } StickerSettings::~StickerSettings() { delete mListWidget; delete mAddButton; delete mRemoveButton; delete mUpButton; delete mDownButton; delete mUseDefaultStickerCheckBox; delete mLayout; } void StickerSettings::saveSettings() { auto selectedSticker = processSticker(); mConfig->setUseDefaultSticker(mUseDefaultStickerCheckBox->isChecked()); mConfig->setStickerPaths(selectedSticker); } QStringList StickerSettings::processSticker() const { QStringList paths; for (int i = 0; i < mListWidget->count(); i++) { auto path = mListWidget->item(i)->data(mPathDataKey).toString(); auto isSaved = mListWidget->item(i)->data(mIsSavedDataKey).toBool(); auto isRemovedSaved = mListWidget->item(i)->data(mIsRemovedDataKey).toBool(); if(isSaved && isRemovedSaved) { QFile::remove(path); } else if (isSaved) { paths.append(path); } else { auto directory = stickerDirectory(); auto filename = PathHelper::extractFilenameWithFormat(path); auto newPath = directory + QLatin1String("/") + filename; QFile::copy(path, newPath); paths.append(newPath); } } return paths; } QString StickerSettings::stickerDirectory() const { auto directory = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation); QDir qdir; qdir.mkpath(directory); return directory; } void StickerSettings::initGui() { connect(mListWidget, &QListWidget::currentRowChanged, this, &StickerSettings::currentRowChanged); mAddButton->setText(tr("Add")); connect(mAddButton, &QPushButton::clicked, this, &StickerSettings::addTriggered); mRemoveButton->setText(tr("Remove")); connect(mRemoveButton, &QPushButton::clicked, this, &StickerSettings::removeTriggered); mUpButton->setText(tr("Up")); connect(mUpButton, &QPushButton::clicked, this, &StickerSettings::upTriggered); mDownButton->setText(tr("Down")); connect(mDownButton, &QPushButton::clicked, this, &StickerSettings::downTriggered); mUseDefaultStickerCheckBox->setText(tr("Use Default Stickers")); mLayout->setAlignment(Qt::AlignTop); mLayout->addWidget(mListWidget, 0, 0, 5,1); mLayout->addWidget(mAddButton, 0, 1, 1,1), mLayout->addWidget(mRemoveButton, 1, 1, 1,1), mLayout->addWidget(mUpButton, 2, 1, 1,1), mLayout->addWidget(mDownButton, 3, 1, 1,1), mLayout->addWidget(mUseDefaultStickerCheckBox, 6, 0, 1,1), mLayout->setRowStretch(0,1); setTitle(tr("Sticker Settings")); setLayout(mLayout); } void StickerSettings::loadConfig() { auto list = mConfig->stickerPaths(); for(const auto& path : list) { addSticker(path, true); } currentRowChanged(mListWidget->currentRow()); mUseDefaultStickerCheckBox->setChecked(mConfig->useDefaultSticker()); } void StickerSettings::addTriggered() { auto title = tr("Add Stickers"); auto filter = tr("Vector Image Files (*.svg)"); auto paths = QFileDialog::getOpenFileNames(this, title, DirectoryPathProvider::home(), filter); for(const auto& path : paths) { addSticker(path, false); } } void StickerSettings::addSticker(const QString &path, bool isSaved) const { auto filename = PathHelper::extractFilename(path); auto item = new QListWidgetItem(QIcon(path), filename); item->setData(mPathDataKey, path); item->setData(mIsSavedDataKey, isSaved); item->setData(mIsRemovedDataKey, false); mListWidget->addItem(item); } void StickerSettings::removeTriggered() { auto selectedItem = mListWidget->currentItem(); if(selectedItem != nullptr) { selectedItem->setData(mIsRemovedDataKey, true); selectedItem->setHidden(true); } } void StickerSettings::upTriggered() { auto row = mListWidget->currentRow(); if(row > 0) { auto item = mListWidget->takeItem(row); auto newRow = row - 1; mListWidget->insertItem(newRow, item); mListWidget->setCurrentRow(newRow); mListWidget->setFocus(); } } void StickerSettings::downTriggered() { auto row = mListWidget->currentRow(); if(row < mListWidget->count() - 1) { auto item = mListWidget->takeItem(row); auto newRow = row + 1; mListWidget->insertItem(newRow, item); mListWidget->setCurrentRow(newRow); mListWidget->setFocus(); } } void StickerSettings::currentRowChanged(int row) { mRemoveButton->setEnabled(row != -1); mUpButton->setEnabled(row > 0); mDownButton->setEnabled(row >= 0 && row < mListWidget->count() - 1); } ksnip-1.9.2/src/gui/settingsDialog/StickerSettings.h000066400000000000000000000037331414701001100224730ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_STICKERSETTINGS_H #define KSNIP_STICKERSETTINGS_H #include #include #include #include #include #include #include #include #include #include "src/backend/config/KsnipConfig.h" #include "src/common/helper/PathHelper.h" #include "src/common/provider/DirectoryPathProvider.h" class StickerSettings : public QGroupBox { Q_OBJECT public: explicit StickerSettings(KsnipConfig *config); ~StickerSettings() override; void saveSettings(); private: QListWidget *mListWidget; QPushButton *mAddButton; QPushButton *mRemoveButton; QPushButton *mUpButton; QPushButton *mDownButton; QCheckBox *mUseDefaultStickerCheckBox; QGridLayout *mLayout; KsnipConfig *mConfig; int mPathDataKey; int mIsSavedDataKey; int mIsRemovedDataKey; void initGui(); void loadConfig(); private slots: void addTriggered(); void removeTriggered(); void upTriggered(); void downTriggered(); void currentRowChanged(int row); void addSticker(const QString &path, bool isSaved) const; QString stickerDirectory() const; QStringList processSticker() const; }; #endif //KSNIP_STICKERSETTINGS_H ksnip-1.9.2/src/gui/settingsDialog/TrayIconSettings.cpp000066400000000000000000000161301414701001100231450ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "TrayIconSettings.h" TrayIconSettings::TrayIconSettings(KsnipConfig *config, const QList &captureModes) : mConfig(config), mUseTrayIconCheckBox(new QCheckBox(this)), mMinimizeToTrayCheckBox(new QCheckBox(this)), mCloseToTrayCheckBox(new QCheckBox(this)), mTrayIconNotificationsCheckBox(new QCheckBox(this)), mUsePlatformSpecificNotificationServiceCheckBox(new QCheckBox(this)), mDefaultActionCaptureModeCombobox(new QComboBox(this)), mStartMinimizedToTrayCheckBox(new QCheckBox(this)), mDefaultActionShowEditorRadioButton(new QRadioButton(this)), mDefaultActionCaptureRadioButton(new QRadioButton(this)), mDefaultActionGroupBox(new QGroupBox(this)), mDefaultActionLayout(new QGridLayout), mLayout(new QGridLayout) { Q_ASSERT(mConfig != nullptr); initGui(); populateDefaultActionCaptureModeCombobox(captureModes); loadConfig(); } TrayIconSettings::~TrayIconSettings() { delete mUseTrayIconCheckBox; delete mMinimizeToTrayCheckBox; delete mCloseToTrayCheckBox; delete mTrayIconNotificationsCheckBox; delete mUsePlatformSpecificNotificationServiceCheckBox; delete mDefaultActionCaptureModeCombobox; delete mStartMinimizedToTrayCheckBox; delete mDefaultActionShowEditorRadioButton; delete mDefaultActionCaptureRadioButton; delete mDefaultActionGroupBox; } void TrayIconSettings::saveSettings() { mConfig->setUseTrayIcon(mUseTrayIconCheckBox->isChecked()); mConfig->setMinimizeToTray(mMinimizeToTrayCheckBox->isChecked()); mConfig->setStartMinimizedToTray(mStartMinimizedToTrayCheckBox->isChecked()); mConfig->setCloseToTray(mCloseToTrayCheckBox->isChecked()); mConfig->setTrayIconNotificationsEnabled(mTrayIconNotificationsCheckBox->isChecked()); mConfig->setPlatformSpecificNotificationServiceEnabled(mUsePlatformSpecificNotificationServiceCheckBox->isChecked()); mConfig->setDefaultTrayIconActionMode(selectedTrayIconDefaultActionMode()); mConfig->setDefaultTrayIconCaptureMode(mDefaultActionCaptureModeCombobox->currentData().value()); } void TrayIconSettings::initGui() { mUseTrayIconCheckBox->setText(tr("Use Tray Icon")); mUseTrayIconCheckBox->setToolTip(tr("When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it.\n" "Change requires restart.")); mMinimizeToTrayCheckBox->setText(tr("Minimize to Tray")); mStartMinimizedToTrayCheckBox->setText(tr("Start Minimized to Tray")); mCloseToTrayCheckBox->setText(tr("Close to Tray")); mTrayIconNotificationsCheckBox->setText(tr("Display Tray icon notifications")); mUsePlatformSpecificNotificationServiceCheckBox->setText(tr("Use platform specific notification service")); mUsePlatformSpecificNotificationServiceCheckBox->setToolTip(tr("When enabled will use try to use platform specific notification\n" "service when such exists. Change requires restart to take effect.")); connect(mUseTrayIconCheckBox, &QCheckBox::stateChanged, this, &TrayIconSettings::useTrayIconChanged); mDefaultActionShowEditorRadioButton->setText(tr("Show Editor")); mDefaultActionCaptureRadioButton->setText(tr("Capture") + QLatin1String(":")); mDefaultActionLayout->addWidget(mDefaultActionShowEditorRadioButton, 0, 0, 1, 1); mDefaultActionLayout->addWidget(mDefaultActionCaptureRadioButton, 1, 0, 1, 1); mDefaultActionLayout->addWidget(mDefaultActionCaptureModeCombobox, 1, 1, 1, 1); mDefaultActionLayout->setColumnStretch(2, 1); mDefaultActionGroupBox->setTitle(tr("Default Tray Icon action")); mDefaultActionGroupBox->setToolTip(tr("Default Action that is triggered by left clicking the tray icon.")); mDefaultActionGroupBox->setLayout(mDefaultActionLayout); mLayout->setAlignment(Qt::AlignTop); mLayout->setColumnMinimumWidth(0, 10); mLayout->addWidget(mUseTrayIconCheckBox, 0, 0, 1, 4); mLayout->setRowMinimumHeight(1, 5); mLayout->addWidget(mStartMinimizedToTrayCheckBox, 2, 0, 1, 4); mLayout->addWidget(mMinimizeToTrayCheckBox, 3, 0, 1, 4); mLayout->addWidget(mCloseToTrayCheckBox, 4, 0, 1, 4); mLayout->addWidget(mTrayIconNotificationsCheckBox, 5, 0, 1, 4); mLayout->addWidget(mUsePlatformSpecificNotificationServiceCheckBox, 6, 0, 1, 4); mLayout->addWidget(mDefaultActionGroupBox, 7, 0, 1, 4); setTitle(tr("Tray Icon Settings")); setLayout(mLayout); } void TrayIconSettings::loadConfig() { mUseTrayIconCheckBox->setChecked(mConfig->useTrayIcon()); mMinimizeToTrayCheckBox->setChecked(mConfig->minimizeToTray()); mStartMinimizedToTrayCheckBox->setChecked(mConfig->startMinimizedToTray()); mCloseToTrayCheckBox->setChecked(mConfig->closeToTray()); mTrayIconNotificationsCheckBox->setChecked(mConfig->trayIconNotificationsEnabled()); mUsePlatformSpecificNotificationServiceCheckBox->setChecked(mConfig->platformSpecificNotificationServiceEnabled()); mDefaultActionShowEditorRadioButton->setChecked(mConfig->defaultTrayIconActionMode() == TrayIconDefaultActionMode::ShowEditor); mDefaultActionCaptureRadioButton->setChecked(mConfig->defaultTrayIconActionMode() == TrayIconDefaultActionMode::Capture); mDefaultActionCaptureModeCombobox->setCurrentIndex(indexOfSelectedCaptureMode()); useTrayIconChanged(); } int TrayIconSettings::indexOfSelectedCaptureMode() const { return mDefaultActionCaptureModeCombobox->findData(QVariant::fromValue(mConfig->defaultTrayIconCaptureMode())); } TrayIconDefaultActionMode TrayIconSettings::selectedTrayIconDefaultActionMode() const { return mDefaultActionShowEditorRadioButton->isChecked() ? TrayIconDefaultActionMode::ShowEditor : TrayIconDefaultActionMode::Capture; } void TrayIconSettings::populateDefaultActionCaptureModeCombobox(const QList &captureModes) { for (auto captureMode: captureModes) { const auto label = EnumTranslator::instance()->toString(captureMode); mDefaultActionCaptureModeCombobox->addItem(label, static_cast(captureMode)); } } void TrayIconSettings::useTrayIconChanged() { const auto trayIconEnabled = mUseTrayIconCheckBox->isChecked(); mMinimizeToTrayCheckBox->setEnabled(trayIconEnabled); mCloseToTrayCheckBox->setEnabled(trayIconEnabled); mTrayIconNotificationsCheckBox->setEnabled(trayIconEnabled); mUsePlatformSpecificNotificationServiceCheckBox->setEnabled(trayIconEnabled); mStartMinimizedToTrayCheckBox->setEnabled(trayIconEnabled); mDefaultActionCaptureModeCombobox->setEnabled(trayIconEnabled); mDefaultActionShowEditorRadioButton->setEnabled(trayIconEnabled); mDefaultActionCaptureRadioButton->setEnabled(trayIconEnabled); } ksnip-1.9.2/src/gui/settingsDialog/TrayIconSettings.h000066400000000000000000000041431414701001100226130ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_TRAYICONSETTINGS_H #define KSNIP_TRAYICONSETTINGS_H #include #include #include #include #include #include #include "src/backend/config/KsnipConfig.h" #include "src/common/helper/EnumTranslator.h" class TrayIconSettings : public QGroupBox { Q_OBJECT public: explicit TrayIconSettings(KsnipConfig *config, const QList &captureModes); ~TrayIconSettings() override; void saveSettings(); private: QCheckBox *mUseTrayIconCheckBox; QCheckBox *mMinimizeToTrayCheckBox; QCheckBox *mCloseToTrayCheckBox; QCheckBox *mTrayIconNotificationsCheckBox; QCheckBox *mUsePlatformSpecificNotificationServiceCheckBox; QComboBox *mDefaultActionCaptureModeCombobox; QCheckBox *mStartMinimizedToTrayCheckBox; QRadioButton *mDefaultActionShowEditorRadioButton; QRadioButton *mDefaultActionCaptureRadioButton; QGridLayout *mLayout; QGridLayout *mDefaultActionLayout; QGroupBox *mDefaultActionGroupBox; KsnipConfig *mConfig; void initGui(); void loadConfig(); void populateDefaultActionCaptureModeCombobox(const QList &captureModes); TrayIconDefaultActionMode selectedTrayIconDefaultActionMode() const; int indexOfSelectedCaptureMode() const; private slots: void useTrayIconChanged(); }; #endif //KSNIP_TRAYICONSETTINGS_H ksnip-1.9.2/src/gui/settingsDialog/UploaderSettings.cpp000066400000000000000000000044541414701001100231760ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "UploaderSettings.h" UploaderSettings::UploaderSettings(KsnipConfig *ksnipConfig) : mConfig(ksnipConfig), mConfirmBeforeUploadCheckbox(new QCheckBox(this)), mUploaderTypeComboBox(new QComboBox(this)), mUploaderTypeLabel(new QLabel(this)), mLayout(new QGridLayout(this)) { initGui(); loadConfig(); } UploaderSettings::~UploaderSettings() { delete mConfirmBeforeUploadCheckbox; delete mUploaderTypeComboBox; delete mUploaderTypeLabel; } void UploaderSettings::saveSettings() { mConfig->setConfirmBeforeUpload(mConfirmBeforeUploadCheckbox->isChecked()); mConfig->setUploaderType(static_cast(mUploaderTypeComboBox->currentData().toInt())); } void UploaderSettings::initGui() { mConfirmBeforeUploadCheckbox->setText(tr("Ask for confirmation before uploading")); mUploaderTypeLabel->setText(tr("Uploader Type:")); mUploaderTypeComboBox->addItem(tr("Imgur"), static_cast(UploaderType::Imgur)); mUploaderTypeComboBox->addItem(tr("Script"), static_cast(UploaderType::Script)); mLayout->setAlignment(Qt::AlignTop); mLayout->addWidget(mConfirmBeforeUploadCheckbox, 0, 0, 1, 3); mLayout->setRowMinimumHeight(1, 15); mLayout->addWidget(mUploaderTypeLabel, 2, 0, 1, 1); mLayout->addWidget(mUploaderTypeComboBox, 2, 1, 1, 1); setTitle(tr("Uploader")); setLayout(mLayout); } void UploaderSettings::loadConfig() { mConfirmBeforeUploadCheckbox->setChecked(mConfig->confirmBeforeUpload()); mUploaderTypeComboBox->setCurrentIndex(mUploaderTypeComboBox->findData(static_cast(mConfig->uploaderType()))); } ksnip-1.9.2/src/gui/settingsDialog/UploaderSettings.h000066400000000000000000000026621414701001100226420ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_UPLOADERSETTINGS_H #define KSNIP_UPLOADERSETTINGS_H #include #include #include #include #include #include "src/backend/config/KsnipConfig.h" #include "src/common/enum/UploaderType.h" class UploaderSettings : public QGroupBox { Q_OBJECT public: explicit UploaderSettings(KsnipConfig *ksnipConfig); ~UploaderSettings() override; void saveSettings(); private: QGridLayout *mLayout; KsnipConfig *mConfig; QCheckBox *mConfirmBeforeUploadCheckbox; QComboBox *mUploaderTypeComboBox; QLabel *mUploaderTypeLabel; void initGui(); void loadConfig(); }; #endif //KSNIP_UPLOADERSETTINGS_H ksnip-1.9.2/src/gui/settingsDialog/WatermarkSettings.cpp000066400000000000000000000054521414701001100233570ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "WatermarkSettings.h" WatermarkSettings::WatermarkSettings(KsnipConfig *config) : mConfig(config), mLayout(new QGridLayout(this)), mRotateWatermarkCheckbox(new QCheckBox(this)), mWatermarkImageLabel(new QLabel(this)), mUpdateWatermarkImageButton(new QPushButton(this)) { Q_ASSERT(mConfig != nullptr); mConfig = config; initGui(); loadConfig(); } WatermarkSettings::~WatermarkSettings() { delete mRotateWatermarkCheckbox; delete mWatermarkImageLabel; delete mUpdateWatermarkImageButton; } void WatermarkSettings::saveSettings() { mConfig->setRotateWatermarkEnabled(mRotateWatermarkCheckbox->isChecked()); } void WatermarkSettings::initGui() { mWatermarkImageLabel->setPixmap(mWatermarkImageLoader.load()); mWatermarkImageLabel->setToolTip(tr("Watermark Image")); mWatermarkImageLabel->setAutoFillBackground(true); mWatermarkImageLabel->setFixedSize(ScaledSizeProvider::scaledSize(QSize(100, 100))); mWatermarkImageLabel->setScaledContents(true); mWatermarkImageLabel->setStyleSheet(QLatin1String("QLabel { background-color : white; }")); mUpdateWatermarkImageButton->setText(tr("Update")); connect(mUpdateWatermarkImageButton, &QPushButton::clicked, this, &WatermarkSettings::updateWatermarkImageClicked); mRotateWatermarkCheckbox->setText(tr("Rotate Watermark")); mRotateWatermarkCheckbox->setToolTip(tr("When enabled, Watermark will be added with a rotation of 45°")); mLayout->setAlignment(Qt::AlignTop); mLayout->addWidget(mWatermarkImageLabel, 0, 0); mLayout->addWidget(mUpdateWatermarkImageButton, 0, 1, Qt::AlignLeft); mLayout->setRowMinimumHeight(1, 15); mLayout->addWidget(mRotateWatermarkCheckbox, 2, 0); setTitle(tr("Watermark Settings")); setLayout(mLayout); } void WatermarkSettings::loadConfig() { mRotateWatermarkCheckbox->setChecked(mConfig->rotateWatermarkEnabled()); } void WatermarkSettings::updateWatermarkImageClicked() { UpdateWatermarkOperation operation(this); auto successful = operation.execute(); if(successful) { mWatermarkImageLabel->setPixmap(mWatermarkImageLoader.load()); } } ksnip-1.9.2/src/gui/settingsDialog/WatermarkSettings.h000066400000000000000000000031401414701001100230140ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_WATERMARKSETTINGS_H #define KSNIP_WATERMARKSETTINGS_H #include #include #include #include #include #include "src/backend/config/KsnipConfig.h" #include "src/gui/operations/UpdateWatermarkOperation.h" #include "src/common/provider/ScaledSizeProvider.h" class WatermarkSettings : public QGroupBox { Q_OBJECT public: explicit WatermarkSettings(KsnipConfig *config); ~WatermarkSettings() override; void saveSettings(); private: QGridLayout *mLayout; KsnipConfig *mConfig; QCheckBox *mRotateWatermarkCheckbox; QLabel *mWatermarkImageLabel; QPushButton *mUpdateWatermarkImageButton; WatermarkImageLoader mWatermarkImageLoader; void initGui(); void loadConfig(); private slots: void updateWatermarkImageClicked(); }; #endif //KSNIP_WATERMARKSETTINGS_H ksnip-1.9.2/src/gui/settingsDialog/actions/000077500000000000000000000000001414701001100206275ustar00rootroot00000000000000ksnip-1.9.2/src/gui/settingsDialog/actions/ActionSettingTab.cpp000066400000000000000000000177111414701001100245440ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "ActionSettingTab.h" ActionSettingTab::ActionSettingTab(const QString &name, const QList &captureModes) : ActionSettingTab(captureModes) { mNameLineEdit->setTextAndPlaceholderText(name); } ActionSettingTab::ActionSettingTab(const Action &action, const QList &captureModes) : ActionSettingTab(captureModes) { setAction(action); } ActionSettingTab::~ActionSettingTab() { delete mCaptureModeComboBox; delete mCaptureEnabledCheckBox; delete mIncludeCursorCheckBox; delete mShowPinWindowCheckBox; delete mCopyToClipboardCheckBox; delete mUploadCheckBox; delete mOpenDirectoryCheckBox; delete mHideMainWindowCheckBox; delete mSaveCheckBox; delete mCaptureModeLabel; delete mDelayLabel; delete mNameLabel; delete mShortcutLabel; delete mDelaySpinBox; delete mNameLineEdit; delete mShortcutLineEdit; delete mLayout; } void ActionSettingTab::initGui(const QList &captureModes) { mNameLabel->setText(tr("Name") + QLatin1String(":")); mNameLineEdit->setMaxLength(50); connect(mNameLineEdit, &QLineEdit::editingFinished, this, &ActionSettingTab::nameEditingFinished); mShortcutLabel->setText(tr("Shortcut") + QLatin1String(":")); mShortcutLabel->setToolTip("When global hotkeys are enabled and supported then\n" "this shortcut will also work as a global hotkey."); mShortcutLineEdit->setToolTip(mShortcutLabel->toolTip()); mShortcutClearButton->setText(tr("Clear")); connect(mShortcutClearButton, &QPushButton::clicked, mShortcutLineEdit, &KeySequenceLineEdit::clear); mCaptureEnabledCheckBox->setText(tr("Take Capture")); connect(mCaptureEnabledCheckBox, &QCheckBox::toggled, this, &ActionSettingTab::captureEnabledChanged); mIncludeCursorCheckBox->setText(tr("Include Cursor")); mDelayLabel->setText(tr("Delay") + QLatin1String(":")); mDelaySpinBox->setSuffix(tr("s")); mCaptureModeLabel->setText(tr("Capture Mode") + QLatin1String(":")); populateCaptureModeCombobox(captureModes); mShowPinWindowCheckBox->setText(tr("Show image in Pin Window")); mCopyToClipboardCheckBox->setText(tr("Copy image to Clipboard")); mUploadCheckBox->setText(tr("Upload image")); mOpenDirectoryCheckBox->setText(tr("Open image parent directory")); mSaveCheckBox->setText(tr("Save image")); mHideMainWindowCheckBox->setText(tr("Hide Main Window")); mLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft); mLayout->setColumnMinimumWidth(0, 10); mLayout->addWidget(mNameLabel, 0, 0, 1, 2); mLayout->addWidget(mNameLineEdit, 0, 2, 1, 3); mLayout->addWidget(mShortcutLabel, 1, 0, 1, 2); mLayout->addWidget(mShortcutLineEdit, 1, 2, 1, 3); mLayout->addWidget(mShortcutClearButton, 1, 6, 1, 1); mLayout->setRowMinimumHeight(2, 10); mLayout->addWidget(mCaptureEnabledCheckBox, 3, 0, 1, 5); mLayout->addWidget(mIncludeCursorCheckBox, 4, 1, 1, 4); mLayout->addWidget(mDelayLabel, 5, 1, 1, 2); mLayout->addWidget(mDelaySpinBox, 5, 3, 1, 2); mLayout->addWidget(mCaptureModeLabel, 6, 1, 1, 2); mLayout->addWidget(mCaptureModeComboBox, 6, 3, 1, 2); mLayout->setRowMinimumHeight(7, 10); mLayout->addWidget(mShowPinWindowCheckBox, 8, 0, 1, 5); mLayout->addWidget(mCopyToClipboardCheckBox, 9, 0, 1, 5); mLayout->addWidget(mUploadCheckBox, 10, 0, 1, 5); mLayout->addWidget(mSaveCheckBox, 11, 0, 1, 5); mLayout->addWidget(mOpenDirectoryCheckBox, 12, 0, 1, 5); mLayout->addWidget(mHideMainWindowCheckBox, 13, 0, 1, 5); setLayout(mLayout); } void ActionSettingTab::populateCaptureModeCombobox(const QList &captureModes) { for (auto captureMode: captureModes) { const auto label = EnumTranslator::instance()->toString(captureMode); mCaptureModeComboBox->addItem(label, static_cast(captureMode)); } } void ActionSettingTab::captureEnabledChanged() { auto isEnabled = mCaptureEnabledCheckBox->isChecked(); mIncludeCursorCheckBox->setEnabled(isEnabled); mDelayLabel->setEnabled(isEnabled); mDelaySpinBox->setEnabled(isEnabled); mCaptureModeLabel->setEnabled(isEnabled); mCaptureModeComboBox->setEnabled(isEnabled); } Action ActionSettingTab::action() const { Action action; action.setName(getTextWithEscapedAmpersand(mNameLineEdit->textOrPlaceholderText())); action.setShortcut(mShortcutLineEdit->value()); action.setIsCaptureEnabled(mCaptureEnabledCheckBox->isChecked()); action.setCaptureDelay(mDelaySpinBox->value() * 1000); action.setIncludeCursor(mIncludeCursorCheckBox->isChecked()); action.setCaptureMode(mCaptureModeComboBox->currentData().value()); action.setIsPinScreenshotEnabled(mShowPinWindowCheckBox->isChecked()); action.setIsSaveEnabled(mSaveCheckBox->isChecked()); action.setIsCopyToClipboardEnabled(mCopyToClipboardCheckBox->isChecked()); action.setIsOpenDirectoryEnabled(mOpenDirectoryCheckBox->isChecked()); action.setIsUploadEnabled(mUploadCheckBox->isChecked()); action.setIsHideMainWindowEnabled(mHideMainWindowCheckBox->isChecked()); return action; } ActionSettingTab::ActionSettingTab(const QList &captureModes) : mCaptureModeComboBox(new QComboBox(nullptr)), mCaptureEnabledCheckBox(new QCheckBox(this)), mIncludeCursorCheckBox(new QCheckBox(this)), mShowPinWindowCheckBox(new QCheckBox(this)), mCopyToClipboardCheckBox(new QCheckBox(this)), mUploadCheckBox(new QCheckBox(this)), mOpenDirectoryCheckBox(new QCheckBox(this)), mHideMainWindowCheckBox(new QCheckBox(this)), mSaveCheckBox(new QCheckBox(this)), mCaptureModeLabel(new QLabel(this)), mDelayLabel(new QLabel(this)), mNameLabel(new QLabel(this)), mShortcutLabel(new QLabel(this)), mDelaySpinBox(new CustomSpinBox(0, 100)), mNameLineEdit(new CustomLineEdit(this)), mShortcutLineEdit(new KeySequenceLineEdit(this, HotKeyMap::instance()->getAllKeys())), mShortcutClearButton(new QPushButton(this)), mLayout(new QGridLayout(this)) { initGui(captureModes); captureEnabledChanged(); } void ActionSettingTab::setAction(const Action &action) const { mNameLineEdit->setTextAndPlaceholderText(getTextWithoutEscapedAmpersand(action.name())); mShortcutLineEdit->setValue(action.shortcut()); mCaptureEnabledCheckBox->setChecked(action.isCaptureEnabled()); mDelaySpinBox->setValue(action.captureDelay() / 1000); mIncludeCursorCheckBox->setChecked(action.includeCursor()); mCaptureModeComboBox->setCurrentIndex(indexOfSelectedCaptureMode(action.captureMode())); mShowPinWindowCheckBox->setChecked(action.isPinImageEnabled()); mSaveCheckBox->setChecked(action.isSaveEnabled()); mCopyToClipboardCheckBox->setChecked(action.isCopyToClipboardEnabled()); mOpenDirectoryCheckBox->setChecked(action.isOpenDirectoryEnabled()); mUploadCheckBox->setChecked(action.isUploadEnabled()); mHideMainWindowCheckBox->setChecked(action.isHideMainWindowEnabled()); } int ActionSettingTab::indexOfSelectedCaptureMode(CaptureModes modes) const { return mCaptureModeComboBox->findData(QVariant::fromValue(modes)); } QString ActionSettingTab::getTextWithEscapedAmpersand(const QString &text) { auto copiedText = text; return copiedText.replace(QLatin1String("&"), QLatin1String("&&")); } QString ActionSettingTab::getTextWithoutEscapedAmpersand(const QString &text) { auto copiedText = text; return copiedText.replace(QLatin1String("&&"), QLatin1String("&")); } void ActionSettingTab::nameEditingFinished() { emit nameChanged(getTextWithEscapedAmpersand(mNameLineEdit->textOrPlaceholderText())); } ksnip-1.9.2/src/gui/settingsDialog/actions/ActionSettingTab.h000066400000000000000000000052761414701001100242140ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_ACTIONSETTINGTAB_H #define KSNIP_ACTIONSETTINGTAB_H #include #include #include #include #include #include #include #include "src/common/helper/EnumTranslator.h" #include "src/widgets/CustomSpinBox.h" #include "src/widgets/CustomLineEdit.h" #include "src/widgets/KeySequenceLineEdit.h" #include "src/gui/actions/Action.h" #include "src/gui/globalHotKeys/HotKeyMap.h" class ActionSettingTab : public QWidget { Q_OBJECT public: explicit ActionSettingTab(const QString &name, const QList &captureModes); explicit ActionSettingTab(const Action &action, const QList &captureModes); ~ActionSettingTab() override; Action action() const; signals: void nameChanged(const QString &name); protected: explicit ActionSettingTab(const QList &captureModes); void setAction(const Action &action) const; private: QComboBox *mCaptureModeComboBox; QCheckBox *mCaptureEnabledCheckBox; QCheckBox *mIncludeCursorCheckBox; QCheckBox *mShowPinWindowCheckBox; QCheckBox *mUploadCheckBox; QCheckBox *mSaveCheckBox; QCheckBox *mCopyToClipboardCheckBox; QCheckBox *mOpenDirectoryCheckBox; QCheckBox *mHideMainWindowCheckBox; QLabel *mCaptureModeLabel; QLabel *mDelayLabel; QLabel *mNameLabel; QLabel *mShortcutLabel; CustomSpinBox *mDelaySpinBox; CustomLineEdit *mNameLineEdit; KeySequenceLineEdit *mShortcutLineEdit; QPushButton *mShortcutClearButton; QGridLayout *mLayout; void initGui(const QList &captureModes); void populateCaptureModeCombobox(const QList &captureModes); int indexOfSelectedCaptureMode(CaptureModes modes) const; static QString getTextWithEscapedAmpersand(const QString &text); static QString getTextWithoutEscapedAmpersand(const QString &text); private slots: void captureEnabledChanged(); void nameEditingFinished(); }; #endif //KSNIP_ACTIONSETTINGTAB_H ksnip-1.9.2/src/gui/settingsDialog/actions/ActionsSettings.cpp000066400000000000000000000057341414701001100244650ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "ActionsSettings.h" ActionsSettings::ActionsSettings(KsnipConfig *config, const QList &captureModes) : mConfig(config), mLayout(new QVBoxLayout(this)), mTabWidget(new QTabWidget(this)), mCaptureModes(captureModes) { Q_ASSERT(mConfig != nullptr); initGui(); loadConfig(); mTabWidget->setCurrentIndex(0); } ActionsSettings::~ActionsSettings() { delete mTabWidget; delete mLayout; } void ActionsSettings::saveSettings() { QList actions; auto count = mTabWidget->count(); for (int index = 0; index < count; ++index) { auto tabContent = dynamic_cast(mTabWidget->widget(index)); if(tabContent != nullptr) { actions.append(tabContent->action()); } } mConfig->setActions(actions); } void ActionsSettings::initGui() { auto addButton = new QPushButton(); addButton->setText(tr("Add")); connect(addButton, &QPushButton::clicked, this, &ActionsSettings::addEmptyTab); auto addTabIndex = mTabWidget->addTab(new EmptyActionSettingTab, QString()); mTabWidget->setTabEnabled(addTabIndex, false); mTabWidget->tabBar()->setTabButton(addTabIndex, QTabBar::RightSide, addButton); mTabWidget->setTabsClosable(true); connect(mTabWidget, &QTabWidget::tabCloseRequested, this, &ActionsSettings::closeTab); mLayout->addWidget(mTabWidget); setTitle(tr("Actions Settings")); setLayout(mLayout); } void ActionsSettings::loadConfig() { auto actions = mConfig->actions(); for(const auto& action : actions) { auto tabContent = new ActionSettingTab(action, mCaptureModes); insertActionTab(tabContent, action.name()); } } void ActionsSettings::insertActionTab(ActionSettingTab *tabContent, const QString &name) { auto index = mTabWidget->insertTab(mTabWidget->count() - 1, tabContent, name); connect(tabContent, &ActionSettingTab::nameChanged, [this, index](const QString &name) { mTabWidget->setTabText(index, name); }); mTabWidget->setCurrentIndex(index); } void ActionsSettings::addEmptyTab() { auto name = tr("Action") + QLatin1String(" ") + QString::number(mTabWidget->count()); auto tabContent = new ActionSettingTab(name, mCaptureModes); insertActionTab(tabContent, name); } void ActionsSettings::closeTab(int index) { mTabWidget->removeTab(index); } ksnip-1.9.2/src/gui/settingsDialog/actions/ActionsSettings.h000066400000000000000000000030651414701001100241250ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_ACTIONSSETTINGS_H #define KSNIP_ACTIONSSETTINGS_H #include #include #include #include #include "ActionSettingTab.h" #include "EmptyActionSettingTab.h" #include "src/backend/config/KsnipConfig.h" class ActionsSettings : public QGroupBox { Q_OBJECT public: explicit ActionsSettings(KsnipConfig *config, const QList &captureModes); ~ActionsSettings() override; void saveSettings(); private: QVBoxLayout *mLayout; KsnipConfig *mConfig; QTabWidget *mTabWidget; QList mCaptureModes; void initGui(); void loadConfig(); void insertActionTab(ActionSettingTab *tabContent, const QString &name); private slots: void addEmptyTab(); void closeTab(int index); }; #endif //KSNIP_ACTIONSSETTINGS_H ksnip-1.9.2/src/gui/settingsDialog/actions/EmptyActionSettingTab.cpp000066400000000000000000000022611414701001100255550ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "EmptyActionSettingTab.h" EmptyActionSettingTab::EmptyActionSettingTab() : mContent(new QLabel(this)), mLayout(new QVBoxLayout(this)) { mContent->setText(tr("Add new actions by pressing the 'Add' tab button.")); mLayout->addWidget(mContent); mLayout->setAlignment(Qt::AlignCenter); setLayout(mLayout); } EmptyActionSettingTab::~EmptyActionSettingTab() { delete mContent; delete mLayout; } ksnip-1.9.2/src/gui/settingsDialog/actions/EmptyActionSettingTab.h000066400000000000000000000022001414701001100252130ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_EMPTYACTIONSETTINGTAB_H #define KSNIP_EMPTYACTIONSETTINGTAB_H #include #include #include class EmptyActionSettingTab : public QWidget { Q_OBJECT public: EmptyActionSettingTab(); ~EmptyActionSettingTab() override; private: QLabel *mContent; QVBoxLayout *mLayout; }; #endif //KSNIP_EMPTYACTIONSETTINGTAB_H ksnip-1.9.2/src/gui/snippingArea/000077500000000000000000000000001414701001100166275ustar00rootroot00000000000000ksnip-1.9.2/src/gui/snippingArea/AbstractSnippingArea.cpp000066400000000000000000000161301414701001100234000ustar00rootroot00000000000000/* * Copyright (C) 2016 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "AbstractSnippingArea.h" AbstractSnippingArea::AbstractSnippingArea() : mConfig(KsnipConfigProvider::instance()), mBackground(nullptr), mResizer(new SnippingAreaResizer(mConfig, this)), mSelector(new SnippingAreaSelector(mConfig, this)), mSelectorInfoText(new SnippingAreaSelectorInfoText(this)), mResizerInfoText(new SnippingAreaResizerInfoText(this)), mIsSwitchPressed(false), mTimer(new QTimer(this)), mUnselectedRegionAlpha(150) { // Make the frame span across the screen and show above any other widget setWindowFlags(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint); setMouseTracking(true); connect(mResizer, &SnippingAreaResizer::rectChanged, this, &AbstractSnippingArea::updateCapturedArea); connect(mResizer, &SnippingAreaResizer::cursorChanged, this, &AbstractSnippingArea::updateCursor); connect(mSelector, &SnippingAreaSelector::rectChanged, this, &AbstractSnippingArea::updateCapturedArea); connect(mSelector, &SnippingAreaSelector::cursorChanged, this, &AbstractSnippingArea::updateCursor); connect(mTimer, &QTimer::timeout, this, &AbstractSnippingArea::cancelSelection); } AbstractSnippingArea::~AbstractSnippingArea() { delete mBackground; delete mResizer; delete mSelector; delete mSelectorInfoText; delete mResizerInfoText; delete mTimer; } void AbstractSnippingArea::showWithoutBackground() { setAttribute(Qt::WA_TranslucentBackground, true); clearBackgroundImage(); showSnippingArea(); } void AbstractSnippingArea::showWithBackground(const QPixmap &background) { setAttribute(Qt::WA_TranslucentBackground, false); setBackgroundImage(background); showSnippingArea(); } void AbstractSnippingArea::showSnippingArea() { startTimeout(); mIsSwitchPressed = false; setFullScreen(); mSelector->activate(getSnippingAreaGeometry(), getLocalCursorPosition()); mUnselectedRegionAlpha = mConfig->snippingAreaTransparency(); if(mConfig->showSnippingAreaInfoText()) { mSelectorInfoText->activate(getSnippingAreaGeometry(), mConfig->allowResizingRectSelection()); } grabKeyboardFocus(); } void AbstractSnippingArea::setBackgroundImage(const QPixmap &background) { clearBackgroundImage(); mBackground = new QPixmap(background); mSelector->setBackgroundImage(mBackground); } void AbstractSnippingArea::clearBackgroundImage() { delete mBackground; mBackground = nullptr; mSelector->setBackgroundImage(nullptr); } void AbstractSnippingArea::mousePressEvent(QMouseEvent *event) { if (event->button() != Qt::LeftButton) { return; } mResizer->handleMousePress(event); mSelector->handleMousePress(event); } void AbstractSnippingArea::mouseReleaseEvent(QMouseEvent *event) { if (event->button() != Qt::LeftButton) { return; } mResizer->handleMouseRelease(event); mSelector->handleMouseRelease(event); if(isResizerSwitchRequired() && !mResizer->isActive()) { switchToResizer(event->pos()); } else if(mSelector->isActive()){ finishSelection(); } } bool AbstractSnippingArea::isResizerSwitchRequired() const { bool allowResizingRectSelection = mConfig->allowResizingRectSelection(); return (allowResizingRectSelection && !mIsSwitchPressed) || (!allowResizingRectSelection && mIsSwitchPressed); } void AbstractSnippingArea::switchToResizer(QPoint point) { mSelector->deactivate(); mSelectorInfoText->deactivate(); if(mConfig->showSnippingAreaInfoText()) { mResizerInfoText->activate(getSnippingAreaGeometry()); } mResizer->activate(mCaptureArea, point); update(); } QPixmap AbstractSnippingArea::background() const { Q_ASSERT(!isBackgroundTransparent()); return *mBackground; } bool AbstractSnippingArea::closeSnippingArea() { mSelector->deactivate(); mResizer->deactivate(); mSelectorInfoText->deactivate(); mResizerInfoText->deactivate(); releaseKeyboard(); // Issue #57 return QWidget::close(); } void AbstractSnippingArea::mouseMoveEvent(QMouseEvent *event) { mResizer->handleMouseMove(event); mSelector->handleMouseMove(event); mSelectorInfoText->handleMouseMove(event->pos()); mResizerInfoText->handleMouseMove(event->pos()); update(); QWidget::mouseMoveEvent(event); } void AbstractSnippingArea::paintEvent(QPaintEvent *event) { QPainter painter(this); auto snippingAreaGeometry = getSnippingAreaGeometry(); if (!isBackgroundTransparent()) { painter.drawPixmap(snippingAreaGeometry, *mBackground); } painter.setClipRegion(mClippingRegion); painter.setBrush(QColor(0, 0, 0, mUnselectedRegionAlpha)); painter.drawRect(snippingAreaGeometry); mResizer->paint(&painter); mSelector->paint(&painter); painter.setClipRect(snippingAreaGeometry); mSelectorInfoText->paint(&painter); mResizerInfoText->paint(&painter); QWidget::paintEvent(event); } bool AbstractSnippingArea::isBackgroundTransparent() const { return mBackground == nullptr; } QPoint AbstractSnippingArea::getLocalCursorPosition() const { return QCursor::pos(); } void AbstractSnippingArea::keyPressEvent(QKeyEvent *event) { if (event->key() == Qt::Key_Escape) { cancelSelection(); } else if (event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) { finishSelection(); } else if (event->key() == Qt::Key_Control){ mIsSwitchPressed = true; } mResizer->handleKeyPress(event); update(); QWidget::keyPressEvent(event); } void AbstractSnippingArea::keyReleaseEvent(QKeyEvent *event) { if (event->key() == Qt::Key_Control) { mIsSwitchPressed = false; } mResizer->handleKeyRelease(event); QWidget::keyReleaseEvent(event); } void AbstractSnippingArea::cancelSelection() { stopTimeout(); closeSnippingArea(); emit canceled(); } void AbstractSnippingArea::updateCapturedArea(const QRectF &rect) { mCaptureArea = rect.toRect(); mClippingRegion = QRegion(getSnippingAreaGeometry()).subtracted(QRegion(mCaptureArea)); } void AbstractSnippingArea::finishSelection() { stopTimeout(); closeSnippingArea(); mConfig->setLastRectArea(selectedRectArea()); emit finished(); } void AbstractSnippingArea::grabKeyboardFocus() { QApplication::setActiveWindow(this); activateWindow(); setFocus(); grabKeyboard(); } void AbstractSnippingArea::updateCursor(const QCursor &cursor) { setCursor(cursor); } void AbstractSnippingArea::stopTimeout() { mTimer->stop(); } void AbstractSnippingArea::startTimeout() { mTimer->start(60000); } ksnip-1.9.2/src/gui/snippingArea/AbstractSnippingArea.h000066400000000000000000000057041414701001100230520ustar00rootroot00000000000000/* * Copyright (C) 2016 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_ABSTRACTSNIPPINGAREA_H #define KSNIP_ABSTRACTSNIPPINGAREA_H #include #include #include #include #include #include "SnippingAreaAdorner.h" #include "SnippingAreaResizer.h" #include "SnippingAreaSelector.h" #include "SnippingAreaSelectorInfoText.h" #include "SnippingAreaResizerInfoText.h" #include "src/common/helper/MathHelper.h" #include "src/backend/config/KsnipConfigProvider.h" class AbstractSnippingArea : public QWidget { Q_OBJECT public: explicit AbstractSnippingArea(); ~AbstractSnippingArea() override; void showWithoutBackground(); void showWithBackground(const QPixmap& background); virtual QRect selectedRectArea() const = 0; virtual QPixmap background() const; bool closeSnippingArea(); signals: void finished(); void canceled(); protected: QRect mCaptureArea; QRegion mClippingRegion; void mousePressEvent(QMouseEvent *event) override; void mouseReleaseEvent(QMouseEvent *event) override; void mouseMoveEvent(QMouseEvent *event) override; void keyPressEvent(QKeyEvent *event) override; void keyReleaseEvent(QKeyEvent *event) override; void paintEvent(QPaintEvent *event) override; virtual bool isBackgroundTransparent() const; virtual void setFullScreen() = 0; virtual QRect getSnippingAreaGeometry() const = 0; virtual QPoint getLocalCursorPosition() const; virtual void grabKeyboardFocus(); private: KsnipConfig *mConfig; QPixmap *mBackground; SnippingAreaResizer *mResizer; SnippingAreaSelector *mSelector; SnippingAreaSelectorInfoText *mSelectorInfoText; SnippingAreaResizerInfoText *mResizerInfoText; bool mIsSwitchPressed; QTimer *mTimer; int mUnselectedRegionAlpha; void setBackgroundImage(const QPixmap &background); void clearBackgroundImage(); virtual void showSnippingArea(); void finishSelection(); private slots: void updateCapturedArea(const QRectF &rect); void updateCursor(const QCursor &cursor); void switchToResizer(QPoint point); void cancelSelection(); bool isResizerSwitchRequired() const; void startTimeout(); void stopTimeout(); }; #endif // KSNIP_ABSTRACTSNIPPINGAREA_H ksnip-1.9.2/src/gui/snippingArea/AbstractSnippingAreaInfoText.cpp000066400000000000000000000050011414701001100250540ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "AbstractSnippingAreaInfoText.h" AbstractSnippingAreaInfoText::AbstractSnippingAreaInfoText(QObject *parent): QObject(parent), mRectPen(new QPen(Qt::black, 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)), mRectBrush(new QBrush(QColor(255, 255, 255, 160))), mBaseInfoTextRect(new QRect(30, 30, 500, 100)), mIsActive(false) { } AbstractSnippingAreaInfoText::~AbstractSnippingAreaInfoText() { delete mRectPen; delete mRectBrush; delete mBaseInfoTextRect; } void AbstractSnippingAreaInfoText::paint(QPainter *painter) { if(mIsActive) { auto fontMetric = painter->fontMetrics(); auto textRect = fontMetric.boundingRect(*mBaseInfoTextRect, Qt::TextWordWrap, mInfoText); auto boundingRect = textRect.adjusted(-10, -10, 10, 10); if(boundingRect.contains(mCurrentMousePos)) { auto newPos = mSnippingAreaGeometry.bottomRight().toPoint(); textRect.moveBottomRight(newPos - QPoint(40, 40)); boundingRect.moveBottomRight(newPos - QPoint(30, 30)); } painter->setBrush(*mRectBrush); painter->setPen(*mRectPen); painter->drawRect(boundingRect); painter->drawText(textRect, mInfoText); } } void AbstractSnippingAreaInfoText::handleMouseMove(const QPoint &pos) { mCurrentMousePos = pos; } void AbstractSnippingAreaInfoText::activate(const QRectF &snippingAreaGeometry) { mIsActive = true; mSnippingAreaGeometry = snippingAreaGeometry; updateInfoText(); } void AbstractSnippingAreaInfoText::deactivate() { mIsActive = false; } void AbstractSnippingAreaInfoText::setInfoText(const QStringList &infoTextLines) { auto newLine = QLatin1String("\n"); mInfoText = QString(); for (int i = 0; i < infoTextLines.length(); ++i) { mInfoText += infoTextLines[i]; if(i < infoTextLines.length() - 1){ mInfoText += newLine; } } } ksnip-1.9.2/src/gui/snippingArea/AbstractSnippingAreaInfoText.h000066400000000000000000000030461414701001100245300ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_ABSTRACTSNIPPINGAREAINFOTEXT_H #define KSNIP_ABSTRACTSNIPPINGAREAINFOTEXT_H #include class AbstractSnippingAreaInfoText : public QObject { Q_OBJECT public: explicit AbstractSnippingAreaInfoText(QObject *parent); ~AbstractSnippingAreaInfoText() override; virtual void paint(QPainter *painter); virtual void handleMouseMove(const QPoint &pos); virtual void activate(const QRectF &snippingAreaGeometry); virtual void deactivate(); protected: virtual void updateInfoText() = 0; void setInfoText(const QStringList &infoTextLines); private: QPen *mRectPen; QBrush *mRectBrush; QString mInfoText; QRect *mBaseInfoTextRect; QPoint mCurrentMousePos; bool mIsActive; QRectF mSnippingAreaGeometry; }; #endif //KSNIP_ABSTRACTSNIPPINGAREAINFOTEXT_H ksnip-1.9.2/src/gui/snippingArea/AdornerMagnifyingGlass.cpp000066400000000000000000000116041414701001100237320ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "AdornerMagnifyingGlass.h" AdornerMagnifyingGlass::AdornerMagnifyingGlass() : mOffsetToMouse(QPoint(20, 20)), mScaleFactor(QSize(600, 600)), mZoomInAreaSize(QSize(100, 100)), mBackgroundOffset(QPoint(50,50)), mCrossHairPen(new QPen(Qt::red, 6)) { mVisibleRect.setWidth(200); mVisibleRect.setHeight(200); } AdornerMagnifyingGlass::~AdornerMagnifyingGlass() { delete mCrossHairPen; } void AdornerMagnifyingGlass::update(const QPoint &mousePosition, const QRect &screenRect) { if (mBackgroundWithMargine.isNull()) { return; } updatePosition(mousePosition, screenRect); updateImage(mousePosition); updateCrossHair(); } void AdornerMagnifyingGlass::paint(QPainter *painter, const QColor &color) { if (mBackgroundWithMargine.isNull()) { return; } painter->setBrush(Qt::NoBrush); painter->setRenderHint(QPainter::Antialiasing); painter->setClipRegion(QRegion(mVisibleRect, QRegion::Ellipse)); painter->drawPixmap(mVisibleRect, mImage); mCrossHairPen->setColor(color); painter->setPen(*mCrossHairPen); painter->drawLine(mCrossHairTop); painter->drawLine(mCrossHairBottom); painter->drawLine(mCrossHairLeft); painter->drawLine(mCrossHairRight); } void AdornerMagnifyingGlass::setBackgroundImage(const QPixmap *background) { if (background == nullptr) { mBackgroundWithMargine = QPixmap(); } else { mBackgroundWithMargine = createBackgroundWithMagine(background); } } void AdornerMagnifyingGlass::updatePosition(const QPoint &mousePosition, const QRect &screenRect) { if (isPositionTopLeftFromMouse(mousePosition, screenRect)) { mVisibleRect.moveBottomRight(mousePosition); } else if (isPositionBottomLeftFromMouse(mousePosition, screenRect)) { mVisibleRect.moveTopRight(mousePosition); } else if (isPositionTopRightFromMouse(mousePosition, screenRect)) { mVisibleRect.moveBottomLeft(mousePosition); } else { mVisibleRect.moveTopLeft(mousePosition + mOffsetToMouse); } } void AdornerMagnifyingGlass::updateImage(const QPoint &mousePosition) { QRect positionAroundMouse(QPoint(), mZoomInAreaSize); positionAroundMouse.moveCenter(mousePosition + mBackgroundOffset); auto zoomedInImage = mBackgroundWithMargine.copy(positionAroundMouse).scaled(mScaleFactor); QRect rectForFinalCut(mVisibleRect); rectForFinalCut.moveCenter(zoomedInImage.rect().center()); mImage = zoomedInImage.copy(rectForFinalCut); } QPixmap AdornerMagnifyingGlass::createBackgroundWithMagine(const QPixmap *background) const { QPixmap backgroundWithMargine(background->size() + mZoomInAreaSize); backgroundWithMargine.fill(Qt::black); QPainter painter(&backgroundWithMargine); painter.drawPixmap(mBackgroundOffset, *background); return backgroundWithMargine; } void AdornerMagnifyingGlass::updateCrossHair() { auto outerOffset = 20; auto innerOffset = 15; mCrossHairTop.setLine(mVisibleRect.center().x(), mVisibleRect.top() + outerOffset, mVisibleRect.center().x(), mVisibleRect.center().y() - innerOffset); mCrossHairBottom.setLine(mVisibleRect.center().x(), mVisibleRect.bottom() - outerOffset, mVisibleRect.center().x(), mVisibleRect.center().y() + innerOffset); mCrossHairLeft.setLine(mVisibleRect.left() + outerOffset, mVisibleRect.center().y(), mVisibleRect.center().x() - innerOffset, mVisibleRect.center().y()); mCrossHairRight.setLine(mVisibleRect.right() - outerOffset, mVisibleRect.center().y(), mVisibleRect.center().x() + innerOffset, mVisibleRect.center().y()); } bool AdornerMagnifyingGlass::isPositionTopRightFromMouse(const QPoint &mousePosition, const QRect &screenRect) const { return mousePosition.x() + mVisibleRect.width() < screenRect.width() && mousePosition.y() + mVisibleRect.height() > screenRect.height(); } bool AdornerMagnifyingGlass::isPositionBottomLeftFromMouse(const QPoint &mousePosition, const QRect &screenRect) const { return mousePosition.x() + mVisibleRect.width() > screenRect.width() && mousePosition.y() + mVisibleRect.height() < screenRect.height(); } bool AdornerMagnifyingGlass::isPositionTopLeftFromMouse(const QPoint &mousePosition, const QRect &screenRect) const { return mousePosition.x() + mVisibleRect.width() > screenRect.width() && mousePosition.y() + mVisibleRect.height() > screenRect.height(); } ksnip-1.9.2/src/gui/snippingArea/AdornerMagnifyingGlass.h000066400000000000000000000037341414701001100234040ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_ADORNERMAGNIFYINGGLASS_H #define KSNIP_ADORNERMAGNIFYINGGLASS_H #include class AdornerMagnifyingGlass { public: explicit AdornerMagnifyingGlass(); ~AdornerMagnifyingGlass(); void update(const QPoint &mousePosition, const QRect &screenRect); void paint(QPainter *painter, const QColor &color); void setBackgroundImage(const QPixmap *background); private: QPixmap mBackgroundWithMargine; QPixmap mImage; QRect mVisibleRect; QPoint mOffsetToMouse; QSize mScaleFactor; QSize mZoomInAreaSize; QPoint mBackgroundOffset; QLine mCrossHairTop; QLine mCrossHairBottom; QLine mCrossHairLeft; QLine mCrossHairRight; QPen *mCrossHairPen; void updateImage(const QPoint &mousePosition); void updateCrossHair(); bool isPositionTopLeftFromMouse(const QPoint &mousePosition, const QRect &screenRect) const; bool isPositionBottomLeftFromMouse(const QPoint &mousePosition, const QRect &screenRect) const; bool isPositionTopRightFromMouse(const QPoint &mousePosition, const QRect &screenRect) const; void updatePosition(const QPoint &mousePosition, const QRect &screenRect); QPixmap createBackgroundWithMagine(const QPixmap *background) const; }; #endif //KSNIP_ADORNERMAGNIFYINGGLASS_H ksnip-1.9.2/src/gui/snippingArea/AdornerPositionInfo.cpp000066400000000000000000000031441414701001100232700ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "AdornerPositionInfo.h" AdornerPositionInfo::AdornerPositionInfo() : mFontMetric(new QFontMetrics(mFont)), mPen(new QPen(Qt::red, 1)) { } AdornerPositionInfo::~AdornerPositionInfo() { delete mFontMetric; delete mPen; } void AdornerPositionInfo::update(const QPoint &mousePosition) { QPoint textOffset(10, 8); mText = QString::number(mousePosition.x()) + QLatin1String(", ") + QString::number(mousePosition.y()); mBox = mFontMetric->boundingRect(mText); mBox.moveTopLeft(mousePosition + textOffset); mTextRect = mBox; mBox.adjust(0, 0, 7, 4); mTextRect.adjust(-3, 0, 5, 0); } void AdornerPositionInfo::paint(QPainter *painter, const QColor &color) { mPen->setColor(color); painter->setPen(*mPen); painter->setBrush(QColor(0, 0, 0, 200)); painter->drawRoundedRect(mTextRect, 2, 2); painter->drawText(mBox, mText); } ksnip-1.9.2/src/gui/snippingArea/AdornerPositionInfo.h000066400000000000000000000023151414701001100227340ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_ADORNERPOSITIONINFO_H #define KSNIP_ADORNERPOSITIONINFO_H #include class AdornerPositionInfo { public: explicit AdornerPositionInfo(); ~AdornerPositionInfo(); void update(const QPoint &mousePosition); void paint(QPainter *painter, const QColor &color); private: QFont mFont; QFontMetrics *mFontMetric; QPen *mPen; QRect mBox; QRect mTextRect; QString mText; }; #endif //KSNIP_ADORNERPOSITIONINFO_H ksnip-1.9.2/src/gui/snippingArea/AdornerRulers.cpp000066400000000000000000000033301414701001100221210ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "AdornerRulers.h" AdornerRulers::AdornerRulers() : mPen(new QPen(Qt::red, 1, Qt::DotLine, Qt::SquareCap, Qt::MiterJoin)) { } AdornerRulers::~AdornerRulers() { delete mPen; } void AdornerRulers::update(const QPoint &mousePosition, const QRect &screenRect) { int offset = 4; mTopLine.setLine(mousePosition.x(), mousePosition.y() - offset, mousePosition.x(), screenRect.top()); mRightLine.setLine(mousePosition.x() + offset, mousePosition.y(), screenRect.right(), mousePosition.y()); mBottomLine.setLine(mousePosition.x(), mousePosition.y() + offset, mousePosition.x(), screenRect.bottom()); mLeftLine.setLine(mousePosition.x() - offset, mousePosition.y(), screenRect.left(), mousePosition.y()); } void AdornerRulers::paint(QPainter *painter, const QColor &color) { mPen->setColor(color); painter->setPen(*mPen); painter->drawLine(mTopLine); painter->drawLine(mRightLine); painter->drawLine(mBottomLine); painter->drawLine(mLeftLine); } ksnip-1.9.2/src/gui/snippingArea/AdornerRulers.h000066400000000000000000000022631414701001100215720ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_ADORNERRULERS_H #define KSNIP_ADORNERRULERS_H #include class AdornerRulers { public: explicit AdornerRulers(); ~AdornerRulers(); void update(const QPoint &mousePosition, const QRect &screenRect); void paint(QPainter *painter, const QColor &color); private: QPen *mPen; QLine mBottomLine; QLine mTopLine; QLine mLeftLine; QLine mRightLine; }; #endif //KSNIP_ADORNERRULERS_H ksnip-1.9.2/src/gui/snippingArea/AdornerSizeInfo.cpp000066400000000000000000000064241414701001100224020ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "AdornerSizeInfo.h" AdornerSizeInfo::AdornerSizeInfo() : mFontMetric(new QFontMetrics(mFont)), mSizeInfoPen(new QPen(Qt::red, 1)) { } AdornerSizeInfo::~AdornerSizeInfo() { delete mFontMetric; delete mSizeInfoPen; } void AdornerSizeInfo::update(const QRect &captureRect) { updateWidthInfo(captureRect); updateHeightInfo(captureRect); updateSizeInfoText(captureRect); } void AdornerSizeInfo::paint(QPainter *painter, const QColor &color) { mSizeInfoPen->setColor(color); painter->setBrush(Qt::NoBrush); painter->setPen(*mSizeInfoPen); painter->drawPath(mWidthInfo); painter->drawPath(mHeightInfo); painter->drawText(mWidthTextPosition, mWidthInfoText); painter->drawText(mHeightTextPosition, mHeightInfoText); } void AdornerSizeInfo::updateWidthInfo(const QRect &captureRect) { auto topLeft = captureRect.topLeft(); auto topRight = captureRect.topRight(); auto offsetLine = QPoint(0, 10); auto offsetBorderBottom = QPoint(0, 7); auto offsetBorderTop = QPoint(0, 13); QPainterPath newPath(topLeft - offsetBorderBottom); newPath.lineTo(topLeft - offsetBorderTop); newPath.lineTo(topLeft - offsetLine); newPath.lineTo(topRight - offsetLine); newPath.lineTo(topRight - offsetBorderTop); newPath.lineTo(topRight - offsetBorderBottom); mWidthInfo.swap(newPath); } void AdornerSizeInfo::updateHeightInfo(const QRect &captureRect) { auto topLeft = captureRect.topLeft(); auto bottomLeft = captureRect.bottomLeft(); auto offsetLine = QPoint(10, 0); auto offsetBorderLeft = QPoint(7, 0); auto offsetBorderRight = QPoint(13, 0); QPainterPath newPath(topLeft - offsetBorderLeft); newPath.lineTo(topLeft - offsetBorderRight); newPath.lineTo(topLeft - offsetLine); newPath.lineTo(bottomLeft - offsetLine); newPath.lineTo(bottomLeft - offsetBorderRight); newPath.lineTo(bottomLeft - offsetBorderLeft); mHeightInfo.swap(newPath); } void AdornerSizeInfo::updateSizeInfoText(const QRect &captureRect) { auto textOffset = 13; mWidthInfoText = QString::number(captureRect.width()); mHeightInfoText = QString::number(captureRect.height()); auto widthTextBoundingRect = mFontMetric->boundingRect(mWidthInfoText); auto heightTextBoundingRect = mFontMetric->boundingRect(mHeightInfoText); mWidthTextPosition.setX(captureRect.center().x() - widthTextBoundingRect.width() / 2); mWidthTextPosition.setY(captureRect.top() - textOffset); mHeightTextPosition.setX(captureRect.left() - textOffset - heightTextBoundingRect.width()); mHeightTextPosition.setY(captureRect.center().y() + heightTextBoundingRect.height() / 2); } ksnip-1.9.2/src/gui/snippingArea/AdornerSizeInfo.h000066400000000000000000000027341414701001100220470ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_ADORNERSIZEINFO_H #define KSNIP_ADORNERSIZEINFO_H #include #include class AdornerSizeInfo { public: explicit AdornerSizeInfo(); ~AdornerSizeInfo(); void update(const QRect &captureRect); void paint(QPainter *painter, const QColor &color); private: QFont mFont; QFontMetrics *mFontMetric; QPen *mSizeInfoPen; QPainterPath mWidthInfo; QPainterPath mHeightInfo; QPoint mWidthTextPosition; QPoint mHeightTextPosition; QString mWidthInfoText; QString mHeightInfoText; void updateWidthInfo(const QRect &captureRect); void updateHeightInfo(const QRect &captureRect); void updateSizeInfoText(const QRect &captureRect); }; #endif //KSNIP_ADORNERSIZEINFO_H ksnip-1.9.2/src/gui/snippingArea/MacSnippingArea.cpp000066400000000000000000000023541414701001100223400ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "MacSnippingArea.h" MacSnippingArea::MacSnippingArea() : AbstractSnippingArea() { setWindowFlags(windowFlags() | Qt::WindowFullscreenButtonHint); } QRect MacSnippingArea::selectedRectArea() const { return mHdpiScaler.scale(mCaptureArea); } void MacSnippingArea::setFullScreen() { setFixedSize(QDesktopWidget().size()); QWidget::showFullScreen(); } QRect MacSnippingArea::getSnippingAreaGeometry() const { return geometry(); }ksnip-1.9.2/src/gui/snippingArea/MacSnippingArea.h000066400000000000000000000024271414701001100220060ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_MACSNIPPINGAREA_H #define KSNIP_MACSNIPPINGAREA_H #include "AbstractSnippingArea.h" #include "src/common/platform/HdpiScaler.h" class MacSnippingArea : public AbstractSnippingArea { public: explicit MacSnippingArea(); ~MacSnippingArea() override = default; QRect selectedRectArea() const override; protected: void setFullScreen() override; QRect getSnippingAreaGeometry() const override; private: HdpiScaler mHdpiScaler; }; #endif //KSNIP_MACSNIPPINGAREA_H ksnip-1.9.2/src/gui/snippingArea/SnippingAreaAdorner.cpp000066400000000000000000000045561414701001100232400ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "SnippingAreaAdorner.h" SnippingAreaAdorner::SnippingAreaAdorner() : mMouseIsDown(false), mRulerEnabled(false), mPositionAndSizeInfoEnabled(false), mMagnifyingGlassEnabled(false) { } void SnippingAreaAdorner::setRulersEnabled(bool enabled) { mRulerEnabled = enabled; } void SnippingAreaAdorner::setPositionAndSizeInfoEnabled(bool enabled) { mPositionAndSizeInfoEnabled = enabled; } void SnippingAreaAdorner::setMagnifyingGlassEnabled(bool enabled) { mMagnifyingGlassEnabled = enabled; } void SnippingAreaAdorner::setIsMouseDown(bool isDown) { mMouseIsDown = isDown; } void SnippingAreaAdorner::setBackgroundImage(const QPixmap *background) { mMagnifyingGlass.setBackgroundImage(background); } void SnippingAreaAdorner::update(const QPoint &mousePosition, const QRect &screenRect, const QRect &captureRect) { if (mRulerEnabled && !mMouseIsDown) { mRulers.update(mousePosition, screenRect); } if (mPositionAndSizeInfoEnabled) { if (mMouseIsDown) { mSizeInfo.update(captureRect); } else { mPositionInfo.update(mousePosition); } } if (mMagnifyingGlassEnabled) { mMagnifyingGlass.update(mousePosition, screenRect); } } void SnippingAreaAdorner::paint(QPainter *painter, const QColor &adornerColor, const QColor &cursorColor) { if (mRulerEnabled && !mMouseIsDown) { mRulers.paint(painter, adornerColor); } if (mPositionAndSizeInfoEnabled) { if (mMouseIsDown) { mSizeInfo.paint(painter, adornerColor); } else { mPositionInfo.paint(painter, adornerColor); } } if (mMagnifyingGlassEnabled) { mMagnifyingGlass.paint(painter, cursorColor); } } ksnip-1.9.2/src/gui/snippingArea/SnippingAreaAdorner.h000066400000000000000000000034731414701001100227020ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_SNIPPINGAREAADORNER_H #define KSNIP_SNIPPINGAREAADORNER_H #include #include "AdornerMagnifyingGlass.h" #include "AdornerRulers.h" #include "AdornerPositionInfo.h" #include "AdornerSizeInfo.h" #include "src/common/helper/MathHelper.h" class SnippingAreaAdorner { public: explicit SnippingAreaAdorner(); ~SnippingAreaAdorner() = default; void setRulersEnabled(bool enabled); void setPositionAndSizeInfoEnabled(bool enabled); void setMagnifyingGlassEnabled(bool enabled); void setIsMouseDown(bool isDown); void setBackgroundImage(const QPixmap *background); void update(const QPoint &mousePosition, const QRect &screenRect, const QRect &captureRect); void paint(QPainter *painter, const QColor &adornerColor, const QColor &cursorColor); private: bool mRulerEnabled; bool mPositionAndSizeInfoEnabled; bool mMagnifyingGlassEnabled; bool mMouseIsDown; AdornerSizeInfo mSizeInfo; AdornerPositionInfo mPositionInfo; AdornerRulers mRulers; AdornerMagnifyingGlass mMagnifyingGlass; }; #endif //KSNIP_SNIPPINGAREAADORNER_H ksnip-1.9.2/src/gui/snippingArea/SnippingAreaResizer.cpp000066400000000000000000000155021414701001100232620ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "SnippingAreaResizer.h" SnippingAreaResizer::SnippingAreaResizer(KsnipConfig *config, QObject *parent) : QObject(parent), mConfig(config), mIsActive(false), mIsGrabbed(false), mGrabbedHandleIndex(-1), mControlPressed(false), mAltPressed(false) { const auto width = 15; mHandles.append(QRectF(0, 0, width, width)); mHandles.append(QRectF(0, 0, width, width)); mHandles.append(QRectF(0, 0, width, width)); mHandles.append(QRectF(0, 0, width, width)); mHandles.append(QRectF(0, 0, width, width)); mHandles.append(QRectF(0, 0, width, width)); mHandles.append(QRectF(0, 0, width, width)); mHandles.append(QRectF(0, 0, width, width)); } void SnippingAreaResizer::activate(const QRectF &rect, const QPointF &pos) { mIsActive = true; mCurrentRect = rect; mColor = mConfig->snippingAdornerColor(); updateHandlePositions(); updateCursor(pos.toPoint()); } void SnippingAreaResizer::deactivate() { mIsActive = false; mIsGrabbed = false; mGrabbedHandleIndex = -1; } void SnippingAreaResizer::paint(QPainter *painter) { if(mIsActive) { painter->setRenderHint(QPainter::Antialiasing); painter->setBrush(Qt::NoBrush); painter->setPen(QPen(mColor, 2, Qt::SolidLine, Qt::SquareCap, Qt::MiterJoin)); painter->drawRect(mCurrentRect); painter->setBrush(mColor); for(const auto handle : mHandles) { painter->drawEllipse(handle); } } } bool SnippingAreaResizer::isActive() const { return mIsActive; } void SnippingAreaResizer::handleMousePress(QMouseEvent *event) { if(mIsActive) { auto pos = event->pos(); for(const auto handle : mHandles) { if(handle.contains(pos)) { mIsGrabbed = true; mGrabOffset = pos - handle.center(); mGrabbedHandleIndex = mHandles.indexOf(handle); break; } } if(!mIsGrabbed && mCurrentRect.contains(pos)) { mIsGrabbed = true; mGrabOffset = pos - mCurrentRect.topLeft(); } } } void SnippingAreaResizer::handleMouseRelease(QMouseEvent *event) { Q_UNUSED(event) if(mIsActive && mIsGrabbed) { mIsGrabbed = false; mGrabOffset = {}; mGrabbedHandleIndex = -1; } } void SnippingAreaResizer::handleMouseMove(QMouseEvent *event) { if (mIsActive) { if (mIsGrabbed) { updateCurrentRect(event->pos()); } else { updateCursor(event->pos()); } } } void SnippingAreaResizer::handleKeyPress(QKeyEvent *event) { if (event->key() == Qt::Key_Control) { mControlPressed = true; } else if (event->key() == Qt::Key_Alt) { mAltPressed = true; } if (mIsActive) { arrowKeyPressed(event); notifyRectChanged(); } } void SnippingAreaResizer::arrowKeyPressed(const QKeyEvent *event) { if (event->key() == Qt::Key_Up) { arrowUpPressed(); } else if (event->key() == Qt::Key_Down) { arrowDownPressed(); } else if (event->key() == Qt::Key_Left) { arrowLeftPressed(); } else if (event->key() == Qt::Key_Right) { arrowRightPressed(); } } void SnippingAreaResizer::handleKeyRelease(QKeyEvent *event) { if(event->key() == Qt::Key_Control) { mControlPressed = false; } else if(event->key() == Qt::Key_Alt) { mAltPressed = false; } } void SnippingAreaResizer::updateCursor(const QPoint &pos) { if (mHandles[1].contains(pos) || mHandles[5].contains(pos)) { emit cursorChanged(Qt::SizeVerCursor); } else if (mHandles[3].contains(pos) || mHandles[7].contains(pos)) { emit cursorChanged(Qt::SizeHorCursor); } else if (mHandles[0].contains(pos) || mHandles[2].contains(pos) || mHandles[4].contains(pos) || mHandles[6].contains(pos) || mCurrentRect.contains(pos)) { emit cursorChanged(Qt::SizeAllCursor); } else { emit cursorChanged(Qt::ArrowCursor); } } void SnippingAreaResizer::updateCurrentRect(const QPoint &point) { if(mGrabbedHandleIndex == -1){ mCurrentRect.moveTo(point - mGrabOffset); } else if(mGrabbedHandleIndex == 0){ mCurrentRect.setTopLeft(point - mGrabOffset); } else if(mGrabbedHandleIndex == 1){ mCurrentRect.setTop((point - mGrabOffset).y()); } else if(mGrabbedHandleIndex == 2){ mCurrentRect.setTopRight(point - mGrabOffset); } else if(mGrabbedHandleIndex == 3){ mCurrentRect.setRight((point - mGrabOffset).x()); } else if(mGrabbedHandleIndex == 4){ mCurrentRect.setBottomRight(point - mGrabOffset); } else if(mGrabbedHandleIndex == 5){ mCurrentRect.setBottom((point - mGrabOffset).y()); } else if(mGrabbedHandleIndex == 6){ mCurrentRect.setBottomLeft(point - mGrabOffset); } else if(mGrabbedHandleIndex == 7){ mCurrentRect.setLeft((point - mGrabOffset).x()); } notifyRectChanged(); } void SnippingAreaResizer::notifyRectChanged() { updateHandlePositions(); emit rectChanged(mCurrentRect.normalized()); } void SnippingAreaResizer::updateHandlePositions() { mHandles[0].moveCenter(RectHelper::topLeft(mCurrentRect)); mHandles[1].moveCenter(RectHelper::top(mCurrentRect)); mHandles[2].moveCenter(RectHelper::topRight(mCurrentRect)); mHandles[3].moveCenter(RectHelper::right(mCurrentRect)); mHandles[4].moveCenter(RectHelper::bottomRight(mCurrentRect)); mHandles[5].moveCenter(RectHelper::bottom(mCurrentRect)); mHandles[6].moveCenter(RectHelper::bottomLeft(mCurrentRect)); mHandles[7].moveCenter(RectHelper::left(mCurrentRect)); } void SnippingAreaResizer::arrowRightPressed() { if (mControlPressed) { mCurrentRect.setLeft(mCurrentRect.left() + 1); } else if (mAltPressed) { mCurrentRect.setRight(mCurrentRect.right() + 1); } else { mCurrentRect.moveRight(mCurrentRect.right() + 1); } } void SnippingAreaResizer::arrowLeftPressed() { if (mControlPressed) { mCurrentRect.setLeft(mCurrentRect.left() - 1); } else if (mAltPressed) { mCurrentRect.setRight(mCurrentRect.right() - 1); } else { mCurrentRect.moveLeft(mCurrentRect.left() - 1); } } void SnippingAreaResizer::arrowDownPressed() { if (mControlPressed) { mCurrentRect.setTop(mCurrentRect.top() + 1); } else if (mAltPressed) { mCurrentRect.setBottom(mCurrentRect.bottom() + 1); } else { mCurrentRect.moveBottom(mCurrentRect.bottom() + 1); } } void SnippingAreaResizer::arrowUpPressed() { if (mControlPressed) { mCurrentRect.setTop(mCurrentRect.top() - 1); } else if (mAltPressed) { mCurrentRect.setBottom(mCurrentRect.bottom() - 1); } else { mCurrentRect.moveTop(mCurrentRect.top() - 1); } } ksnip-1.9.2/src/gui/snippingArea/SnippingAreaResizer.h000066400000000000000000000042651414701001100227330ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_SNIPPINGAREARESIZER_H #define KSNIP_SNIPPINGAREARESIZER_H #include #include #include #include #include #include "src/common/helper/RectHelper.h" #include "src/backend/config/KsnipConfig.h" class SnippingAreaResizer : public QObject { Q_OBJECT public: explicit SnippingAreaResizer(KsnipConfig *config, QObject *parent); ~SnippingAreaResizer() override = default; void activate(const QRectF &rect, const QPointF &pos); void deactivate(); void paint(QPainter *painter); bool isActive() const; void handleMousePress(QMouseEvent *event); void handleMouseRelease(QMouseEvent *event); void handleMouseMove(QMouseEvent *event); void handleKeyPress(QKeyEvent *event); void handleKeyRelease(QKeyEvent *event); signals: void rectChanged(const QRectF &rect); void cursorChanged(const QCursor &cursor); private: QRectF mCurrentRect; bool mIsActive; QPointF mGrabOffset; bool mIsGrabbed; int mGrabbedHandleIndex; QVector mHandles; KsnipConfig *mConfig; QColor mColor; bool mControlPressed; bool mAltPressed; void updateHandlePositions(); void updateCurrentRect(const QPoint &point); void updateCursor(const QPoint &pos); void notifyRectChanged(); void arrowUpPressed(); void arrowDownPressed(); void arrowLeftPressed(); void arrowRightPressed(); void arrowKeyPressed(const QKeyEvent *event); }; #endif //KSNIP_SNIPPINGAREARESIZER_H ksnip-1.9.2/src/gui/snippingArea/SnippingAreaResizerInfoText.cpp000066400000000000000000000027121414701001100247420ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "SnippingAreaResizerInfoText.h" SnippingAreaResizerInfoText::SnippingAreaResizerInfoText(QObject *parent) : AbstractSnippingAreaInfoText(parent) { } void SnippingAreaResizerInfoText::updateInfoText() { QStringList infoTextLines = { tr("Resize selected rect using the handles or move it by dragging the selection."), tr("Use arrow keys to move the selection."), tr("Use arrow keys while pressing CTRL to move top left handle."), tr("Use arrow keys while pressing ALT to move bottom right handle."), tr("Confirm selection by pressing ENTER/RETURN or abort by pressing ESC."), tr("This message can be disabled via settings.") }; setInfoText(infoTextLines); } ksnip-1.9.2/src/gui/snippingArea/SnippingAreaResizerInfoText.h000066400000000000000000000023011414701001100244010ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_SNIPPINGAREARESIZERINFOTEXT_H #define KSNIP_SNIPPINGAREARESIZERINFOTEXT_H #include "AbstractSnippingAreaInfoText.h" class SnippingAreaResizerInfoText : public AbstractSnippingAreaInfoText { Q_OBJECT public: explicit SnippingAreaResizerInfoText(QObject *parent); ~SnippingAreaResizerInfoText() override = default; protected: void updateInfoText() override; }; #endif //KSNIP_SNIPPINGAREARESIZERINFOTEXT_H ksnip-1.9.2/src/gui/snippingArea/SnippingAreaSelector.cpp000066400000000000000000000067541414701001100234300ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "SnippingAreaSelector.h" SnippingAreaSelector::SnippingAreaSelector(KsnipConfig *config, QObject *parent) : QObject(parent), mIsActive(false), mConfig(config), mCursorFactory(new CursorFactory), mIsMouseDown(false) { } SnippingAreaSelector::~SnippingAreaSelector() { delete mCursorFactory; } void SnippingAreaSelector::activate(const QRectF &snippingAreaGeometry, const QPointF &pos) { setupAdorner(); mIsActive = true; mSnippingAreaGeometry = snippingAreaGeometry; mAdornerColor = mConfig->snippingAdornerColor(); mCursorColor = mConfig->snippingCursorColor(); updateCurrentRect({}, pos); updateAdorner(pos); emit cursorChanged(mCursorFactory->createSnippingCursor()); } void SnippingAreaSelector::deactivate() { mIsActive = false; mIsMouseDown = false; mMouseDownPos = {}; } void SnippingAreaSelector::paint(QPainter *painter) { if(mIsActive) { mAdorner.paint(painter, mAdornerColor, mCursorColor); painter->setClipping(false); painter->setRenderHint(QPainter::Antialiasing, false); painter->setPen(mAdornerColor); painter->drawRect(mCurrentRect); } } void SnippingAreaSelector::setBackgroundImage(const QPixmap *background) { mAdorner.setBackgroundImage(background); } bool SnippingAreaSelector::isActive() const { return mIsActive; } void SnippingAreaSelector::handleMousePress(QMouseEvent *event) { if(mIsActive) { mMouseDownPos = event->pos(); setIsMouseDown(true); rectChanged(QRectF(mMouseDownPos, mMouseDownPos)); } } void SnippingAreaSelector::handleMouseRelease(QMouseEvent *event) { Q_UNUSED(event) if(mIsActive) { setIsMouseDown(false); } } void SnippingAreaSelector::handleMouseMove(QMouseEvent *event) { if(mIsActive) { const auto pos = event->pos(); if(mIsMouseDown) { const auto rect = QRectF(mMouseDownPos, pos).normalized(); updateCurrentRect(rect, pos); } updateAdorner(pos); } } void SnippingAreaSelector::updateAdorner(const QPointF &pos) { mAdorner.update(pos.toPoint(), mSnippingAreaGeometry.toRect(), mCurrentRect.toRect()); } void SnippingAreaSelector::updateCurrentRect(const QRectF &rect, const QPointF &pos) { mCurrentRect = rect; emit rectChanged(rect); } void SnippingAreaSelector::setupAdorner() { auto magnifyingGlassEnabled = mConfig->snippingAreaMagnifyingGlassEnabled(); auto freezeImageWhileSnippingEnabled = mConfig->freezeImageWhileSnippingEnabled(); mAdorner.setRulersEnabled(mConfig->snippingAreaRulersEnabled()); mAdorner.setPositionAndSizeInfoEnabled(mConfig->snippingAreaPositionAndSizeInfoEnabled()); mAdorner.setMagnifyingGlassEnabled(magnifyingGlassEnabled && freezeImageWhileSnippingEnabled); } void SnippingAreaSelector::setIsMouseDown(bool isMouseDown) { mIsMouseDown = isMouseDown; mAdorner.setIsMouseDown(isMouseDown); } ksnip-1.9.2/src/gui/snippingArea/SnippingAreaSelector.h000066400000000000000000000040531414701001100230630ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_SNIPPINGAREASELECTOR_H #define KSNIP_SNIPPINGAREASELECTOR_H #include #include #include "SnippingAreaAdorner.h" #include "src/backend/config/KsnipConfig.h" #include "src/widgets/CursorFactory.h" class SnippingAreaSelector : public QObject { Q_OBJECT public: explicit SnippingAreaSelector(KsnipConfig *config, QObject *parent); ~SnippingAreaSelector() override; void activate(const QRectF &snippingAreaGeometry, const QPointF &pos); void deactivate(); void paint(QPainter *painter); bool isActive() const; void handleMousePress(QMouseEvent *event); void handleMouseRelease(QMouseEvent *event); void handleMouseMove(QMouseEvent *event); void setBackgroundImage(const QPixmap *background); signals: void rectChanged(const QRectF &rect); void cursorChanged(const QCursor &cursor); private: QRectF mCurrentRect; bool mIsActive; KsnipConfig *mConfig; CursorFactory *mCursorFactory; SnippingAreaAdorner mAdorner; QPointF mMouseDownPos; bool mIsMouseDown; QRectF mSnippingAreaGeometry; QColor mAdornerColor; QColor mCursorColor; void setupAdorner(); void setIsMouseDown(bool isMouseDown); void updateCurrentRect(const QRectF &rect, const QPointF &pos); void updateAdorner(const QPointF &pos); }; #endif //KSNIP_SNIPPINGAREASELECTOR_H ksnip-1.9.2/src/gui/snippingArea/SnippingAreaSelectorInfoText.cpp000066400000000000000000000033641414701001100251030ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "SnippingAreaSelectorInfoText.h" SnippingAreaSelectorInfoText::SnippingAreaSelectorInfoText(QObject *parent) : AbstractSnippingAreaInfoText(parent), mIsResizingDefault(false) { } void SnippingAreaSelectorInfoText::updateInfoText() { auto resizeAfterSelection = tr("Hold CTRL pressed to resize selection after selecting."); auto dontResizeAfterSelection = tr("Hold CTRL pressed to prevent resizing after selecting."); QStringList infoTextLines = { tr("Click and Drag to select a rectangular area or press ESC to quit."), mIsResizingDefault ? dontResizeAfterSelection : resizeAfterSelection, tr("Operation will be canceled after 60 sec when no selection made."), tr("This message can be disabled via settings.") }; setInfoText(infoTextLines); } void SnippingAreaSelectorInfoText::activate(const QRectF &snippingAreaGeometry, bool isResizingDefault) { mIsResizingDefault = isResizingDefault; AbstractSnippingAreaInfoText::activate(snippingAreaGeometry); } ksnip-1.9.2/src/gui/snippingArea/SnippingAreaSelectorInfoText.h000066400000000000000000000024701414701001100245450ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_SNIPPINGAREASELECTORINFOTEXT_H #define KSNIP_SNIPPINGAREASELECTORINFOTEXT_H #include "AbstractSnippingAreaInfoText.h" class SnippingAreaSelectorInfoText : public AbstractSnippingAreaInfoText { Q_OBJECT public: explicit SnippingAreaSelectorInfoText(QObject *parent); ~SnippingAreaSelectorInfoText() override = default; void activate(const QRectF &snippingAreaGeometry, bool isResizingDefault); protected: void updateInfoText() override; private: bool mIsResizingDefault; }; #endif //KSNIP_SNIPPINGAREASELECTORINFOTEXT_H ksnip-1.9.2/src/gui/snippingArea/WaylandSnippingArea.cpp000066400000000000000000000021271414701001100232350ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "WaylandSnippingArea.h" WaylandSnippingArea::WaylandSnippingArea() : X11SnippingArea() { } QRect WaylandSnippingArea::selectedRectArea() const { return mHdpiScaler.scale(mCaptureArea); } void WaylandSnippingArea::grabKeyboardFocus() { QApplication::setActiveWindow(this); setFocus(); grabKeyboard(); } ksnip-1.9.2/src/gui/snippingArea/WaylandSnippingArea.h000066400000000000000000000022571414701001100227060ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_WAYLANDSNIPPINGAREA_H #define KSNIP_WAYLANDSNIPPINGAREA_H #include "X11SnippingArea.h" class WaylandSnippingArea : public X11SnippingArea { public: explicit WaylandSnippingArea(); ~WaylandSnippingArea() override = default; QRect selectedRectArea() const override; protected: void grabKeyboardFocus() override; private: HdpiScaler mHdpiScaler; }; #endif //KSNIP_WAYLANDSNIPPINGAREA_H ksnip-1.9.2/src/gui/snippingArea/WinSnippingArea.cpp000066400000000000000000000076051414701001100224010ustar00rootroot00000000000000/* * Copyright (C) 2018 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "WinSnippingArea.h" WinSnippingArea::WinSnippingArea() : AbstractSnippingArea(), mIsFullScreenSizeSet(false), mIsMultipleScaledScreens(false) { setWindowFlags(windowFlags() | Qt::Tool); connect(qGuiApp, &QGuiApplication::screenRemoved, this, &WinSnippingArea::init); connect(qGuiApp, &QGuiApplication::screenAdded, this, &WinSnippingArea::init); init(); } QRect WinSnippingArea::selectedRectArea() const { if(isBackgroundTransparent()) { auto topLeft = mapToGlobal(mCaptureArea.topLeft()); auto bottomRight = mapToGlobal(mCaptureArea.bottomRight()); return {topLeft, bottomRight}; } else if (mIsMultipleScaledScreens) { auto xWithOffset = mCaptureArea.x() - mScaleOffset.x(); auto yWithOffset = mCaptureArea.y() - mScaleOffset.y(); return mHdpiScaler.scale({xWithOffset, yWithOffset, mCaptureArea.width(), mCaptureArea.height()}); } else { return mHdpiScaler.scale(mCaptureArea); } } void WinSnippingArea::setFullScreen() { /* * Workaround for Qt HiDPI issue, setting geometry more then once * enlarges the widget outside the size of the visible desktop. See #668. * Qt behaves differently in case of one or multiple scaled screens so * we utilise here different 'hacks' to fix the different use cases. * This part just be checked after upgrading to newer Qt version if it * can be simplified again in case the issue was fixed from Qt side. * See bug https://bugreports.qt.io/browse/QTBUG-94638 */ if (mIsMultipleScaledScreens) { setGeometry(QApplication::desktop()->geometry()); QWidget::show(); setGeometry(QApplication::desktop()->geometry()); } else if (!mIsFullScreenSizeSet) { setGeometry(mFullScreenRect); mIsFullScreenSizeSet = true; } QWidget::show(); } QRect WinSnippingArea::getSnippingAreaGeometry() const { if(mIsMultipleScaledScreens) { return {mScaleOffset.x(), mScaleOffset.y(), mFullScreenRect.width() / 2, mFullScreenRect.height() / 2 }; } else { return {0, 0, geometry().width(), geometry().height() }; } } QPoint WinSnippingArea::getLocalCursorPosition() const { return mapFromGlobal(QCursor::pos()); } void WinSnippingArea::setupScalingVariables() { auto scaledScreens = 0; auto screens = QApplication::screens(); for(auto screen : screens) { auto screenGeometry = screen->geometry(); if(screen->devicePixelRatio() > 1) { scaledScreens++; } if (screenGeometry.x() != 0) { mScaleOffset.setX(screenGeometry.x()); } if (screenGeometry.y() != 0) { mScaleOffset.setY(screenGeometry.y()); } } mScaleOffset.setX((mScaleOffset.x() - mFullScreenRect.x()) / mHdpiScaler.scaleFactor()); mScaleOffset.setY((mScaleOffset.y() - mFullScreenRect.y()) / mHdpiScaler.scaleFactor()); mIsMultipleScaledScreens = scaledScreens > 1; } void WinSnippingArea::init() { mIsFullScreenSizeSet = false; mFullScreenRect = mWinWrapper.getFullScreenRect(); setupScalingVariables(); } ksnip-1.9.2/src/gui/snippingArea/WinSnippingArea.h000066400000000000000000000031211414701001100220330ustar00rootroot00000000000000/* * Copyright (C) 2018 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_WINSNIPPINGAREA_H #define KSNIP_WINSNIPPINGAREA_H #include "AbstractSnippingArea.h" #include "src/common/platform/HdpiScaler.h" #include "src/backend/imageGrabber/WinWrapper.h" class WinSnippingArea : public AbstractSnippingArea { public: explicit WinSnippingArea(); ~WinSnippingArea() override = default; QRect selectedRectArea() const override; protected: void setFullScreen() override; QRect getSnippingAreaGeometry() const override; QPoint getLocalCursorPosition() const override; private: QPoint mScaleOffset; QRect mFullScreenRect; HdpiScaler mHdpiScaler; WinWrapper mWinWrapper; bool mIsFullScreenSizeSet; bool mIsMultipleScaledScreens; void setupScalingVariables(); private slots: void init(); }; #endif //KSNIP_WINSNIPPINGAREA_H ksnip-1.9.2/src/gui/snippingArea/X11SnippingArea.cpp000066400000000000000000000034351414701001100222120ustar00rootroot00000000000000/* * Copyright (C) 2018 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "X11SnippingArea.h" X11SnippingArea::X11SnippingArea() : AbstractSnippingArea() { setWindowFlags(windowFlags() | Qt::Tool | Qt::X11BypassWindowManagerHint); calculateDesktopGeometry(); } QRect X11SnippingArea::selectedRectArea() const { if(isBackgroundTransparent()) { return mCaptureArea; } else { return mHdpiScaler.scale(mCaptureArea); } } void X11SnippingArea::setFullScreen() { setFixedSize(QDesktopWidget().size()); QWidget::showFullScreen(); } QRect X11SnippingArea::getSnippingAreaGeometry() const { return mDesktopGeometry; } void X11SnippingArea::calculateDesktopGeometry() { auto screens = QApplication::screens(); for(auto screen : screens) { auto scaleFactor = screen->devicePixelRatio(); auto screenGeometry = screen->geometry(); int x = screenGeometry.x() / scaleFactor; int y = screenGeometry.y() / scaleFactor; auto width = screenGeometry.width(); auto height = screenGeometry.height(); mDesktopGeometry = mDesktopGeometry.united({x, y, width, height}); } } ksnip-1.9.2/src/gui/snippingArea/X11SnippingArea.h000066400000000000000000000024701414701001100216550ustar00rootroot00000000000000/* * Copyright (C) 2018 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_X11SNIPPINGAREA_H #define KSNIP_X11SNIPPINGAREA_H #include "AbstractSnippingArea.h" #include "src/common/platform/HdpiScaler.h" class X11SnippingArea : public AbstractSnippingArea { public: explicit X11SnippingArea(); ~X11SnippingArea() override = default; QRect selectedRectArea() const override; protected: void setFullScreen() override; QRect getSnippingAreaGeometry() const override; private: QRect mDesktopGeometry; HdpiScaler mHdpiScaler; void calculateDesktopGeometry(); }; #endif //KSNIP_X11SNIPPINGAREA_H ksnip-1.9.2/src/gui/widgetVisibilityHandler/000077500000000000000000000000001414701001100210405ustar00rootroot00000000000000ksnip-1.9.2/src/gui/widgetVisibilityHandler/GnomeWaylandWidgetVisibilityHandler.cpp000066400000000000000000000023141414701001100306430ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "GnomeWaylandWidgetVisibilityHandler.h" GnomeWaylandWidgetVisibilityHandler::GnomeWaylandWidgetVisibilityHandler(QWidget *widget) : WidgetVisibilityHandler(widget) { } void GnomeWaylandWidgetVisibilityHandler::setVisible(bool isVisible) { mWidget->setVisible(isVisible); } void GnomeWaylandWidgetVisibilityHandler::showWidget() { mWidget->setWindowState(getSelectedWindowState()); mWidget->raise(); mWidget->show(); } ksnip-1.9.2/src/gui/widgetVisibilityHandler/GnomeWaylandWidgetVisibilityHandler.h000066400000000000000000000023601414701001100303110ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_GNOMEWAYLANDWIDGETVISIBILITYHANDLER_H #define KSNIP_GNOMEWAYLANDWIDGETVISIBILITYHANDLER_H #include "WidgetVisibilityHandler.h" class GnomeWaylandWidgetVisibilityHandler : public WidgetVisibilityHandler { public: explicit GnomeWaylandWidgetVisibilityHandler(QWidget *widget); ~GnomeWaylandWidgetVisibilityHandler() = default; void setVisible(bool isVisible) override; void showWidget() override; }; #endif //KSNIP_GNOMEWAYLANDWIDGETVISIBILITYHANDLER_H ksnip-1.9.2/src/gui/widgetVisibilityHandler/WidgetVisibilityHandler.cpp000066400000000000000000000052571414701001100263460ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "WidgetVisibilityHandler.h" WidgetVisibilityHandler::WidgetVisibilityHandler(QWidget *widget) : mWidget(widget), mSelectedWindowState(Qt::WindowActive), mWindowStateChangeLock(false), mIsMinimized(false), mIsHidden(false) { } void WidgetVisibilityHandler::hide() { mWidget->hide(); if(!mWindowStateChangeLock) { mIsHidden = true; } } void WidgetVisibilityHandler::makeInvisible() { mWindowStateChangeLock = true; setVisible(false); mWidget->showMinimized(); } void WidgetVisibilityHandler::show() { showWidget(); } void WidgetVisibilityHandler::minimize() { mWindowStateChangeLock = true; mIsMinimized = true; mWidget->showMinimized(); } void WidgetVisibilityHandler::restoreState() { setVisible(true); if(!mIsMinimized && !mIsHidden) { showWidget(); mIsHidden = false; } else if(!mIsMinimized && mIsHidden){ hide(); } else { mWidget->setWindowState(Qt::WindowMinimized); mIsHidden = false; } mWindowStateChangeLock = false; } void WidgetVisibilityHandler::enforceVisible() { setVisible(true); showWidget(); mIsHidden = false; mWindowStateChangeLock = false; } bool WidgetVisibilityHandler::isMaximized() { return mSelectedWindowState == Qt::WindowMaximized; } void WidgetVisibilityHandler::updateState() { if(!mWindowStateChangeLock) { if(mWidget->isMaximized()) { mSelectedWindowState = Qt::WindowMaximized; } else if(mWidget->isActiveWindow()){ mSelectedWindowState = Qt::WindowActive; } mIsMinimized = mWidget->isMinimized(); } } void WidgetVisibilityHandler::setVisible(bool isVisible) { if(isVisible) { mWidget->setWindowOpacity(1.0); } else { mWidget->setWindowOpacity(0.0); } } void WidgetVisibilityHandler::showWidget() { mWidget->setWindowState(getSelectedWindowState()); mWidget->activateWindow(); mWidget->raise(); mWidget->show(); } Qt::WindowState WidgetVisibilityHandler::getSelectedWindowState() const { return mSelectedWindowState; } ksnip-1.9.2/src/gui/widgetVisibilityHandler/WidgetVisibilityHandler.h000066400000000000000000000031021414701001100257760ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_WIDGETVISIBILITYHANDLER_H #define KSNIP_WIDGETVISIBILITYHANDLER_H #include #include "src/backend/config/KsnipConfig.h" class WidgetVisibilityHandler { public: explicit WidgetVisibilityHandler(QWidget *widget); ~WidgetVisibilityHandler() = default; virtual void hide(); virtual void makeInvisible(); virtual void show(); virtual void minimize(); virtual void restoreState(); virtual void enforceVisible(); virtual bool isMaximized(); virtual void updateState(); protected: QWidget *mWidget; virtual void setVisible(bool isVisible); virtual void showWidget(); Qt::WindowState getSelectedWindowState() const; private: bool mWindowStateChangeLock; bool mIsMinimized; bool mIsHidden; Qt::WindowState mSelectedWindowState; }; #endif //KSNIP_WIDGETVISIBILITYHANDLER_H ksnip-1.9.2/src/gui/widgetVisibilityHandler/WidgetVisibilityHandlerFactory.cpp000066400000000000000000000024031414701001100276640ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "WidgetVisibilityHandlerFactory.h" WidgetVisibilityHandler *WidgetVisibilityHandlerFactory::create(QWidget *widget) { #if defined(__APPLE__) || defined(_WIN32) return new WidgetVisibilityHandler(widget); #endif #if defined(UNIX_X11) auto platformChecker = PlatformChecker::instance(); if (platformChecker->isWayland() && platformChecker->isGnome()) { return new GnomeWaylandWidgetVisibilityHandler(widget); } else { return new WidgetVisibilityHandler(widget); } #endif } ksnip-1.9.2/src/gui/widgetVisibilityHandler/WidgetVisibilityHandlerFactory.h000066400000000000000000000023561414701001100273400ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_WIDGETVISIBILITYHANDLERRFACTORY_H #define KSNIP_WIDGETVISIBILITYHANDLERRFACTORY_H #if defined(__APPLE__) || defined(_WIN32) #include "WidgetVisibilityHandler.h" #endif #if defined(UNIX_X11) #include "GnomeWaylandWidgetVisibilityHandler.h" #include "src/common/platform/PlatformChecker.h" #endif class WidgetVisibilityHandlerFactory { public: static WidgetVisibilityHandler *create(QWidget *widget); }; #endif //KSNIP_WIDGETVISIBILITYHANDLERRFACTORY_H ksnip-1.9.2/src/gui/windowResizer/000077500000000000000000000000001414701001100170625ustar00rootroot00000000000000ksnip-1.9.2/src/gui/windowResizer/IResizableWindow.h000066400000000000000000000020551414701001100224560ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_IRESIZABLEWINDOW_H #define KSNIP_IRESIZABLEWINDOW_H class IResizableWindow { public: IResizableWindow() = default; ~IResizableWindow() = default; virtual void resizeToContent() = 0; virtual bool isWindowMaximized() = 0; }; #endif //KSNIP_IRESIZABLEWINDOW_H ksnip-1.9.2/src/gui/windowResizer/WindowResizer.cpp000066400000000000000000000031131414701001100223770ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "WindowResizer.h" WindowResizer::WindowResizer(IResizableWindow *resizableWindow, KsnipConfig *config, QObject *parent) : QObject(parent), mResizableWindow(resizableWindow), mConfig(config), mPerformedAutoResize(false), mResizeDelayInMs(50) { Q_ASSERT(mResizableWindow != nullptr); Q_ASSERT(mConfig != nullptr); } void WindowResizer::resize() { if(mResizableWindow->isWindowMaximized()) { return; } auto enforceAutoResize = mConfig->autoResizeToContent() || !mPerformedAutoResize; if (enforceAutoResize) { QTimer::singleShot(mConfig->resizeToContentDelay(), this, &WindowResizer::resizeWindow); } } void WindowResizer::resetAndResize() { mPerformedAutoResize = false; resize(); } void WindowResizer::resizeWindow() { mPerformedAutoResize = true; mResizableWindow->resizeToContent(); } ksnip-1.9.2/src/gui/windowResizer/WindowResizer.h000066400000000000000000000025361414701001100220540ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_WINDOWRESIZER_H #define KSNIP_WINDOWRESIZER_H #include #include #include "IResizableWindow.h" #include "src/backend/config/KsnipConfig.h" class WindowResizer : public QObject { public: WindowResizer(IResizableWindow *resizableWindow, KsnipConfig *config, QObject *parent); ~WindowResizer() override = default; void resize(); void resetAndResize(); private: IResizableWindow *mResizableWindow; KsnipConfig *mConfig; bool mPerformedAutoResize; int mResizeDelayInMs; private slots: void resizeWindow(); }; #endif //KSNIP_WINDOWRESIZER_H ksnip-1.9.2/src/logging/000077500000000000000000000000001414701001100150515ustar00rootroot00000000000000ksnip-1.9.2/src/logging/LogOutputHandler.cpp000066400000000000000000000026231414701001100210200ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "LogOutputHandler.h" void LogOutputHandler::handleOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg) { auto localMsg = msg.toLocal8Bit(); switch (type) { case QtDebugMsg: fprintf(stdout, "Debug: %s\n", localMsg.constData()); break; case QtInfoMsg: fprintf(stdout, "Info: %s\n", localMsg.constData()); break; case QtWarningMsg: fprintf(stderr, "Warning: %s\n", localMsg.constData()); break; case QtCriticalMsg: fprintf(stderr, "Critical: %s\n", localMsg.constData()); break; case QtFatalMsg: fprintf(stderr, "Fatal: %s\n", localMsg.constData()); break; } }ksnip-1.9.2/src/logging/LogOutputHandler.h000066400000000000000000000022161414701001100204630ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_LOGOUTPUTHANDLER_H #define KSNIP_LOGOUTPUTHANDLER_H #include #include #include class LogOutputHandler { public: static void handleOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg); private: LogOutputHandler() = default; ~LogOutputHandler() = default; }; #endif //KSNIP_LOGOUTPUTHANDLER_H ksnip-1.9.2/src/main.cpp000066400000000000000000000034421414701001100150560ustar00rootroot00000000000000/* * Copyright (C) 2017 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #if defined(_WIN32) && defined(QT_NO_DEBUG) // Prevent starting console in background under windows #pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup") #endif #include #include "BuildConfig.h" #include "src/bootstrapper/BootstrapperFactory.h" #include "src/logging/LogOutputHandler.h" int main(int argc, char** argv) { qInstallMessageHandler(LogOutputHandler::handleOutput); QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication app(argc, argv); app.setAttribute(Qt::AA_UseHighDpiPixmaps); app.setOrganizationName(QLatin1String("ksnip")); app.setOrganizationDomain(QLatin1String("ksnip.ksnip.org")); app.setApplicationName(QLatin1String("ksnip")); app.setApplicationVersion(QLatin1String(KSNIP_VERSION)); app.setDesktopFileName(QLatin1String("org.ksnip.ksnip.desktop")); app.setStyle(KsnipConfigProvider::instance()->applicationStyle()); BootstrapperFactory bootstrapperFactory; return bootstrapperFactory.create()->start(app); } ksnip-1.9.2/src/widgets/000077500000000000000000000000001414701001100150715ustar00rootroot00000000000000ksnip-1.9.2/src/widgets/CaptureModePicker.cpp000066400000000000000000000122541414701001100211470ustar00rootroot00000000000000/* * Copyright (C) 2018 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "CaptureModePicker.h" CaptureModePicker::CaptureModePicker(const QList &captureModes) { init(captureModes); setToolButtonStyle(Qt::ToolButtonTextBesideIcon); setButtonText(tr("New")); } void CaptureModePicker::setCaptureMode(CaptureModes mode) { for(auto action : mCaptureActions) { if (action->data().value() == mode) { setDefaultAction(action); mSelectedCaptureMode = mode; return; } } } CaptureModes CaptureModePicker::captureMode() const { return mSelectedCaptureMode; } void CaptureModePicker::init(const QList &captureModes) { auto menu = new CustomMenu(); if (isCaptureModeSupported(captureModes, CaptureModes::RectArea)) { auto action = createAction( EnumTranslator::instance()->toString(CaptureModes::RectArea), tr("Draw a rectangular area with your mouse"), QLatin1String("drawRect.svg"), CaptureModes::RectArea, QKeySequence(Qt::SHIFT + Qt::Key_R)); menu->addAction(action); } if (isCaptureModeSupported(captureModes, CaptureModes::LastRectArea)) { auto action = createAction( EnumTranslator::instance()->toString(CaptureModes::LastRectArea), tr("Capture a screenshot of the last selected rectangular area"), QLatin1String("lastRect.svg"), CaptureModes::LastRectArea, QKeySequence(Qt::SHIFT + Qt::Key_L)); menu->addAction(action); } if (isCaptureModeSupported(captureModes, CaptureModes::FullScreen)) { auto action = createAction( EnumTranslator::instance()->toString(CaptureModes::FullScreen), tr("Capture full screen including all monitors"), QLatin1String("fullScreen.svg"), CaptureModes::FullScreen, QKeySequence(Qt::SHIFT + Qt::Key_F)); menu->addAction(action); } if (isCaptureModeSupported(captureModes, CaptureModes::CurrentScreen)) { auto action = createAction( EnumTranslator::instance()->toString(CaptureModes::CurrentScreen), tr("Capture screen where the mouse is located"), QLatin1String("currentScreen.svg"), CaptureModes::CurrentScreen, QKeySequence(Qt::SHIFT + Qt::Key_M)); menu->addAction(action); } if (isCaptureModeSupported(captureModes, CaptureModes::ActiveWindow)) { auto action = createAction( EnumTranslator::instance()->toString(CaptureModes::ActiveWindow), tr("Capture window that currently has focus"), QLatin1String("activeWindow.svg"), CaptureModes::ActiveWindow, QKeySequence(Qt::SHIFT + Qt::Key_A)); menu->addAction(action); } if (isCaptureModeSupported(captureModes, CaptureModes::WindowUnderCursor)) { auto action = createAction( EnumTranslator::instance()->toString(CaptureModes::WindowUnderCursor), tr("Capture that is currently under the mouse cursor"), QLatin1String("windowUnderCursor.svg"), CaptureModes::WindowUnderCursor, QKeySequence(Qt::SHIFT + Qt::Key_U)); menu->addAction(action); } if (isCaptureModeSupported(captureModes, CaptureModes::Portal)) { auto action = createAction( EnumTranslator::instance()->toString(CaptureModes::Portal), tr("Uses the screenshot Portal for taking screenshot"), QLatin1String("wayland.svg"), CaptureModes::Portal, QKeySequence(Qt::SHIFT + Qt::Key_T)); menu->addAction(action); } if (!mCaptureActions.isEmpty()) { setDefaultAction(mCaptureActions.first()); } setMenu(menu); } bool CaptureModePicker::isCaptureModeSupported(const QList &captureModes, CaptureModes captureMode) const { return captureModes.contains(captureMode); } QAction *CaptureModePicker::createAction(const QString &text, const QString &tooltip, const QString &iconName, CaptureModes captureMode, const QKeySequence &shortcut) { auto action = new QAction(this); action->setIconText(text); action->setToolTip(tooltip); action->setIcon(IconLoader::loadForTheme(iconName)); action->setShortcut(shortcut); action->setData(static_cast(captureMode)); connect(action, &QAction::triggered, [this, captureMode]() { selectCaptureMode(captureMode); } ); mCaptureActions.append(action); return action; } void CaptureModePicker::selectCaptureMode(CaptureModes mode) { mSelectedCaptureMode = mode; emit captureModeSelected(mode); } QList CaptureModePicker::captureActions() const { return mCaptureActions; } ksnip-1.9.2/src/widgets/CaptureModePicker.h000066400000000000000000000035731414701001100206200ustar00rootroot00000000000000/* * Copyright (C) 2018 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_CAPTUREMODEPICKER_H #define KSNIP_CAPTUREMODEPICKER_H #include #include "src/widgets/CustomToolButton.h" #include "src/common/loader/IconLoader.h" #include "src/common/enum/CaptureModes.h" #include "src/common/helper/EnumTranslator.h" class CaptureModePicker : public CustomToolButton { Q_OBJECT public: explicit CaptureModePicker(const QList &captureModes); ~CaptureModePicker() override = default; void setCaptureMode(CaptureModes mode); CaptureModes captureMode() const; QList captureActions() const; signals: void captureModeSelected(CaptureModes mode) const; private: CaptureModes mSelectedCaptureMode; QList mCaptureActions; void init(const QList &captureModes); void selectCaptureMode(CaptureModes mode); QAction *createAction(const QString &text, const QString &tooltip, const QString &iconName, CaptureModes captureMode, const QKeySequence &shortcut); bool isCaptureModeSupported(const QList &captureModes, CaptureModes captureMode) const; }; #endif //KSNIP_CAPTUREMODEPICKER_H ksnip-1.9.2/src/widgets/ColorButton.cpp000066400000000000000000000046711414701001100200570ustar00rootroot00000000000000/* * Copyright (C) 2017 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "ColorButton.h" ColorButton::ColorButton(QWidget* parent) : QPushButton(parent), mShowAlphaChannel(false) { connect(this, &ColorButton::clicked, this, &ColorButton::openDialog); setIconSize(QSize(48, iconSize().height())); } QColor ColorButton::color() const { return mColor; } void ColorButton::setColor(const QColor& color) { mColor = color; auto pixmapIcon = createPixmapFromColor(mColor); setIcon(pixmapIcon); setToolTip(mShowAlphaChannel ? mColor.name(QColor::HexArgb) : mColor.name()); } void ColorButton::setShowAlphaChannel(bool enabled) { mShowAlphaChannel = enabled; } QPixmap ColorButton::createPixmapFromColor(const QColor& color) { QImage tiledBackground(QSize(10, 10), QImage::Format_ARGB32_Premultiplied); tiledBackground.fill(Qt::white); QPainter tiledBackgroundPainter(&tiledBackground); tiledBackgroundPainter.setPen(Qt::NoPen); tiledBackgroundPainter.setBrush(Qt::gray); tiledBackgroundPainter.drawRect(0, 0, 5, 5); tiledBackgroundPainter.drawRect(5, 5, 10, 10); QPixmap pixmap(iconSize()); QPainter pixmapPainter(&pixmap); pixmapPainter.setPen(Qt::gray); pixmapPainter.setBrush(tiledBackground); pixmapPainter.drawRect(0,0, iconSize().width() - 1, iconSize().height() - 1); pixmapPainter.setBrush(color); pixmapPainter.drawRect(0,0, iconSize().width() - 1, iconSize().height() - 1); return pixmap; } void ColorButton::openDialog() { QFlags options; if(mShowAlphaChannel) { options |= QColorDialog::ShowAlphaChannel; } auto color = QColorDialog::getColor(mColor, parentWidget(), QString(), options); if (color.isValid() && color != mColor) { setColor(color); } } ksnip-1.9.2/src/widgets/ColorButton.h000066400000000000000000000024551414701001100175220ustar00rootroot00000000000000/* * Copyright (C) 2017 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_COLORBUTTON_H #define KSNIP_COLORBUTTON_H #include #include #include class ColorButton : public QPushButton { Q_OBJECT public: explicit ColorButton(QWidget *parent); void setColor(const QColor &color); QColor color() const; void setShowAlphaChannel(bool enabled); private: QColor mColor; bool mShowAlphaChannel; QPixmap createPixmapFromColor(const QColor &color); private slots: void openDialog(); }; #endif // KSNIP_COLORBUTTON_H ksnip-1.9.2/src/widgets/CursorFactory.cpp000066400000000000000000000020401414701001100203760ustar00rootroot00000000000000/* * Copyright (C) 2017 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "CursorFactory.h" CursorFactory::CursorFactory() : mConfig(KsnipConfigProvider::instance()), mDefaultCursorSize(8) { } QCursor CursorFactory::createSnippingCursor() { return CustomCursor(mConfig->snippingCursorColor(), mConfig->snippingCursorSize()); } ksnip-1.9.2/src/widgets/CursorFactory.h000066400000000000000000000021041414701001100200440ustar00rootroot00000000000000/* * Copyright (C) 2017 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef CURSORFACTORY_H #define CURSORFACTORY_H #include "CustomCursor.h" #include "src/backend/config/KsnipConfigProvider.h" class CursorFactory { public: CursorFactory(); QCursor createSnippingCursor(); private: KsnipConfig *mConfig; int mDefaultCursorSize; }; #endif // CURSORFACTORY_H ksnip-1.9.2/src/widgets/CustomCursor.cpp000066400000000000000000000030431414701001100202450ustar00rootroot00000000000000/* * Copyright (C) 2016 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #include "CustomCursor.h" CustomCursor::CustomCursor() : QCursor() { } CustomCursor::CustomCursor(const QColor &color, int size) : QCursor(createCrossPixmap(color, size)) { } QPixmap CustomCursor::createCrossPixmap(const QColor& color, int size) { auto pixmap = createEmptyPixmap(); QPainter painter(&pixmap); painter.setPen(QPen(Qt::red, 1, Qt::SolidLine)); painter.drawPoint(16, 16); painter.setPen(QPen(color, size, Qt::SolidLine)); painter.drawLine(16, 12, 16, 0); painter.drawLine(16, 20, 16, 32); painter.drawLine(12, 16, 0, 16); painter.drawLine(20, 16, 32, 16); return pixmap; } QPixmap CustomCursor::createEmptyPixmap() { QPixmap pixmap(QSize(32, 32)); pixmap.fill(Qt::transparent); return pixmap; } ksnip-1.9.2/src/widgets/CustomCursor.h000066400000000000000000000022361414701001100177150ustar00rootroot00000000000000/* * Copyright (C) 2016 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef CUSTOMCURSOR_H #define CUSTOMCURSOR_H #include #include class CustomCursor : public QCursor { public: CustomCursor(); explicit CustomCursor(const QColor &color = nullptr, int size = 22); private: static QPixmap createCrossPixmap(const QColor &color, int size) ; static QPixmap createEmptyPixmap() ; }; #endif // CUSTOMCURSOR_H ksnip-1.9.2/src/widgets/CustomLineEdit.cpp000066400000000000000000000024201414701001100204630ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "CustomLineEdit.h" CustomLineEdit::CustomLineEdit(QWidget *parent) : QLineEdit(parent) { } QString CustomLineEdit::textOrPlaceholderText() const { auto currentText = text(); return currentText.isEmpty() ? placeholderText() : currentText; } void CustomLineEdit::setText(const QString &text) { if(text != placeholderText()) { QLineEdit::setText(text); } } void CustomLineEdit::setTextAndPlaceholderText(const QString &text) { setText(text); setPlaceholderText(text); } ksnip-1.9.2/src/widgets/CustomLineEdit.h000066400000000000000000000022501414701001100201310ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef CUSTOMLINEEDIT_H #define CUSTOMLINEEDIT_H #include class CustomLineEdit : public QLineEdit { Q_OBJECT public: explicit CustomLineEdit(QWidget *parent = nullptr); ~CustomLineEdit() override = default; QString textOrPlaceholderText() const; void setText(const QString &text); void setTextAndPlaceholderText(const QString &text); }; #endif //CUSTOMLINEEDIT_H ksnip-1.9.2/src/widgets/CustomSpinBox.cpp000066400000000000000000000025321414701001100203540ustar00rootroot00000000000000/* * Copyright (C) 2016 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #include "CustomSpinBox.h" CustomSpinBox::CustomSpinBox(int min, int max, QWidget* parent) : QSpinBox(parent) { setMinimum(min); setMaximum(max); setWrapping(false); connect(this, static_cast(&QSpinBox::valueChanged), this, &CustomSpinBox::valueChanged); } int CustomSpinBox::value() const { return QSpinBox::value(); } void CustomSpinBox::setValue(int value) { // Don't emit valueChanged signal values set via this method blockSignals(true); QSpinBox::setValue(value); blockSignals(false); } ksnip-1.9.2/src/widgets/CustomSpinBox.h000066400000000000000000000021651414701001100200230ustar00rootroot00000000000000/* * Copyright (C) 2016 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef CUSTOMSPINBOX_H #define CUSTOMSPINBOX_H #include class CustomSpinBox : public QSpinBox { Q_OBJECT public: explicit CustomSpinBox(int min = 1, int max = 100, QWidget *widget = nullptr); int value() const; void setValue(int value); signals: void valueChanged(int); }; #endif // CUSTOMSPINBOX_H ksnip-1.9.2/src/widgets/CustomToolButton.cpp000066400000000000000000000044611414701001100211060ustar00rootroot00000000000000/* * Copyright (C) 2016 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #include "CustomToolButton.h" CustomToolButton::CustomToolButton(QWidget* parent) : QToolButton(parent) { setPopupMode(QToolButton::MenuButtonPopup); connect(this, &CustomToolButton::triggered, this, &CustomToolButton::setDefaultAction); } // // Public Functions // /* * Function used to set main button text, overriding the usual behavior where * the text of the selected action is set. */ void CustomToolButton::setButtonText(const QString& text) { mButtonText = text; refreshText(); } // // Public Slots // /* * Overriding setDefaultAction function to prevent changing of text when a new * action is selected, the main text on the button is supposed to stay the same. */ void CustomToolButton::setDefaultAction(QAction* action) { QToolButton::setDefaultAction(action); refreshText(); } void CustomToolButton::trigger() { if (defaultAction() != nullptr) { defaultAction()->trigger(); } } void CustomToolButton::refreshText() { QToolButton::setText(mButtonText); } CustomMenu::CustomMenu(QWidget* parent) : QMenu(parent) { if (auto p = dynamic_cast(parent)) { connect(this, &CustomMenu::triggered, p, &CustomToolButton::setDefaultAction); } } void CustomMenu::showEvent(QShowEvent* event) { QMenu::showEvent(event); // Workaround for Qt bug where on first time opening the button text is // changed to the default action, introduced with Qt5 if (auto p = dynamic_cast(parent())) { p->refreshText(); } } ksnip-1.9.2/src/widgets/CustomToolButton.h000066400000000000000000000026051414701001100205510ustar00rootroot00000000000000/* * Copyright (C) 2016 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef CUSTOMTOOLBUTTON_H #define CUSTOMTOOLBUTTON_H #include #include #include class CustomToolButton : public QToolButton { Q_OBJECT public: explicit CustomToolButton(QWidget *parent = 0); void setButtonText(const QString &text); public slots: void setDefaultAction(QAction *action); void trigger(); void refreshText(); private: QString mButtonText; }; class CustomMenu : public QMenu { public: CustomMenu(QWidget *parent = nullptr); protected: virtual void showEvent(QShowEvent *event) override; }; #endif // CUSTOMTOOLBUTTON_H ksnip-1.9.2/src/widgets/KeySequenceLineEdit.cpp000066400000000000000000000072231414701001100214400ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "KeySequenceLineEdit.h" KeySequenceLineEdit::KeySequenceLineEdit(QWidget *widget, const QList &allowedKeys) : QLineEdit(widget) { mAllowedKeys = allowedKeys; } KeySequenceLineEdit::~KeySequenceLineEdit() { mSpecialKeyFilters.clear(); } void KeySequenceLineEdit::keyPressEvent(QKeyEvent *event) { mModifiers = event->modifiers(); mKey = getAllowedKey(event); updateKeySequence(); } Qt::Key KeySequenceLineEdit::getAllowedKey(const QKeyEvent *event) const { return mAllowedKeys.contains(static_cast(event->key())) ? static_cast(event->key()) : Qt::Key_unknown; } void KeySequenceLineEdit::updateKeySequence() { mKeySequence = mKey == Qt::Key_unknown ? QKeySequence(mModifiers) : QKeySequence(mModifiers + mKey); updateText(); } void KeySequenceLineEdit::keyReleaseEvent(QKeyEvent *event) { mModifiers = Qt::NoModifier; mKey = Qt::Key_unknown; QWidget::keyReleaseEvent(event); } void KeySequenceLineEdit::updateText() { setText(mKeySequence.toString()); } QKeySequence KeySequenceLineEdit::value() const { return mKeySequence; } void KeySequenceLineEdit::clear() { mKeySequence = QKeySequence(); updateText(); } void KeySequenceLineEdit::setValue(const QKeySequence &keySequence) { mKeySequence = keySequence; updateText(); } void KeySequenceLineEdit::focusInEvent(QFocusEvent *event) { setupSpecialKeyHandling(); QLineEdit::focusInEvent(event); } void KeySequenceLineEdit::focusOutEvent(QFocusEvent *event) { removeSpecialKeyHandler(); QLineEdit::focusOutEvent(event); } void KeySequenceLineEdit::removeSpecialKeyHandler() { for(const auto& keyFilter : mSpecialKeyFilters) { QApplication::instance()->removeNativeEventFilter(keyFilter.data()); } mSpecialKeyFilters.clear(); } void KeySequenceLineEdit::keyPressed(Qt::Key key) { mKey = key; updateKeySequence(); } void KeySequenceLineEdit::setupSpecialKeyHandling() { addSpecialKeyHandler(Qt::Key_Print, Qt::Key_Print); addSpecialKeyHandler(Qt::CTRL + Qt::Key_Print, Qt::Key_Print); addSpecialKeyHandler(Qt::ALT + Qt::Key_Print, Qt::Key_Print); addSpecialKeyHandler(Qt::SHIFT + Qt::Key_Print, Qt::Key_Print); addSpecialKeyHandler(Qt::CTRL + Qt::ALT + Qt::Key_Print, Qt::Key_Print); addSpecialKeyHandler(Qt::CTRL + Qt::SHIFT + Qt::Key_Print, Qt::Key_Print); addSpecialKeyHandler(Qt::ALT + Qt::SHIFT + Qt::Key_Print, Qt::Key_Print); addSpecialKeyHandler(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_Print, Qt::Key_Print); } void KeySequenceLineEdit::addSpecialKeyHandler(const QKeySequence &keySequence, Qt::Key key) { auto keyHandler = KeyHandlerFactory::create(); keyHandler->registerKey(keySequence); auto keyFilter = QSharedPointer(new NativeKeyEventFilter(keyHandler)); connect(keyFilter.data(), &NativeKeyEventFilter::triggered, [this, key]() { keyPressed(key); }); mSpecialKeyFilters.append(keyFilter); QApplication::instance()->installNativeEventFilter(keyFilter.data()); } ksnip-1.9.2/src/widgets/KeySequenceLineEdit.h000066400000000000000000000040001414701001100210730ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_KEYSEQUENCELINEEDIT_H #define KSNIP_KEYSEQUENCELINEEDIT_H #include #include #include #include #include "src/gui/globalHotKeys/KeyHandlerFactory.h" #include "src/gui/globalHotKeys/NativeKeyEventFilter.h" class KeySequenceLineEdit : public QLineEdit { Q_OBJECT public: explicit KeySequenceLineEdit(QWidget *widget, const QList &allowedKeys); ~KeySequenceLineEdit() override; QKeySequence value() const; void setValue(const QKeySequence &keySequence); void clear(); protected: void keyPressEvent(QKeyEvent *event) override; void keyReleaseEvent(QKeyEvent *event) override; void focusInEvent(QFocusEvent *event) override; void focusOutEvent(QFocusEvent *event) override; private: QKeySequence mKeySequence; Qt::KeyboardModifiers mModifiers; Qt::Key mKey; QList mAllowedKeys; QList> mSpecialKeyFilters; void updateText(); void keyPressed(Qt::Key key); void setupSpecialKeyHandling(); void updateKeySequence(); void addSpecialKeyHandler(const QKeySequence &keySequence, Qt::Key key); Qt::Key getAllowedKey(const QKeyEvent *event) const; void removeSpecialKeyHandler(); }; #endif //KSNIP_KEYSEQUENCELINEEDIT_H ksnip-1.9.2/src/widgets/MainToolBar.cpp000066400000000000000000000150201414701001100177420ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #include "MainToolBar.h" MainToolBar::MainToolBar(const QList &captureModes, QAction* undoAction, QAction* redoAction) : QToolBar(), mSaveButton(new QToolButton(this)), mCopyButton(new QToolButton(this)), mCropButton(new QToolButton(this)), mUndoButton(new QToolButton(this)), mRedoButton(new QToolButton(this)), mCaptureModePicker(new CaptureModePicker(captureModes)), mDelayPicker(new CustomSpinBox(0,100)), mDelayLabel(new QLabel), mNewCaptureAction(new QAction(this)), mSaveAction(new QAction(this)), mCopyAction(new QAction(this)), mCropAction(new QAction(this)), mUndoAction(undoAction), mRedoAction(redoAction) { connect(mCaptureModePicker, &CaptureModePicker::captureModeSelected, this, &MainToolBar::captureModeSelected); setStyleSheet(QLatin1String("QToolBar { border: 0px }")); mNewCaptureAction->setText(tr("New")); mNewCaptureAction->setShortcut(QKeySequence::New); connect(mNewCaptureAction, &QAction::triggered, this, &MainToolBar::newCaptureTriggered); mSaveButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); mSaveButton->addAction(mSaveAction); mSaveButton->setDefaultAction(mSaveAction); mCopyButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); mCopyButton->addAction(mCopyAction); mCopyButton->setDefaultAction(mCopyAction); mUndoButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); mUndoButton->addAction(mUndoAction); mUndoButton->setDefaultAction(mUndoAction); mRedoButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); mRedoButton->addAction(mRedoAction); mRedoButton->setDefaultAction(mRedoAction); mCropButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); mCropButton->addAction(mCropAction); mCropButton->setDefaultAction(mCropAction); auto clockIcon = IconLoader::loadForTheme(QLatin1String("clock.svg")); auto clockPixmap = clockIcon.pixmap(ScaledSizeProvider::scaledSize(QSize(24, 24))); mDelayLabel->setPixmap(clockPixmap); mDelayLabel->setContentsMargins(0, 0, 2, 0); mDelayLabel->setToolTip(tr("Delay in seconds between triggering\n" "and capturing screenshot.")); mDelayPicker->setSuffix(tr("s")); mDelayPicker->setFixedWidth(ScaledSizeProvider::scaledWidth(55)); mDelayPicker->setToolTip(mDelayLabel->toolTip()); connect(mDelayPicker, &CustomSpinBox::valueChanged, this, &MainToolBar::captureDelayChanged); mSaveAction->setText(tr("Save")); mSaveAction->setToolTip(tr("Save Screen Capture to file system")); mSaveAction->setIcon(IconLoader::loadForTheme(QLatin1String("save.svg"))); mSaveAction->setShortcut(QKeySequence::Save); connect(mSaveAction, &QAction::triggered, this, &MainToolBar::saveActionTriggered); mCopyAction->setText(tr("Copy")); mCopyAction->setToolTip(tr("Copy Screen Capture to clipboard")); mCopyAction->setIcon(IconLoader::loadForTheme(QLatin1String("copy.svg"))); mCopyAction->setShortcut(QKeySequence::Copy); connect(mCopyAction, &QAction::triggered, this, &MainToolBar::copyActionTriggered); mUndoAction->setIcon(IconLoader::loadForTheme(QLatin1String("undo.svg")));; mUndoAction->setText(tr("Undo")); mUndoAction->setShortcut(QKeySequence::Undo); mRedoAction->setIcon(IconLoader::loadForTheme(QLatin1String("redo.svg"))); mRedoAction->setText(tr("Redo")); mRedoAction->setShortcut(QKeySequence::Redo); mCropAction->setText(tr("Crop")); mCropAction->setToolTip(tr("Crop Screen Capture")); mCropAction->setIcon(IconLoader::loadForTheme(QLatin1String("crop.svg"))); mCropAction->setShortcut(Qt::SHIFT + Qt::Key_C); connect(mCropAction, &QAction::triggered, this, &MainToolBar::cropActionTriggered); setWindowTitle(tr("Tools")); setFloatable(false); setMovable(false); setAllowedAreas(Qt::BottomToolBarArea); addWidget(mCaptureModePicker); addSeparator(); addWidget(mSaveButton); addWidget(mCopyButton); addWidget(mUndoButton); addWidget(mRedoButton); addSeparator(); addWidget(mCropButton); addSeparator(); addWidget(mDelayLabel); addWidget(mDelayPicker); setFixedSize(sizeHint()); } MainToolBar::~MainToolBar() { delete mCaptureModePicker; delete mSaveButton; delete mCopyButton; delete mCropButton; delete mUndoButton; delete mRedoButton; delete mCaptureModePicker; delete mDelayPicker; delete mNewCaptureAction; delete mSaveAction; delete mCopyAction; delete mCropAction; delete mUndoAction; delete mRedoAction; } void MainToolBar::selectCaptureMode(CaptureModes captureModes) { mCaptureModePicker->setCaptureMode(captureModes); } void MainToolBar::setCaptureDelay(int delay) { mDelayPicker->setValue(delay); } void MainToolBar::newCaptureTriggered() { mCaptureModePicker->trigger(); } void MainToolBar::setSaveActionEnabled(bool enabled) { mSaveAction->setEnabled(enabled); } void MainToolBar::setCopyActionEnabled(bool enabled) { mCopyAction->setEnabled(enabled); } void MainToolBar::setCropEnabled(bool enabled) { mCropAction->setEnabled(enabled); } QAction *MainToolBar::newCaptureAction() const { return mNewCaptureAction; } QAction *MainToolBar::saveAction() const { return mSaveAction; } QAction *MainToolBar::copyToClipboardAction() const { return mCopyAction; } QAction *MainToolBar::cropAction() const { return mCropAction; } QAction *MainToolBar::undoAction() const { return mUndoAction; } QAction *MainToolBar::redoAction() const { return mRedoAction; } QList MainToolBar::captureActions() const { return mCaptureModePicker->captureActions(); } void MainToolBar::setCollapsed(bool isCollapsed) { isCollapsed ? setFixedSize(0, 0) : setFixedSize(sizeHint()); } bool MainToolBar::isCollapsed() const { return size() != sizeHint(); } ksnip-1.9.2/src/widgets/MainToolBar.h000066400000000000000000000047151414701001100174200ustar00rootroot00000000000000/* * Copyright (C) 2019 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef KSNIP_MAINTOOLBAR_H #define KSNIP_MAINTOOLBAR_H #include #include #include #include "CaptureModePicker.h" #include "CustomSpinBox.h" #include "src/common/provider/ScaledSizeProvider.h" class MainToolBar : public QToolBar { Q_OBJECT public: explicit MainToolBar(const QList &captureModes, QAction* undoAction, QAction* redoAction); ~MainToolBar() override; void selectCaptureMode(CaptureModes captureModes); void setCaptureDelay(int delay); void setSaveActionEnabled(bool enabled); void setCopyActionEnabled(bool enabled); void setCropEnabled(bool enabled); QAction* newCaptureAction() const; QAction* saveAction() const; QAction* copyToClipboardAction() const; QAction* cropAction() const; QAction* undoAction() const; QAction* redoAction() const; QList captureActions() const; void setCollapsed(bool isCollapsed); bool isCollapsed() const; signals: void captureModeSelected(CaptureModes mode) const; void saveActionTriggered() const; void copyActionTriggered() const; void captureDelayChanged(int delay) const; void cropActionTriggered() const; public slots: void newCaptureTriggered(); private: QToolButton *mSaveButton; QToolButton *mCopyButton; QToolButton *mCropButton; QToolButton *mUndoButton; QToolButton *mRedoButton; CaptureModePicker *mCaptureModePicker; CustomSpinBox *mDelayPicker; QLabel *mDelayLabel; QAction *mNewCaptureAction; QAction *mSaveAction; QAction *mCopyAction; QAction *mCropAction; QAction *mUndoAction; QAction *mRedoAction; }; #endif //KSNIP_MAINTOOLBAR_H ksnip-1.9.2/src/widgets/NumericComboBox.cpp000066400000000000000000000026131414701001100206320ustar00rootroot00000000000000/* * Copyright (C) 2016 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #include "NumericComboBox.h" NumericComboBox::NumericComboBox(int start, int increment, int steps, QWidget* parent) : QComboBox(parent) { populateList(start, increment, steps); } // // Public Functions // int NumericComboBox::value() const { return itemData(currentIndex()).toInt(); } void NumericComboBox::setValue(int value) { setCurrentIndex(findData(value)); } // // Private Functions // void NumericComboBox::populateList(int start, int increment, int steps) { for (auto i = 0; i < steps; i++) { addItem(QString::number(start + i * increment), start + i * increment); } } ksnip-1.9.2/src/widgets/NumericComboBox.h000066400000000000000000000022341414701001100202760ustar00rootroot00000000000000/* * Copyright (C) 2016 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef NUMERICCOMBOBOX_H #define NUMERICCOMBOBOX_H #include class NumericComboBox : public QComboBox { Q_OBJECT public: NumericComboBox(int start, int increment, int steps, QWidget *widget = 0); int value() const; void setValue(int value); private: void populateList(int start, int increment, int steps); }; #endif // NUMERICCOMBOBOX_H ksnip-1.9.2/tests/000077500000000000000000000000001414701001100137765ustar00rootroot00000000000000ksnip-1.9.2/tests/CMakeLists.txt000066400000000000000000000044671414701001100165510ustar00rootroot00000000000000set(UNITTEST_SRC ${CMAKE_CURRENT_SOURCE_DIR}/backend/recentImages/RecentImagesPathStoreTests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/common/helper/PathHelperTests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/gui/actions/ActionTest.cpp ${CMAKE_CURRENT_SOURCE_DIR}/gui/actions/ActionProcessorTest.cpp ${CMAKE_CURRENT_SOURCE_DIR}/gui/captureHandler/MultiCaptureHandlerTests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/gui/captureHandler/SingleCaptureHandlerTests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/gui/operations/DeleteImageOperationTests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/gui/operations/LoadImageFromFileOperationTests.cpp ) set(TESTUTILS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/utils/CallCounter.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mocks/CaptureTabStateHandlerMock.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mocks/ImageAnnotatorMock.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mocks/ClipboardMock.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mocks/DesktopServiceMock.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mocks/MessageBoxServiceMock.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mocks/FileServiceMock.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mocks/ServiceLocatorMock.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mocks/ImagePathStorageMock.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mocks/ToastServiceMock.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mocks/RecentImageServiceMock.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mocks/ImageProcessorMock.cpp ) add_library(KSNIP_STATIC STATIC ${KSNIP_SRCS}) target_link_libraries(KSNIP_STATIC Qt5::Widgets Qt5::Network Qt5::Xml Qt5::PrintSupport Qt5::DBus kImageAnnotator::kImageAnnotator kColorPicker::kColorPicker Qt5::Svg ) if (APPLE) target_link_libraries(KSNIP_STATIC "-framework CoreGraphics") elseif (UNIX) target_link_libraries(KSNIP_STATIC Qt5::X11Extras XCB::XFIXES ) # X11::X11 imported target only available with sufficiently new CMake if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.14.0) target_link_libraries(KSNIP_STATIC X11::X11) else() target_link_libraries(KSNIP_STATIC X11) endif() target_compile_definitions(KSNIP_STATIC PRIVATE UNIX_X11) elseif(WIN32) target_link_libraries(KSNIP_STATIC Qt5::WinExtras Dwmapi ) endif () foreach (UnitTest ${UNITTEST_SRC}) get_filename_component(UnitTestName ${UnitTest} NAME_WE) add_executable(${UnitTestName} ${UnitTest} ${TESTUTILS_SRC}) target_link_libraries(${UnitTestName} KSNIP_STATIC Qt5::Test) add_test(${UnitTestName} ${UnitTestName}) endforeach (UnitTest) ksnip-1.9.2/tests/backend/000077500000000000000000000000001414701001100153655ustar00rootroot00000000000000ksnip-1.9.2/tests/backend/recentImages/000077500000000000000000000000001414701001100177735ustar00rootroot00000000000000ksnip-1.9.2/tests/backend/recentImages/RecentImagesPathStoreTests.cpp000066400000000000000000000137131414701001100257270ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "RecentImagesPathStoreTests.h" #include "src/backend/recentImages/RecentImagesPathStore.h" #include "tests/mocks/ImagePathStorageMock.h" void RecentImagesPathStoreTests::GetRecentImagesPath_Should_ReturnEmptyStringList_When_Initialized() { // arrange auto imagePathStorageMock = new ImagePathStorageMock; RecentImagesPathStore recentImagesPathStore(imagePathStorageMock); // act auto recentImagesPath = recentImagesPathStore.getRecentImagesPath(); // assert QCOMPARE(recentImagesPath.size(), 0); } void RecentImagesPathStoreTests::GetRecentImagesPath_Should_ReturnNonEmptyStringList_When_ImagesAreStored() { // arrange auto imagePathStorageMock = new ImagePathStorageMock; RecentImagesPathStore recentImagesPathStore(imagePathStorageMock); recentImagesPathStore.storeImagePath("/path/image.png"); recentImagesPathStore.storeImagePath("/path/image2.png"); // act auto recentImagesPath = recentImagesPathStore.getRecentImagesPath(); // assert QCOMPARE(recentImagesPath.size(), 2); QCOMPARE(recentImagesPath.at(0), QStringLiteral("/path/image2.png")); QCOMPARE(recentImagesPath.at(1), QStringLiteral("/path/image.png")); } void RecentImagesPathStoreTests::GetRecentImagesPath_Should_ReturnListOfEntriesInReversedOrder() { // arrange auto imagePathStorageMock = new ImagePathStorageMock; RecentImagesPathStore recentImagesPathStore(imagePathStorageMock); recentImagesPathStore.storeImagePath("/path/image1.png"); recentImagesPathStore.storeImagePath("/path/image2.png"); recentImagesPathStore.storeImagePath("/path/image3.png"); recentImagesPathStore.storeImagePath("/path/image4.png"); recentImagesPathStore.storeImagePath("/path/image5.png"); recentImagesPathStore.storeImagePath("/path/image6.png"); recentImagesPathStore.storeImagePath("/path/image7.png"); recentImagesPathStore.storeImagePath("/path/image8.png"); recentImagesPathStore.storeImagePath("/path/image9.png"); recentImagesPathStore.storeImagePath("/path/image10.png"); // act auto recentImagesPath = recentImagesPathStore.getRecentImagesPath(); // assert QCOMPARE(recentImagesPath.size(), 10); QCOMPARE(recentImagesPath[0], QStringLiteral("/path/image10.png")); QCOMPARE(recentImagesPath[1], QStringLiteral("/path/image9.png")); QCOMPARE(recentImagesPath[2], QStringLiteral("/path/image8.png")); QCOMPARE(recentImagesPath[3], QStringLiteral("/path/image7.png")); QCOMPARE(recentImagesPath[4], QStringLiteral("/path/image6.png")); QCOMPARE(recentImagesPath[5], QStringLiteral("/path/image5.png")); QCOMPARE(recentImagesPath[6], QStringLiteral("/path/image4.png")); QCOMPARE(recentImagesPath[7], QStringLiteral("/path/image3.png")); QCOMPARE(recentImagesPath[8], QStringLiteral("/path/image2.png")); QCOMPARE(recentImagesPath[9], QStringLiteral("/path/image1.png")); } void RecentImagesPathStoreTests::StoreImagesPath_Should_NotSavePath_When_PathAlreadyStored() { // arrange auto imagePathStorageMock = new ImagePathStorageMock; RecentImagesPathStore recentImagesPathStore(imagePathStorageMock); recentImagesPathStore.storeImagePath("/path/image.png"); recentImagesPathStore.storeImagePath("/path/image2.png"); // act recentImagesPathStore.storeImagePath("/path/image.png"); // assert auto recentImagesPath = recentImagesPathStore.getRecentImagesPath(); QCOMPARE(recentImagesPath.size(), 2); QCOMPARE(imagePathStorageMock->count(), 2); QCOMPARE(imagePathStorageMock->store_callCounter(0), 1); QCOMPARE(imagePathStorageMock->store_callCounter(1), 1); } void RecentImagesPathStoreTests::StoreImagesPath_Should_DropOlderPaths_When_MoreThenTenPathsAdded() { // arrange auto imagePathStorageMock = new ImagePathStorageMock; RecentImagesPathStore recentImagesPathStore(imagePathStorageMock); recentImagesPathStore.storeImagePath("/path/image1.png"); recentImagesPathStore.storeImagePath("/path/image2.png"); recentImagesPathStore.storeImagePath("/path/image3.png"); recentImagesPathStore.storeImagePath("/path/image4.png"); recentImagesPathStore.storeImagePath("/path/image5.png"); recentImagesPathStore.storeImagePath("/path/image6.png"); recentImagesPathStore.storeImagePath("/path/image7.png"); recentImagesPathStore.storeImagePath("/path/image8.png"); recentImagesPathStore.storeImagePath("/path/image9.png"); recentImagesPathStore.storeImagePath("/path/image10.png"); // act recentImagesPathStore.storeImagePath("/path/image11.png"); recentImagesPathStore.storeImagePath("/path/image12.png"); // assert auto recentImagesPath = recentImagesPathStore.getRecentImagesPath(); QCOMPARE(recentImagesPath.size(), 10); QCOMPARE(recentImagesPath[0], QStringLiteral("/path/image12.png")); QCOMPARE(recentImagesPath[1], QStringLiteral("/path/image11.png")); QCOMPARE(recentImagesPath[2], QStringLiteral("/path/image10.png")); QCOMPARE(recentImagesPath[3], QStringLiteral("/path/image9.png")); QCOMPARE(recentImagesPath[4], QStringLiteral("/path/image8.png")); QCOMPARE(recentImagesPath[5], QStringLiteral("/path/image7.png")); QCOMPARE(recentImagesPath[6], QStringLiteral("/path/image6.png")); QCOMPARE(recentImagesPath[7], QStringLiteral("/path/image5.png")); QCOMPARE(recentImagesPath[8], QStringLiteral("/path/image4.png")); QCOMPARE(recentImagesPath[9], QStringLiteral("/path/image3.png")); } QTEST_MAIN(RecentImagesPathStoreTests) ksnip-1.9.2/tests/backend/recentImages/RecentImagesPathStoreTests.h000066400000000000000000000025611414701001100253730ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_RECENTIMAGESPATHSTORETESTS_H #define KSNIP_RECENTIMAGESPATHSTORETESTS_H #include class RecentImagesPathStoreTests : public QObject { Q_OBJECT private slots: void GetRecentImagesPath_Should_ReturnEmptyStringList_When_Initialized(); void GetRecentImagesPath_Should_ReturnNonEmptyStringList_When_ImagesAreStored(); void GetRecentImagesPath_Should_ReturnListOfEntriesInReversedOrder(); void StoreImagesPath_Should_NotSavePath_When_PathAlreadyStored(); void StoreImagesPath_Should_DropOlderPaths_When_MoreThenTenPathsAdded(); }; #endif //KSNIP_RECENTIMAGESPATHSTORETESTS_H ksnip-1.9.2/tests/common/000077500000000000000000000000001414701001100152665ustar00rootroot00000000000000ksnip-1.9.2/tests/common/helper/000077500000000000000000000000001414701001100165455ustar00rootroot00000000000000ksnip-1.9.2/tests/common/helper/PathHelperTests.cpp000066400000000000000000000075311414701001100223360ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "PathHelperTests.h" #include "src/common/helper/PathHelper.h" void PathHelperTests::IsPathValid_Should_ReturnFalse_When_StringEmpty() { auto input = QStringLiteral(""); auto result = PathHelper::isPathValid(input); QCOMPARE(result, false); } void PathHelperTests::IsPathValid_Should_ReturnFalse_When_StringNull() { auto input = QString(); auto result = PathHelper::isPathValid(input); QCOMPARE(result, false); } void PathHelperTests::IsPathValid_Should_ReturnTrue_When_StringHasContent() { auto input = QStringLiteral("lala"); auto result = PathHelper::isPathValid(input); QCOMPARE(result, true); } void PathHelperTests::IsPipePath_Should_ReturnTrue_When_PathIsDash() { auto input = QStringLiteral("-"); auto result = PathHelper::isPipePath(input); QCOMPARE(result, true); } void PathHelperTests::IsPipePath_Should_ReturnFalse_When_PathIsNull() { auto input = QString(); auto result = PathHelper::isPipePath(input); QCOMPARE(result, false); } void PathHelperTests::IsPipePath_Should_ReturnFalse_When_PathIsEmpty() { auto input = QLatin1Literal(""); auto result = PathHelper::isPipePath(input); QCOMPARE(result, false); } void PathHelperTests::ExtractParentDirectory_Should_ReturnStringWithParentDirectoryPath() { auto expected = QStringLiteral("/theRoot/theHome/myHome"); auto result = PathHelper::extractParentDirectory(expected + QStringLiteral("/theFile.me")); QCOMPARE(result, expected); } void PathHelperTests::ExtractFilename_Should_ReturnStringWithFilenameWithoutFormat_When_FormatExists() { auto expected = QStringLiteral("theFile"); auto result = PathHelper::extractFilename(QStringLiteral("/theRoot/theHome/myHome/") + expected + QStringLiteral(".me")); QCOMPARE(result, expected); } void PathHelperTests::ExtractFilename_Should_ReturnStringWithFilenameWithoutFormat_When_NoFormatExists() { auto expected = QStringLiteral("theFile"); auto result = PathHelper::extractFilename(QStringLiteral("/theRoot/theHome/myHome/") + expected); QCOMPARE(result, expected); } void PathHelperTests::ExtractFilenameWithFormat_Should_ReturnStringWithFilenameWithFormat_When_FormatExists() { auto expected = QStringLiteral("theFile.me"); auto result = PathHelper::extractFilenameWithFormat(QStringLiteral("/theRoot/theHome/myHome/") + expected); QCOMPARE(result, expected); } void PathHelperTests::ExtractFilenameWithFormat_Should_ReturnStringWithFilenameWithFormat_When_NoFormatExists() { auto expected = QStringLiteral("theFile"); auto result = PathHelper::extractFilenameWithFormat(QStringLiteral("/theRoot/theHome/myHome/") + expected); QCOMPARE(result, expected); } void PathHelperTests::ExtractFormat_Should_ReturnWithFormat_When_FormatExists() { auto expected = QStringLiteral("me"); auto result = PathHelper::extractFormat(QStringLiteral("/theRoot/theHome/myHome/theFile.") + expected); QCOMPARE(result, expected); } void PathHelperTests::ExtractFormat_Should_ReturnEmptyString_When_NoFormatExists() { auto result = PathHelper::extractFormat(QStringLiteral("/theRoot/theHome/myHome/theFile")); QCOMPARE(result, QStringLiteral("")); } QTEST_MAIN(PathHelperTests) ksnip-1.9.2/tests/common/helper/PathHelperTests.h000066400000000000000000000035501414701001100220000ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_PATHHELPERTESTS_H #define KSNIP_PATHHELPERTESTS_H #include class PathHelperTests : public QObject { Q_OBJECT private slots: void IsPathValid_Should_ReturnFalse_When_StringEmpty(); void IsPathValid_Should_ReturnFalse_When_StringNull(); void IsPipePath_Should_ReturnTrue_When_PathIsDash(); void IsPipePath_Should_ReturnFalse_When_PathIsNull(); void IsPipePath_Should_ReturnFalse_When_PathIsEmpty(); void IsPathValid_Should_ReturnTrue_When_StringHasContent(); void ExtractParentDirectory_Should_ReturnStringWithParentDirectoryPath(); void ExtractFilename_Should_ReturnStringWithFilenameWithoutFormat_When_FormatExists(); void ExtractFilename_Should_ReturnStringWithFilenameWithoutFormat_When_NoFormatExists(); void ExtractFilenameWithFormat_Should_ReturnStringWithFilenameWithFormat_When_FormatExists(); void ExtractFilenameWithFormat_Should_ReturnStringWithFilenameWithFormat_When_NoFormatExists(); void ExtractFormat_Should_ReturnWithFormat_When_FormatExists(); void ExtractFormat_Should_ReturnEmptyString_When_NoFormatExists(); }; #endif //KSNIP_PATHHELPERTESTS_H ksnip-1.9.2/tests/gui/000077500000000000000000000000001414701001100145625ustar00rootroot00000000000000ksnip-1.9.2/tests/gui/actions/000077500000000000000000000000001414701001100162225ustar00rootroot00000000000000ksnip-1.9.2/tests/gui/actions/ActionProcessorTest.cpp000066400000000000000000000217611414701001100227120ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "ActionProcessorTest.h" #include "src/gui/actions/ActionProcessor.h" void ActionProcessorTest::Process_Should_TriggerCapture_When_CaptureEnabled() { // arrange Action action; action.setIsCaptureEnabled(true); action.setCaptureDelay(2000); action.setIncludeCursor(true); action.setCaptureMode(CaptureModes::CurrentScreen); ActionProcessor processor; QSignalSpy spy(&processor, &ActionProcessor::triggerCapture); // act processor.process(action); // assert QCOMPARE(spy.count(), 1); QCOMPARE(qvariant_cast(spy.at(0).at(0)), CaptureModes::CurrentScreen); QCOMPARE(qvariant_cast(spy.at(0).at(1)), true); QCOMPARE(qvariant_cast(spy.at(0).at(2)), 2000); } void ActionProcessorTest::Process_Should_NotTriggerCapture_When_CaptureDisabled() { // arrange Action action; action.setIsCaptureEnabled(false); action.setCaptureDelay(2000); action.setIncludeCursor(true); action.setCaptureMode(CaptureModes::CurrentScreen); ActionProcessor processor; QSignalSpy spy(&processor, &ActionProcessor::triggerCapture); // act processor.process(action); // assert QCOMPARE(spy.count(), 0); } void ActionProcessorTest::Process_Should_StartPostProcessing_When_CaptureDisabledAndPostProcessingEnabled() { // arrange Action action; action.setIsCaptureEnabled(false); action.setIsSaveEnabled(true); ActionProcessor processor; processor.setPostProcessingEnabled(true); QSignalSpy spy(&processor, &ActionProcessor::triggerSave); // act processor.process(action); // assert QCOMPARE(spy.count(), 1); } void ActionProcessorTest::Process_Should_NotStartPostProcessing_When_CaptureDisabledAndPostProcessingDisabled() { // arrange Action action; action.setIsCaptureEnabled(false); action.setIsSaveEnabled(true); ActionProcessor processor; processor.setPostProcessingEnabled(false); QSignalSpy spy(&processor, &ActionProcessor::triggerSave); // act processor.process(action); // assert QCOMPARE(spy.count(), 0); } void ActionProcessorTest::Process_Should_NotStartPostProcessing_When_CaptureEnabledAndPostProcessingDisabled() { // arrange Action action; action.setIsCaptureEnabled(true); action.setIsSaveEnabled(true); ActionProcessor processor; processor.setPostProcessingEnabled(false); QSignalSpy spy(&processor, &ActionProcessor::triggerSave); // act processor.process(action); // assert QCOMPARE(spy.count(), 0); } void ActionProcessorTest::Process_Should_NotStartPostProcessing_When_CaptureEnabledAndPostProcessingEnabled() { // arrange Action action; action.setIsCaptureEnabled(true); action.setIsSaveEnabled(true); ActionProcessor processor; processor.setPostProcessingEnabled(true); QSignalSpy spy(&processor, &ActionProcessor::triggerSave); // act processor.process(action); // assert QCOMPARE(spy.count(), 0); } void ActionProcessorTest::CaptureFinished_Should_StartPostProcessing_When_CaptureEnabledAndPostProcessingEnabled() { // arrange Action action; action.setIsCaptureEnabled(true); action.setIsSaveEnabled(true); ActionProcessor processor; processor.setPostProcessingEnabled(true); QSignalSpy spy(&processor, &ActionProcessor::triggerSave); processor.process(action); // act processor.captureFinished(); // assert QCOMPARE(spy.count(), 1); } void ActionProcessorTest::CaptureFinished_Should_StartPostProcessing_When_CaptureEnabledAndPostProcessingDisabled() { // arrange Action action; action.setIsCaptureEnabled(true); action.setIsSaveEnabled(true); ActionProcessor processor; processor.setPostProcessingEnabled(false); QSignalSpy spy(&processor, &ActionProcessor::triggerSave); processor.process(action); // act processor.captureFinished(); // assert QCOMPARE(spy.count(), 1); } void ActionProcessorTest::CaptureFinished_Should_SendSignalsForAllSelectedActions() { // arrange Action action; action.setIsCaptureEnabled(true); action.setIsSaveEnabled(true); action.setIsCopyToClipboardEnabled(true); action.setIsOpenDirectoryEnabled(true); action.setIsUploadEnabled(true); action.setIsPinScreenshotEnabled(true); ActionProcessor processor; processor.setPostProcessingEnabled(false); QSignalSpy saveSignalSpy(&processor, &ActionProcessor::triggerSave); QSignalSpy copySignalSpy(&processor, &ActionProcessor::triggerCopyToClipboard); QSignalSpy openSignalSpy(&processor, &ActionProcessor::triggerOpenDirectory); QSignalSpy uploadSignalSpy(&processor, &ActionProcessor::triggerUpload); QSignalSpy pinSignalSpy(&processor, &ActionProcessor::triggerPinImage); processor.process(action); // act processor.captureFinished(); // assert QCOMPARE(saveSignalSpy.count(), 1); QCOMPARE(copySignalSpy.count(), 1); QCOMPARE(openSignalSpy.count(), 1); QCOMPARE(uploadSignalSpy.count(), 1); QCOMPARE(pinSignalSpy.count(), 1); } void ActionProcessorTest::CaptureFinished_Should_NotSendSignalsForNotSelectedActions() { // arrange Action action; action.setIsCaptureEnabled(true); action.setIsSaveEnabled(false); action.setIsCopyToClipboardEnabled(false); action.setIsOpenDirectoryEnabled(false); action.setIsUploadEnabled(false); action.setIsPinScreenshotEnabled(false); ActionProcessor processor; processor.setPostProcessingEnabled(false); QSignalSpy saveSignalSpy(&processor, &ActionProcessor::triggerSave); QSignalSpy copySignalSpy(&processor, &ActionProcessor::triggerCopyToClipboard); QSignalSpy openSignalSpy(&processor, &ActionProcessor::triggerOpenDirectory); QSignalSpy uploadSignalSpy(&processor, &ActionProcessor::triggerUpload); QSignalSpy pinSignalSpy(&processor, &ActionProcessor::triggerPinImage); processor.process(action); // act processor.captureFinished(); // assert QCOMPARE(saveSignalSpy.count(), 0); QCOMPARE(copySignalSpy.count(), 0); QCOMPARE(openSignalSpy.count(), 0); QCOMPARE(uploadSignalSpy.count(), 0); QCOMPARE(pinSignalSpy.count(), 0); } void ActionProcessorTest::Process_Should_MarkActionAsInProgress_When_CaptureEnabled() { // arrange Action action; action.setIsCaptureEnabled(true); ActionProcessor processor; // act processor.process(action); // assert QCOMPARE(processor.isActionInProgress(), true); } void ActionProcessorTest::CaptureFinished_Should_MarkActionAsNotInProgress_When_CaptureEnabled() { // arrange Action action; action.setIsCaptureEnabled(true); ActionProcessor processor; processor.process(action); // act processor.captureFinished(); // assert QCOMPARE(processor.isActionInProgress(), false); } void ActionProcessorTest::CaptureFinished_Should_SendShowSignalWithMinimizedSetToTrue_When_HideSelected() { // arrange Action action; action.setIsCaptureEnabled(true); action.setIsHideMainWindowEnabled(true); ActionProcessor processor; processor.setPostProcessingEnabled(true); QSignalSpy spy(&processor, &ActionProcessor::triggerShow); processor.process(action); // act processor.captureFinished(); // assert QCOMPARE(spy.count(), 1); QCOMPARE(qvariant_cast(spy.at(0).at(0)), true); } void ActionProcessorTest::CaptureFinished_Should_SendShowSignalWithMinimizedSetToFalse_When_HideNotSelected() { // arrange Action action; action.setIsCaptureEnabled(true); action.setIsHideMainWindowEnabled(false); ActionProcessor processor; processor.setPostProcessingEnabled(true); QSignalSpy spy(&processor, &ActionProcessor::triggerShow); processor.process(action); // act processor.captureFinished(); // assert QCOMPARE(spy.count(), 1); QCOMPARE(qvariant_cast(spy.at(0).at(0)), false); } void ActionProcessorTest::Process_Should_NotSendShowSignal_When_HideNotSelectedAndCaptureNotSelected() { // arrange Action action; action.setIsCaptureEnabled(false); action.setIsHideMainWindowEnabled(false); ActionProcessor processor; processor.setPostProcessingEnabled(true); QSignalSpy spy(&processor, &ActionProcessor::triggerShow); // act processor.process(action); // assert QCOMPARE(spy.count(), 0); } void ActionProcessorTest::Process_Should_SendShowSignalWithMinimizedSetToTrue_When_HideSelectedAndCaptureNotSelected() { // arrange Action action; action.setIsCaptureEnabled(false); action.setIsHideMainWindowEnabled(true); ActionProcessor processor; processor.setPostProcessingEnabled(true); QSignalSpy spy(&processor, &ActionProcessor::triggerShow); // act processor.process(action); // assert QCOMPARE(spy.count(), 1); QCOMPARE(qvariant_cast(spy.at(0).at(0)), true); } QTEST_MAIN(ActionProcessorTest) ksnip-1.9.2/tests/gui/actions/ActionProcessorTest.h000066400000000000000000000044131414701001100223520ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_ACTIONPROCESSORTEST_H #define KSNIP_ACTIONPROCESSORTEST_H #include class ActionProcessorTest : public QObject { Q_OBJECT private slots: void Process_Should_TriggerCapture_When_CaptureEnabled(); void Process_Should_NotTriggerCapture_When_CaptureDisabled(); void Process_Should_StartPostProcessing_When_CaptureDisabledAndPostProcessingEnabled(); void Process_Should_NotStartPostProcessing_When_CaptureDisabledAndPostProcessingDisabled(); void Process_Should_NotStartPostProcessing_When_CaptureEnabledAndPostProcessingDisabled(); void Process_Should_NotStartPostProcessing_When_CaptureEnabledAndPostProcessingEnabled(); void CaptureFinished_Should_StartPostProcessing_When_CaptureEnabledAndPostProcessingEnabled(); void CaptureFinished_Should_StartPostProcessing_When_CaptureEnabledAndPostProcessingDisabled(); void CaptureFinished_Should_SendSignalsForAllSelectedActions(); void CaptureFinished_Should_NotSendSignalsForNotSelectedActions(); void Process_Should_MarkActionAsInProgress_When_CaptureEnabled(); void CaptureFinished_Should_MarkActionAsNotInProgress_When_CaptureEnabled(); void CaptureFinished_Should_SendShowSignalWithMinimizedSetToTrue_When_HideSelected(); void CaptureFinished_Should_SendShowSignalWithMinimizedSetToFalse_When_HideNotSelected(); void Process_Should_NotSendShowSignal_When_HideNotSelectedAndCaptureNotSelected(); void Process_Should_SendShowSignalWithMinimizedSetToTrue_When_HideSelectedAndCaptureNotSelected(); }; #endif //KSNIP_ACTIONPROCESSORTEST_H ksnip-1.9.2/tests/gui/actions/ActionTest.cpp000066400000000000000000000125341414701001100210100ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "ActionTest.h" #include "src/gui/actions/Action.h" void ActionTest::EqualsOperator_Should_ReturnTrue_When_AllValuesMatch() { // arrange QFETCH(QString, name); QFETCH(QKeySequence, shortcut); QFETCH(bool, captureEnabled); QFETCH(bool, includeCursor); QFETCH(int, delay); QFETCH(CaptureModes, captureMode); QFETCH(bool, save); QFETCH(bool, copy); QFETCH(bool, upload); QFETCH(bool, openDirectory); QFETCH(bool, pin); QFETCH(bool, hide); QFETCH(bool, expected); Action action1; action1.setName("Name"); action1.setShortcut(Qt::CTRL + Qt::Key_A); action1.setIsCaptureEnabled(true); action1.setIncludeCursor(true); action1.setCaptureDelay(2000); action1.setCaptureMode(CaptureModes::FullScreen); action1.setIsSaveEnabled(true); action1.setIsCopyToClipboardEnabled(true); action1.setIsUploadEnabled(true); action1.setIsOpenDirectoryEnabled(true); action1.setIsPinScreenshotEnabled(true); action1.setIsHideMainWindowEnabled(true); Action action2; action2.setName(name); action2.setShortcut(shortcut); action2.setIsCaptureEnabled(captureEnabled); action2.setIncludeCursor(includeCursor); action2.setCaptureDelay(delay); action2.setCaptureMode(captureMode); action2.setIsSaveEnabled(save); action2.setIsCopyToClipboardEnabled(copy); action2.setIsUploadEnabled(upload); action2.setIsOpenDirectoryEnabled(openDirectory); action2.setIsPinScreenshotEnabled(pin); action2.setIsHideMainWindowEnabled(hide); // act auto result = action1 == action2; // assert QCOMPARE(result, expected); } void ActionTest::EqualsOperator_Should_ReturnTrue_When_AllValuesMatch_data() { QTest::addColumn("name"); QTest::addColumn("shortcut"); QTest::addColumn("captureEnabled"); QTest::addColumn("includeCursor"); QTest::addColumn("delay"); QTest::addColumn("captureMode"); QTest::addColumn("save"); QTest::addColumn("copy"); QTest::addColumn("upload"); QTest::addColumn("openDirectory"); QTest::addColumn("pin"); QTest::addColumn("hide"); QTest::addColumn("expected"); QTest::newRow("01. All set") << "Name" << QKeySequence(Qt::CTRL + Qt::Key_A) << true << true << 2000 << CaptureModes::FullScreen << true << true << true << true << true << true << true; QTest::newRow("02. Name differ") << "Other" << QKeySequence(Qt::CTRL + Qt::Key_A) << true << true << 2000 << CaptureModes::FullScreen << true << true << true << true << true << true << false; QTest::newRow("03. Shortcut differ") << "Name" << QKeySequence(Qt::CTRL + Qt::Key_B) << true << true << 2000 << CaptureModes::FullScreen << true << true << true << true << true << true << false; QTest::newRow("04. Capture enabled differ") << "Name" << QKeySequence(Qt::CTRL + Qt::Key_A) << false << true << 2000 << CaptureModes::FullScreen << true << true << true << true << true << true << false; QTest::newRow("05. Cursor included differ") << "Name" << QKeySequence(Qt::CTRL + Qt::Key_A) << true << false << 2000 << CaptureModes::FullScreen << true << true << true << true << true << true << false; QTest::newRow("06. Delay differ") << "Name" << QKeySequence(Qt::CTRL + Qt::Key_A) << true << true << 3000 << CaptureModes::FullScreen << true << true << true << true << true << true << false; QTest::newRow("06. Capture mode differ") << "Name" << QKeySequence(Qt::CTRL + Qt::Key_A) << true << true << 2000 << CaptureModes::RectArea << true << true << true << true << true << true << false; QTest::newRow("07. Save differ") << "Name" << QKeySequence(Qt::CTRL + Qt::Key_A) << true << true << 2000 << CaptureModes::FullScreen << false << true << true << true << true << true << false; QTest::newRow("08. Copy differ") << "Name" << QKeySequence(Qt::CTRL + Qt::Key_A) << true << true << 2000 << CaptureModes::FullScreen << true << false << true << true << true << true << false; QTest::newRow("09. Upload differ") << "Name" << QKeySequence(Qt::CTRL + Qt::Key_A) << true << true << 2000 << CaptureModes::FullScreen << true << true << false << true << true << true << false; QTest::newRow("10. Open directory differ") << "Name" << QKeySequence(Qt::CTRL + Qt::Key_A) << true << true << 2000 << CaptureModes::FullScreen << true << true << true << false << false << true << false; QTest::newRow("11. Pin differ") << "Name" << QKeySequence(Qt::CTRL + Qt::Key_A) << true << true << 2000 << CaptureModes::FullScreen << true << true << true << true << false << true << false; QTest::newRow("12. Hide differ") << "Name" << QKeySequence(Qt::CTRL + Qt::Key_A) << true << true << 2000 << CaptureModes::FullScreen << true << true << true << true << true << false << false; } QTEST_MAIN(ActionTest) ksnip-1.9.2/tests/gui/actions/ActionTest.h000066400000000000000000000021011414701001100204420ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_ACTIONTEST_H #define KSNIP_ACTIONTEST_H #include class ActionTest : public QObject { Q_OBJECT private slots: void EqualsOperator_Should_ReturnTrue_When_AllValuesMatch(); void EqualsOperator_Should_ReturnTrue_When_AllValuesMatch_data(); }; #endif //KSNIP_ACTIONTEST_H ksnip-1.9.2/tests/gui/captureHandler/000077500000000000000000000000001414701001100175235ustar00rootroot00000000000000ksnip-1.9.2/tests/gui/captureHandler/MultiCaptureHandlerTests.cpp000066400000000000000000000301511414701001100251660ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "MultiCaptureHandlerTests.h" #include "src/gui/captureHandler/MultiCaptureHandler.h" #include "tests/mocks/ImageAnnotatorMock.h" #include "tests/mocks/CaptureTabStateHandlerMock.h" #include "tests/mocks/ServiceLocatorMock.h" void MultiCaptureHandlerTests::Copy_Should_CopyCurrentTabImageToClipboard() { auto index = 22; ImageAnnotatorMock imageAnnotatorMock; ServiceLocatorMock serviceLocatorMock; auto tabStateHandlerMock = new CaptureTabStateHandlerMock; MultiCaptureHandler multiCaptureHandler(&imageAnnotatorMock, nullptr, &serviceLocatorMock, tabStateHandlerMock, nullptr); tabStateHandlerMock->currentTabIndex_set(index); imageAnnotatorMock.imageAt_set(index, QImage()); multiCaptureHandler.copy(); QCOMPARE(imageAnnotatorMock.imageAt_callCounter(index), 1); QCOMPARE(serviceLocatorMock.clipboard_mock()->setImage_set(), imageAnnotatorMock.imageAt(index)); } void MultiCaptureHandlerTests::CopyToClipboardTab_Should_FetchCorrectImageFromAnnotator_And_CopyItToClipboard() { int index = 22; ImageAnnotatorMock imageAnnotatorMock; ServiceLocatorMock serviceLocatorMock; auto tabStateHandlerMock = new CaptureTabStateHandlerMock; MultiCaptureHandler multiCaptureHandler(&imageAnnotatorMock, nullptr, &serviceLocatorMock, tabStateHandlerMock, nullptr); tabStateHandlerMock->currentTabIndex_set(index); imageAnnotatorMock.imageAt_set(index, QImage()); auto customActions = imageAnnotatorMock.tabContextMenuActions_get(); for(auto action : customActions) { if(action->text() == QLatin1Literal("Copy")) { action->setData(index); action->trigger(); } } QCOMPARE(imageAnnotatorMock.imageAt_callCounter(index), 1); QCOMPARE(serviceLocatorMock.clipboard_mock()->setImage_set(), imageAnnotatorMock.imageAt(index)); } void MultiCaptureHandlerTests::CopyPathToClipboardTab_Should_FetchCorrectPathFromTabStateHandler_And_CopyItToClipboard() { int index = 22; ImageAnnotatorMock imageAnnotatorMock; ClipboardMock clipboardMock; ServiceLocatorMock serviceLocatorMock; auto tabStateHandlerMock = new CaptureTabStateHandlerMock; MultiCaptureHandler multiCaptureHandler(&imageAnnotatorMock, nullptr, &serviceLocatorMock, tabStateHandlerMock, nullptr); tabStateHandlerMock->currentTabIndex_set(index); tabStateHandlerMock->path_set(index, QLatin1Literal("lala")); auto customActions = imageAnnotatorMock.tabContextMenuActions_get(); for(auto action : customActions) { if(action->text() == QLatin1Literal("Copy Path")) { action->setData(index); action->trigger(); } } QCOMPARE(tabStateHandlerMock->path_callCounter(index), 1); QCOMPARE(serviceLocatorMock.clipboard_mock()->setText_get(), tabStateHandlerMock->path(index)); } void MultiCaptureHandlerTests::OpenDirectoryTab_Should_FetchCorrectPathFromTabStateHandler_And_PassTheParentDirectoryOnlyToDesktopService() { int index = 22; ImageAnnotatorMock imageAnnotatorMock; ServiceLocatorMock serviceLocatorMock; auto tabStateHandlerMock = new CaptureTabStateHandlerMock; MultiCaptureHandler multiCaptureHandler(&imageAnnotatorMock, nullptr, &serviceLocatorMock, tabStateHandlerMock, nullptr); tabStateHandlerMock->currentTabIndex_set(index); tabStateHandlerMock->path_set(index, QLatin1Literal("/la/la.png")); auto customActions = imageAnnotatorMock.tabContextMenuActions_get(); for(auto action : customActions) { if(action->text() == QLatin1Literal("Open Directory")) { action->setData(index); action->trigger(); } } QCOMPARE(tabStateHandlerMock->path_callCounter(index), 1); QCOMPARE(serviceLocatorMock.desktopService_mock()->openFile_get().toString(), QLatin1Literal("/la")); } void MultiCaptureHandlerTests::UpdateContextMenuActions_Should_SetAllActionThatRequirePathToEnabled_When_PathIsValid() { int index = 22; ImageAnnotatorMock imageAnnotatorMock; ServiceLocatorMock serviceLocatorMock; auto tabStateHandlerMock = new CaptureTabStateHandlerMock; MultiCaptureHandler multiCaptureHandler(&imageAnnotatorMock, nullptr, &serviceLocatorMock, tabStateHandlerMock, nullptr); tabStateHandlerMock->currentTabIndex_set(index); tabStateHandlerMock->isPathValid_set(index, true); auto customActions = imageAnnotatorMock.tabContextMenuActions_get(); QAction *saveContextMenuAction = nullptr; QAction *saveAsContextMenuAction = nullptr; QAction *openDirectoryContextMenuAction = nullptr; QAction *copyPathToClipboardContextMenuAction = nullptr; QAction *copyToClipboardContextMenuAction = nullptr; for(auto action : customActions) { if(action->text() == QLatin1Literal("Save")) { saveContextMenuAction = action; } if(action->text() == QLatin1Literal("Save As")) { saveAsContextMenuAction = action; } if(action->text() == QLatin1Literal("Open Directory")) { openDirectoryContextMenuAction = action; } if(action->text() ==QLatin1Literal("Copy Path")) { copyPathToClipboardContextMenuAction = action; } if(action->text() == QLatin1Literal("Copy")) { copyToClipboardContextMenuAction = action; } } imageAnnotatorMock.tabContextMenuOpened_emit(index); QCOMPARE(saveContextMenuAction->isEnabled(), true); QCOMPARE(saveAsContextMenuAction->isEnabled(), true); QCOMPARE(openDirectoryContextMenuAction->isEnabled(), true); QCOMPARE(copyPathToClipboardContextMenuAction->isEnabled(), true); QCOMPARE(copyToClipboardContextMenuAction->isEnabled(), true); } void MultiCaptureHandlerTests::UpdateContextMenuActions_Should_SetAllActionThatRequirePathToDisabled_When_PathIsNotValid() { int index = 22; ImageAnnotatorMock imageAnnotatorMock; ServiceLocatorMock serviceLocatorMock; auto tabStateHandlerMock = new CaptureTabStateHandlerMock; MultiCaptureHandler multiCaptureHandler(&imageAnnotatorMock, nullptr, &serviceLocatorMock, tabStateHandlerMock, nullptr); tabStateHandlerMock->currentTabIndex_set(index); tabStateHandlerMock->isPathValid_set(index, false); auto customActions = imageAnnotatorMock.tabContextMenuActions_get(); QAction *saveContextMenuAction = nullptr; QAction *saveAsContextMenuAction = nullptr; QAction *openDirectoryContextMenuAction = nullptr; QAction *copyPathToClipboardContextMenuAction = nullptr; QAction *copyToClipboardContextMenuAction = nullptr; for(auto action : customActions) { if(action->text() == QLatin1Literal("Save")) { saveContextMenuAction = action; } if(action->text() == QLatin1Literal("Save As")) { saveAsContextMenuAction = action; } if(action->text() == QLatin1Literal("Open Directory")) { openDirectoryContextMenuAction = action; } if(action->text() ==QLatin1Literal("Copy Path")) { copyPathToClipboardContextMenuAction = action; } if(action->text() == QLatin1Literal("Copy")) { copyToClipboardContextMenuAction = action; } } imageAnnotatorMock.tabContextMenuOpened_emit(index); QCOMPARE(saveContextMenuAction->isEnabled(), true); QCOMPARE(saveAsContextMenuAction->isEnabled(), true); QCOMPARE(openDirectoryContextMenuAction->isEnabled(), false); QCOMPARE(copyPathToClipboardContextMenuAction->isEnabled(), false); QCOMPARE(copyToClipboardContextMenuAction->isEnabled(), true); } void MultiCaptureHandlerTests::UpdateContextMenuActions_Should_SetSaveActionToDisabled_When_CaptureSaved() { int index = 22; ImageAnnotatorMock imageAnnotatorMock; ServiceLocatorMock serviceLocatorMock; auto tabStateHandlerMock = new CaptureTabStateHandlerMock; MultiCaptureHandler multiCaptureHandler(&imageAnnotatorMock, nullptr, &serviceLocatorMock, tabStateHandlerMock, nullptr); tabStateHandlerMock->currentTabIndex_set(index); tabStateHandlerMock->isSaved_set(index, true); auto customActions = imageAnnotatorMock.tabContextMenuActions_get(); QAction *saveContextMenuAction = nullptr; for(auto action : customActions) { if(action->text() == QLatin1Literal("Save")) { saveContextMenuAction = action; } } imageAnnotatorMock.tabContextMenuOpened_emit(index); QCOMPARE(saveContextMenuAction->isEnabled(), false); } void MultiCaptureHandlerTests::UpdateContextMenuActions_Should_SetSaveActionToEnabled_When_CaptureNotSaved() { int index = 22; ImageAnnotatorMock imageAnnotatorMock; ServiceLocatorMock serviceLocatorMock; auto tabStateHandlerMock = new CaptureTabStateHandlerMock; MultiCaptureHandler multiCaptureHandler(&imageAnnotatorMock, nullptr, &serviceLocatorMock, tabStateHandlerMock, nullptr); tabStateHandlerMock->currentTabIndex_set(index); tabStateHandlerMock->isSaved_set(index, false); auto customActions = imageAnnotatorMock.tabContextMenuActions_get(); QAction *saveContextMenuAction = nullptr; for(auto action : customActions) { if(action->text() == QLatin1Literal("Save")) { saveContextMenuAction = action; } } imageAnnotatorMock.tabContextMenuOpened_emit(index); QCOMPARE(saveContextMenuAction->isEnabled(), true); } void MultiCaptureHandlerTests::CopyPath_Should_CopyCurrentTabPathToClipboard() { auto path = QLatin1Literal("lala"); auto index = 22; ImageAnnotatorMock imageAnnotatorMock; ServiceLocatorMock serviceLocatorMock; auto tabStateHandlerMock = new CaptureTabStateHandlerMock; MultiCaptureHandler multiCaptureHandler(&imageAnnotatorMock, nullptr, &serviceLocatorMock, tabStateHandlerMock, nullptr); tabStateHandlerMock->currentTabIndex_set(index); tabStateHandlerMock->path_set(index, path); multiCaptureHandler.copyPath(); QCOMPARE(tabStateHandlerMock->path_callCounter(index), 1); QCOMPARE(serviceLocatorMock.clipboard_mock()->setText_get(), path); } void MultiCaptureHandlerTests::OpenDirectory_Should_FetchCurrentTabPathFromTabStateHandler_And_PassTheParentDirectoryOnlyToDesktopService() { auto index = 22; ImageAnnotatorMock imageAnnotatorMock; ServiceLocatorMock serviceLocatorMock; auto tabStateHandlerMock = new CaptureTabStateHandlerMock; MultiCaptureHandler multiCaptureHandler(&imageAnnotatorMock, nullptr, &serviceLocatorMock, tabStateHandlerMock, nullptr); tabStateHandlerMock->currentTabIndex_set(index); tabStateHandlerMock->path_set(index, QLatin1String("/la/la.png")); multiCaptureHandler.openDirectory(); QCOMPARE(tabStateHandlerMock->path_callCounter(index), 1); QCOMPARE(serviceLocatorMock.desktopService_mock()->openFile_get().toString(), QLatin1String("/la")); } void MultiCaptureHandlerTests::RemoveImage_Should_NotRemoveTab_When_OperationDidNotDeleteImage() { auto path = QLatin1Literal("lala"); auto index = 22; ImageAnnotatorMock imageAnnotatorMock; ServiceLocatorMock serviceLocatorMock; serviceLocatorMock.messageBoxService_mock()->okCancel_set(false); auto tabStateHandlerMock = new CaptureTabStateHandlerMock; MultiCaptureHandler multiCaptureHandler(&imageAnnotatorMock, nullptr, &serviceLocatorMock, tabStateHandlerMock, nullptr); tabStateHandlerMock->currentTabIndex_set(index); tabStateHandlerMock->path_set(index, path); multiCaptureHandler.removeImage(); QCOMPARE(imageAnnotatorMock.removeTab_callCounter(index), 0); } void MultiCaptureHandlerTests::RemoveImage_Should_RemoveTab_When_OperationDidDeleteImage() { auto path = QLatin1Literal("lala"); auto index = 22; ImageAnnotatorMock imageAnnotatorMock; ServiceLocatorMock serviceLocatorMock; serviceLocatorMock.messageBoxService_mock()->okCancel_set(true); serviceLocatorMock.fileService_mock()->remove_set(true); auto tabStateHandlerMock = new CaptureTabStateHandlerMock; MultiCaptureHandler multiCaptureHandler(&imageAnnotatorMock, nullptr, &serviceLocatorMock, tabStateHandlerMock, nullptr); tabStateHandlerMock->currentTabIndex_set(index); tabStateHandlerMock->path_set(index, path); multiCaptureHandler.removeImage(); QCOMPARE(imageAnnotatorMock.removeTab_callCounter(index), 1); } QTEST_MAIN(MultiCaptureHandlerTests) ksnip-1.9.2/tests/gui/captureHandler/MultiCaptureHandlerTests.h000066400000000000000000000037711414701001100246430ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_MULTICAPTUREHANDLERTESTS_H #define KSNIP_MULTICAPTUREHANDLERTESTS_H #include class MultiCaptureHandlerTests : public QObject { Q_OBJECT private slots: void Copy_Should_CopyCurrentTabImageToClipboard(); void CopyToClipboardTab_Should_FetchCorrectImageFromAnnotator_And_CopyItToClipboard(); void CopyPathToClipboardTab_Should_FetchCorrectPathFromTabStateHandler_And_CopyItToClipboard(); void OpenDirectoryTab_Should_FetchCorrectPathFromTabStateHandler_And_PassTheParentDirectoryOnlyToDesktopService(); void UpdateContextMenuActions_Should_SetAllActionThatRequirePathToEnabled_When_PathIsValid(); void UpdateContextMenuActions_Should_SetAllActionThatRequirePathToDisabled_When_PathIsNotValid(); void UpdateContextMenuActions_Should_SetSaveActionToDisabled_When_CaptureSaved(); void UpdateContextMenuActions_Should_SetSaveActionToEnabled_When_CaptureNotSaved(); void CopyPath_Should_CopyCurrentTabPathToClipboard(); void OpenDirectory_Should_FetchCurrentTabPathFromTabStateHandler_And_PassTheParentDirectoryOnlyToDesktopService(); void RemoveImage_Should_NotRemoveTab_When_OperationDidNotDeleteImage(); void RemoveImage_Should_RemoveTab_When_OperationDidDeleteImage(); }; #endif //KSNIP_MULTICAPTUREHANDLERTESTS_H ksnip-1.9.2/tests/gui/captureHandler/SingleCaptureHandlerTests.cpp000066400000000000000000000063611414701001100253230ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "SingleCaptureHandlerTests.h" #include "src/gui/captureHandler/SingleCaptureHandler.h" #include "src/common/dtos/CaptureFromFileDto.h" #include "tests/mocks/ImageAnnotatorMock.h" #include "tests/mocks/ServiceLocatorMock.h" void SingleCaptureHandlerTests::RemoveImage_Should_CleanupAnnotationData_When_ImageDeleted() { ImageAnnotatorMock imageAnnotatorMock; ServiceLocatorMock serviceLocatorMock; serviceLocatorMock.messageBoxService_mock()->okCancel_set(true); serviceLocatorMock.fileService_mock()->remove_set(true); SingleCaptureHandler captureHandler(&imageAnnotatorMock, nullptr, &serviceLocatorMock, nullptr); auto capture = CaptureFromFileDto(QPixmap(), QLatin1Literal("lala")); captureHandler.load(capture); captureHandler.removeImage(); QCOMPARE(imageAnnotatorMock.hide_callCounter(), 1); QCOMPARE(captureHandler.path(), QString()); QCOMPARE(captureHandler.isSaved(), true); } void SingleCaptureHandlerTests::RemoveImage_Should_NotCleanupAnnotationData_When_ImageWasNotDeleted() { ImageAnnotatorMock imageAnnotatorMock; ServiceLocatorMock serviceLocatorMock; serviceLocatorMock.messageBoxService_mock()->okCancel_set(false); SingleCaptureHandler captureHandler(&imageAnnotatorMock, nullptr, &serviceLocatorMock, nullptr); auto capture = CaptureFromFileDto(QPixmap(), QLatin1Literal("lala")); captureHandler.load(capture); captureHandler.removeImage(); QCOMPARE(imageAnnotatorMock.hide_callCounter(), 0); QCOMPARE(captureHandler.path(), capture.path); QCOMPARE(captureHandler.isSaved(), true); } void SingleCaptureHandlerTests::Load_Should_SetPathAndIsSavedToValuesFromCaptureDto_When_CaptureLoadedFromFile() { ImageAnnotatorMock imageAnnotatorMock; ServiceLocatorMock serviceLocatorMock; SingleCaptureHandler captureHandler(&imageAnnotatorMock, nullptr, &serviceLocatorMock, nullptr); auto capture = CaptureFromFileDto(QPixmap(), QLatin1Literal("lala")); captureHandler.load(capture); QCOMPARE(captureHandler.path(), capture.path); QCOMPARE(captureHandler.isSaved(), true); } void SingleCaptureHandlerTests::Load_Should_SetPathToEmptyAndIsSavedToFalse_When_CaptureNotLoadedFromFile() { ImageAnnotatorMock imageAnnotatorMock; ServiceLocatorMock serviceLocatorMock; SingleCaptureHandler captureHandler(&imageAnnotatorMock, nullptr, &serviceLocatorMock, nullptr); auto capture = CaptureDto(QPixmap()); captureHandler.load(capture); QCOMPARE(captureHandler.path(), QString()); QCOMPARE(captureHandler.isSaved(), false); } QTEST_MAIN(SingleCaptureHandlerTests)ksnip-1.9.2/tests/gui/captureHandler/SingleCaptureHandlerTests.h000066400000000000000000000024701414701001100247650ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_SINGLECAPTUREHANDLERTESTS_H #define KSNIP_SINGLECAPTUREHANDLERTESTS_H #include class SingleCaptureHandlerTests : public QObject { Q_OBJECT private slots: void RemoveImage_Should_CleanupAnnotationData_When_ImageDeleted(); void RemoveImage_Should_NotCleanupAnnotationData_When_ImageWasNotDeleted(); void Load_Should_SetPathAndIsSavedToValuesFromCaptureDto_When_CaptureLoadedFromFile(); void Load_Should_SetPathToEmptyAndIsSavedToFalse_When_CaptureNotLoadedFromFile(); }; #endif //KSNIP_SINGLECAPTUREHANDLERTESTS_H ksnip-1.9.2/tests/gui/operations/000077500000000000000000000000001414701001100167455ustar00rootroot00000000000000ksnip-1.9.2/tests/gui/operations/DeleteImageOperationTests.cpp000066400000000000000000000050361414701001100245260ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "DeleteImageOperationTests.h" #include "src/gui/operations/DeleteImageOperation.h" #include "tests/mocks/MessageBoxServiceMock.h" #include "tests/mocks/FileServiceMock.h" void DeleteImageOperationTests::Execute_Should_ReturnFalse_When_MessageBoxResponseWasCancel() { auto path = QLatin1Literal("/la/la"); auto messageBoxServiceMock = new MessageBoxServiceMock; messageBoxServiceMock->okCancel_set(false); auto fileServiceMock = new FileServiceMock; DeleteImageOperation operation(path, fileServiceMock, messageBoxServiceMock); auto result = operation.execute(); QCOMPARE(result, false); QCOMPARE(fileServiceMock->remove_callCounter(path), 0); } void DeleteImageOperationTests::Execute_Should_ReturnTrue_When_MessageBoxResponseWasTrue_And_FileServiceSaveSuccessfully() { auto path = QLatin1Literal("/la/la"); auto messageBoxServiceMock = new MessageBoxServiceMock; messageBoxServiceMock->okCancel_set(true); auto fileServiceMock = new FileServiceMock; fileServiceMock->remove_set(true); DeleteImageOperation operation(path, fileServiceMock, messageBoxServiceMock); auto result = operation.execute(); QCOMPARE(result, true); QCOMPARE(fileServiceMock->remove_callCounter(path), 1); } void DeleteImageOperationTests::Execute_Should_ReturnFalse_When_MessageBoxResponseWasTrue_And_FileServiceSaveFailed() { auto path = QLatin1Literal("/la/la"); auto messageBoxServiceMock = new MessageBoxServiceMock; messageBoxServiceMock->okCancel_set(true); auto fileServiceMock = new FileServiceMock; fileServiceMock->remove_set(false); DeleteImageOperation operation(path, fileServiceMock, messageBoxServiceMock); auto result = operation.execute(); QCOMPARE(result, false); QCOMPARE(fileServiceMock->remove_callCounter(path), 1); } QTEST_MAIN(DeleteImageOperationTests) ksnip-1.9.2/tests/gui/operations/DeleteImageOperationTests.h000066400000000000000000000023771414701001100242000ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_DELETEIMAGEOPERATIONTESTS_H #define KSNIP_DELETEIMAGEOPERATIONTESTS_H #include class DeleteImageOperationTests : public QObject { Q_OBJECT private slots: void Execute_Should_ReturnFalse_When_MessageBoxResponseWasCancel(); void Execute_Should_ReturnTrue_When_MessageBoxResponseWasTrue_And_FileServiceSaveSuccessfully(); void Execute_Should_ReturnFalse_When_MessageBoxResponseWasTrue_And_FileServiceSaveFailed(); }; #endif //KSNIP_DELETEIMAGEOPERATIONTESTS_H ksnip-1.9.2/tests/gui/operations/LoadImageFromFileOperationTests.cpp000066400000000000000000000051551414701001100256310ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "LoadImageFromFileOperationTests.h" #include "src/gui/operations/LoadImageFromFileOperation.h" #include "tests/mocks/ToastServiceMock.h" #include "tests/mocks/ImageProcessorMock.h" #include "tests/mocks/ServiceLocatorMock.h" void LoadImageFromFileOperationTests::Execute_Should_ShowNotificationAndNotOpenImage_When_PathToImageCannotBeOpened() { // arrange ImageProcessorMock imageProcessorMock; ServiceLocatorMock serviceLocatorMock; ToastServiceMock toastServiceMock; serviceLocatorMock.fileService_mock()->openPixmap_set(QPixmap()); LoadImageFromFileOperation operation(&imageProcessorMock, QLatin1String("/path/image.png"), &toastServiceMock, &serviceLocatorMock); // act auto result = operation.execute(); // assert QCOMPARE(result, false); QCOMPARE(imageProcessorMock.processImage_callCounter(), 0); QCOMPARE(serviceLocatorMock.recentImageService_mock()->storeImagePath_callCounter(), 0); QCOMPARE(toastServiceMock.showWarningToast_callCounter(QLatin1String("Unable to open image from path /path/image.png")), 1); } void LoadImageFromFileOperationTests::Execute_Should_OpenImageAndNotShowNotification_When_PathToImageCanBeOpened() { // arrange ImageProcessorMock imageProcessorMock; ServiceLocatorMock serviceLocatorMock; ToastServiceMock toastServiceMock; serviceLocatorMock.fileService_mock()->openPixmap_set(QPixmap(100, 100)); LoadImageFromFileOperation operation(&imageProcessorMock, QLatin1String("/path/image.png"), &toastServiceMock, &serviceLocatorMock); // act auto result = operation.execute(); // assert QCOMPARE(result, true); QCOMPARE(imageProcessorMock.processImage_callCounter(), 1); QCOMPARE(serviceLocatorMock.recentImageService_mock()->storeImagePath_callCounter(QLatin1String("/path/image.png")), 1); QCOMPARE(toastServiceMock.showWarningToast_callCounter(), 0); } QTEST_MAIN(LoadImageFromFileOperationTests) ksnip-1.9.2/tests/gui/operations/LoadImageFromFileOperationTests.h000066400000000000000000000022761414701001100252770ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_LOADIMAGEFROMFILEOPERATIONTESTS_H #define KSNIP_LOADIMAGEFROMFILEOPERATIONTESTS_H #include class LoadImageFromFileOperationTests : public QObject { Q_OBJECT private slots: void Execute_Should_ShowNotificationAndNotOpenImage_When_PathToImageCannotBeOpened(); void Execute_Should_OpenImageAndNotShowNotification_When_PathToImageCanBeOpened(); }; #endif //KSNIP_LOADIMAGEFROMFILEOPERATIONTESTS_H ksnip-1.9.2/tests/mocks/000077500000000000000000000000001414701001100151125ustar00rootroot00000000000000ksnip-1.9.2/tests/mocks/CaptureTabStateHandlerMock.cpp000066400000000000000000000047561414701001100227750ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "CaptureTabStateHandlerMock.h" CaptureTabStateHandlerMock::CaptureTabStateHandlerMock() : mCurrentTabIndex(-1) { } void CaptureTabStateHandlerMock::add(int index, const QString &filename, const QString &path, bool isSaved) { } bool CaptureTabStateHandlerMock::isSaved(int index) { return mIsSaveMap[index]; } bool CaptureTabStateHandlerMock::isPathValid(int index) { return mIsPathValidMap[index]; } QString CaptureTabStateHandlerMock::path(int index) { mPathCallCounter.increment(index); return mPathMap[index]; } QString CaptureTabStateHandlerMock::filename(int index) { return QString(); } void CaptureTabStateHandlerMock::setSaveState(int index, const SaveResultDto &saveResult) { } void CaptureTabStateHandlerMock::renameFile(int index, const RenameResultDto &renameResult) { } int CaptureTabStateHandlerMock::count() const { return 0; } int CaptureTabStateHandlerMock::currentTabIndex() const { return mCurrentTabIndex; } void CaptureTabStateHandlerMock::tabMoved(int fromIndex, int toIndex) { } void CaptureTabStateHandlerMock::currentTabChanged(int index) { } void CaptureTabStateHandlerMock::tabRemoved(int index) { } void CaptureTabStateHandlerMock::currentTabContentChanged() { } void CaptureTabStateHandlerMock::currentTabIndex_set(int index) { mCurrentTabIndex = index; } void CaptureTabStateHandlerMock::path_set(int index, const QString &path) { mPathMap[index] = path; } int CaptureTabStateHandlerMock::path_callCounter(int index) const { return mPathCallCounter.count(index); } void CaptureTabStateHandlerMock::isPathValid_set(int index, bool value) { mIsPathValidMap[index] = value; } void CaptureTabStateHandlerMock::isSaved_set(int index, bool value) { mIsSaveMap[index] = value; } ksnip-1.9.2/tests/mocks/CaptureTabStateHandlerMock.h000066400000000000000000000043231414701001100224300ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_CAPTURETABSTATEHANDLERMOCK_H #define KSNIP_CAPTURETABSTATEHANDLERMOCK_H #include #include "src/gui/captureHandler/ICaptureTabStateHandler.h" #include "tests/utils/CallCounter.h" class CaptureTabStateHandlerMock : public ICaptureTabStateHandler { Q_OBJECT public: explicit CaptureTabStateHandlerMock(); ~CaptureTabStateHandlerMock() override = default; void add(int index, const QString &filename, const QString &path, bool isSaved) override; bool isSaved(int index) override; bool isPathValid(int index) override; QString path(int index) override; QString filename(int index) override; void setSaveState(int index, const SaveResultDto &saveResult) override; void renameFile(int index, const RenameResultDto &renameResult) override; int count() const override; int currentTabIndex() const override; // Mock Methods void currentTabIndex_set(int index); void path_set(int index, const QString &path); int path_callCounter(int index) const; void isPathValid_set(int index, bool value); void isSaved_set(int index, bool value); public slots: void tabMoved(int fromIndex, int toIndex) override; void currentTabChanged(int index) override; void tabRemoved(int index) override; void currentTabContentChanged() override; private: int mCurrentTabIndex; QMap mPathMap; CallCounter mPathCallCounter; QMap mIsPathValidMap; QMap mIsSaveMap; }; #endif //KSNIP_CAPTURETABSTATEHANDLERMOCK_H ksnip-1.9.2/tests/mocks/ClipboardMock.cpp000066400000000000000000000026441414701001100203350ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "ClipboardMock.h" QPixmap ClipboardMock::pixmap() const { return QPixmap(); } bool ClipboardMock::isPixmap() const { return false; } void ClipboardMock::setImage(const QImage &image) { mSetImage = image; } void ClipboardMock::setText(const QString &text) { mSetText = text; } QString ClipboardMock::url() const { return QString(); } int ClipboardMock::setText_callCounter(const QString &text) const { return -1; } int ClipboardMock::setImage_callCounter(const QImage &image) const { return -1; } QImage ClipboardMock::setImage_set() const { return mSetImage; } QString ClipboardMock::setText_get() const { return mSetText; } ksnip-1.9.2/tests/mocks/ClipboardMock.h000066400000000000000000000027661414701001100200070ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_CLIPBOARDMOCK_H #define KSNIP_CLIPBOARDMOCK_H #include #include #include "src/gui/clipboard/IClipboard.h" class ClipboardMock : public IClipboard { Q_OBJECT public: explicit ClipboardMock() = default; ~ClipboardMock() override = default; QPixmap pixmap() const override; bool isPixmap() const override; void setImage(const QImage &image) override; void setText(const QString &text) override; QString url() const override; // Mock Methods int setText_callCounter(const QString &text) const; int setImage_callCounter(const QImage &image) const; QImage setImage_set() const; QString setText_get() const; private: QImage mSetImage; QString mSetText; }; #endif //KSNIP_CLIPBOARDMOCK_H ksnip-1.9.2/tests/mocks/DesktopServiceMock.cpp000066400000000000000000000017251414701001100213670ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "DesktopServiceMock.h" void DesktopServiceMock::openFile(const QString &path) { mOpenFilePath = path; } QUrl DesktopServiceMock::openFile_get() const { return mOpenFilePath; } ksnip-1.9.2/tests/mocks/DesktopServiceMock.h000066400000000000000000000023601414701001100210300ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_DESKTOPSERVICEMOCK_H #define KSNIP_DESKTOPSERVICEMOCK_H #include #include #include "src/gui/desktopService/IDesktopService.h" class DesktopServiceMock : public IDesktopService { public: explicit DesktopServiceMock() = default; ~DesktopServiceMock() override = default; void openFile(const QString &path) override; // Mock Methods QUrl openFile_get() const; private: QString mOpenFilePath; }; #endif //KSNIP_DESKTOPSERVICEMOCK_H ksnip-1.9.2/tests/mocks/FileServiceMock.cpp000066400000000000000000000033531414701001100206340ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "FileServiceMock.h" FileServiceMock::FileServiceMock() : mRemoveResult(false) { } bool FileServiceMock::remove(const QString &path) { mLastRemovePathParameter = path; mRemoveCallCounter.increment(path); return mRemoveResult; } QPixmap FileServiceMock::openPixmap(const QString &path) { mLastOpenPixmapParameter = path; mOpenPixmapCallCounter.increment(path); return mOpenPixmapResult; } QString FileServiceMock::remove_get() const { return mLastRemovePathParameter; } void FileServiceMock::remove_set(bool result) { mRemoveResult = result; } int FileServiceMock::remove_callCounter(const QString &path) const { return mRemoveCallCounter.count(path); } QString FileServiceMock::openPixmap_get() const { return mLastOpenPixmapParameter; } void FileServiceMock::openPixmap_set(const QPixmap &pixmap) { mOpenPixmapResult = pixmap; } int FileServiceMock::openPixmap_callCounter(const QString &path) const { return mOpenPixmapCallCounter.count(path); } ksnip-1.9.2/tests/mocks/FileServiceMock.h000066400000000000000000000032411414701001100202750ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_FILESERVICEMOCK_H #define KSNIP_FILESERVICEMOCK_H #include #include "src/gui/fileService/IFileService.h" #include "tests/utils/CallCounter.h" class FileServiceMock : public IFileService { public: explicit FileServiceMock(); ~FileServiceMock() override = default; bool remove(const QString &path) override; QPixmap openPixmap(const QString &path) override; // Mock Methods QString remove_get() const; void remove_set(bool result); int remove_callCounter(const QString &path) const; QString openPixmap_get() const; void openPixmap_set(const QPixmap &pixmap); int openPixmap_callCounter(const QString &path) const; public: QString mLastRemovePathParameter; bool mRemoveResult; CallCounter mRemoveCallCounter; QString mLastOpenPixmapParameter; QPixmap mOpenPixmapResult; CallCounter mOpenPixmapCallCounter; }; #endif //KSNIP_FILESERVICEMOCK_H ksnip-1.9.2/tests/mocks/ImageAnnotatorMock.cpp000066400000000000000000000072161414701001100213460ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "ImageAnnotatorMock.h" ImageAnnotatorMock::ImageAnnotatorMock() : mHideCallCounter(0) { } QImage ImageAnnotatorMock::image() const { return QImage(); } QImage ImageAnnotatorMock::imageAt(int index) const { auto ptr = const_cast(this); ptr->mImageAtCallCounter.increment(index); return mImageAtMap[index]; } QAction *ImageAnnotatorMock::undoAction() { return nullptr; } QAction *ImageAnnotatorMock::redoAction() { return nullptr; } QSize ImageAnnotatorMock::sizeHint() const { return {}; } void ImageAnnotatorMock::showAnnotator() { } void ImageAnnotatorMock::showCropper() { } void ImageAnnotatorMock::showScaler() { } void ImageAnnotatorMock::showCanvasModifier() { } void ImageAnnotatorMock::showRotator() { } void ImageAnnotatorMock::hide() { mHideCallCounter++; } void ImageAnnotatorMock::close() { } bool ImageAnnotatorMock::isVisible() const { return false; } QWidget *ImageAnnotatorMock::widget() const { return nullptr; } void ImageAnnotatorMock::loadImage(const QPixmap &pixmap) { } int ImageAnnotatorMock::addTab(const QPixmap &pixmap, const QString &title, const QString &toolTip) { return 0; } void ImageAnnotatorMock::updateTabInfo(int index, const QString &title, const QString &toolTip) { } void ImageAnnotatorMock::insertImageItem(const QPointF &position, const QPixmap &pixmap) { } void ImageAnnotatorMock::setSmoothPathEnabled(bool enabled) { } void ImageAnnotatorMock::setSaveToolSelection(bool enabled) { } void ImageAnnotatorMock::setSmoothFactor(int factor) { } void ImageAnnotatorMock::setSwitchToSelectToolAfterDrawingItem(bool enabled) { } void ImageAnnotatorMock::setSelectItemAfterDrawing(bool enabled) { } void ImageAnnotatorMock::setTabBarAutoHide(bool enabled) { } void ImageAnnotatorMock::removeTab(int index) { mRemoveTabCallCounter.increment(index); } void ImageAnnotatorMock::setStickers(const QStringList &stickerPaths, bool keepDefault) { } void ImageAnnotatorMock::addTabContextMenuActions(const QList &actions) { mCustomContextMenuActions = actions; } int ImageAnnotatorMock::imageAt_callCounter(int index) const { return mImageAtCallCounter.count(index); } void ImageAnnotatorMock::imageAt_set(int index, const QImage &image) { mImageAtMap[index] = image; } QList ImageAnnotatorMock::tabContextMenuActions_get() const { return mCustomContextMenuActions; } void ImageAnnotatorMock::tabContextMenuOpened_emit(int index) const { emit tabContextMenuOpened(index); } int ImageAnnotatorMock::removeTab_callCounter(int index) const { return mRemoveTabCallCounter.count(index); } int ImageAnnotatorMock::hide_callCounter() const { return mHideCallCounter; } void ImageAnnotatorMock::setSettingsCollapsed(bool isCollapsed) { } void ImageAnnotatorMock::setNumberToolSeedChangeUpdatesAllItems(bool enabled) { } void ImageAnnotatorMock::setCanvasColor(const QColor &color) { } ksnip-1.9.2/tests/mocks/ImageAnnotatorMock.h000066400000000000000000000061301414701001100210050ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_IMAGEANNOTATORMOCK_H #define KSNIP_IMAGEANNOTATORMOCK_H #include #include #include #include #include #include "src/gui/imageAnnotator/IImageAnnotator.h" #include "tests/utils/CallCounter.h" class ImageAnnotatorMock : public IImageAnnotator { Q_OBJECT public: explicit ImageAnnotatorMock(); ~ImageAnnotatorMock() override = default; QImage image() const override; QImage imageAt(int index) const override; QAction *undoAction() override; QAction *redoAction() override; QSize sizeHint() const override; void showAnnotator() override; void showCropper() override; void setSettingsCollapsed(bool isCollapsed) override; void showScaler() override; void showCanvasModifier() override; void showRotator() override; void hide() override; void close() override; bool isVisible() const override; QWidget* widget() const override; // Mock Methods int imageAt_callCounter(int index) const; void imageAt_set(int index, const QImage &image); QList tabContextMenuActions_get() const; void tabContextMenuOpened_emit(int index) const; int removeTab_callCounter(int index) const; int hide_callCounter() const; public slots: void loadImage(const QPixmap &pixmap) override; int addTab(const QPixmap &pixmap, const QString &title, const QString &toolTip) override; void updateTabInfo(int index, const QString &title, const QString &toolTip) override; void insertImageItem(const QPointF &position, const QPixmap &pixmap) override; void setSmoothPathEnabled(bool enabled) override; void setSaveToolSelection(bool enabled) override; void setSmoothFactor(int factor) override; void setSwitchToSelectToolAfterDrawingItem(bool enabled) override; void setSelectItemAfterDrawing(bool enabled) override; void setNumberToolSeedChangeUpdatesAllItems(bool enabled) override; void setTabBarAutoHide(bool enabled) override; void removeTab(int index) override; void setStickers(const QStringList &stickerPaths, bool keepDefault) override; void addTabContextMenuActions(const QList & actions) override; void setCanvasColor(const QColor &color) override; private: QMap mImageAtMap; CallCounter mImageAtCallCounter; QList mCustomContextMenuActions; CallCounter mRemoveTabCallCounter; int mHideCallCounter; }; #endif //KSNIP_IMAGEANNOTATORMOCK_H ksnip-1.9.2/tests/mocks/ImagePathStorageMock.cpp000066400000000000000000000022671414701001100216230ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "ImagePathStorageMock.h" void ImagePathStorageMock::store(const QString &value, int index) { mStoreCallCounter.increment(index); mPathMap[index] = value; } QString ImagePathStorageMock::load(int index) { return mPathMap[index]; } int ImagePathStorageMock::count() { return mPathMap.count(); } int ImagePathStorageMock::store_callCounter(int index) const { return mStoreCallCounter.count(index); } ksnip-1.9.2/tests/mocks/ImagePathStorageMock.h000066400000000000000000000026051414701001100212640ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_IMAGEPATHSTORAGEMOCK_H #define KSNIP_IMAGEPATHSTORAGEMOCK_H #include #include "src/backend/recentImages/IImagePathStorage.h" #include "tests/utils/CallCounter.h" class ImagePathStorageMock : public IImagePathStorage { public: ImagePathStorageMock() = default; ~ImagePathStorageMock() override = default; void store(const QString &value, int index) override; QString load(int index) override; int count() override; // Mock Methods int store_callCounter(int index) const; private: QMap mPathMap; CallCounter mStoreCallCounter; }; #endif //KSNIP_IMAGEPATHSTORAGEMOCK_H ksnip-1.9.2/tests/mocks/ImageProcessorMock.cpp000066400000000000000000000022271414701001100213550ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "ImageProcessorMock.h" void ImageProcessorMock::processImage(const CaptureDto &capture) { mLastProcessImageParameter = capture; mProcessImageCallCounter.increment(0); } CaptureDto ImageProcessorMock::processImage_get() const { return mLastProcessImageParameter; } int ImageProcessorMock::processImage_callCounter() const { return mProcessImageCallCounter.count(0); } ksnip-1.9.2/tests/mocks/ImageProcessorMock.h000066400000000000000000000025071414701001100210230ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_IMAGEPROCESSORMOCK_H #define KSNIP_IMAGEPROCESSORMOCK_H #include "src/gui/IImageProcessor.h" #include "tests/utils/CallCounter.h" class ImageProcessorMock : public IImageProcessor { public: ImageProcessorMock() = default; ~ImageProcessorMock() = default; void processImage(const CaptureDto &capture) override; // Mock Methods CaptureDto processImage_get() const; int processImage_callCounter() const; private: CaptureDto mLastProcessImageParameter; CallCounter mProcessImageCallCounter; }; #endif //KSNIP_IMAGEPROCESSORMOCK_H ksnip-1.9.2/tests/mocks/MessageBoxServiceMock.cpp000066400000000000000000000030061414701001100220050ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "MessageBoxServiceMock.h" MessageBoxServiceMock::MessageBoxServiceMock() : mOkCancelResult(false), mYesNoResult(false) { } bool MessageBoxServiceMock::yesNo(const QString &title, const QString &question) { return mYesNoResult; } MessageBoxResponse MessageBoxServiceMock::yesNoCancel(const QString &title, const QString &question) { return MessageBoxResponse::Cancel; } void MessageBoxServiceMock::ok(const QString &title, const QString &info) { } bool MessageBoxServiceMock::okCancel(const QString &title, const QString &info) { return mOkCancelResult; } void MessageBoxServiceMock::yesNo_set(bool response) { mYesNoResult = response; } void MessageBoxServiceMock::okCancel_set(bool response) { mOkCancelResult = response; } ksnip-1.9.2/tests/mocks/MessageBoxServiceMock.h000066400000000000000000000030111414701001100214460ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_MESSAGEBOXSERVICEMOCK_H #define KSNIP_MESSAGEBOXSERVICEMOCK_H #include "src/gui/messageBoxService/IMessageBoxService.h" class MessageBoxServiceMock : public IMessageBoxService { public: explicit MessageBoxServiceMock(); ~MessageBoxServiceMock() override = default; bool yesNo(const QString &title, const QString &question) override; MessageBoxResponse yesNoCancel(const QString &title, const QString &question) override; void ok(const QString &title, const QString &info) override; bool okCancel(const QString &title, const QString &info) override; // Mock Methods void yesNo_set(bool response); void okCancel_set(bool response); private: bool mYesNoResult; bool mOkCancelResult; }; #endif //KSNIP_MESSAGEBOXSERVICEMOCK_H ksnip-1.9.2/tests/mocks/RecentImageServiceMock.cpp000066400000000000000000000034241414701001100221370ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "RecentImageServiceMock.h" void RecentImageServiceMock::storeImagePath(const QString &imagePath) { mLastStoreImagePathParameter = imagePath; mStoreImagePathCallCounter.increment(imagePath); } QStringList RecentImageServiceMock::getRecentImagesPath() const { auto ptr = const_cast(this); ptr->mGetRecentImagesPathCallCounter.increment(0); return mGetRecentImagesPathResult; } QString RecentImageServiceMock::storeImagePath_get() const { return mLastStoreImagePathParameter; } int RecentImageServiceMock::storeImagePath_callCounter(const QString &path) const { return mStoreImagePathCallCounter.count(path); } int RecentImageServiceMock::storeImagePath_callCounter() const { return mStoreImagePathCallCounter.count(); } void RecentImageServiceMock::getRecentImagesPath_set(const QStringList &imagePaths) { mGetRecentImagesPathResult = imagePaths; } int RecentImageServiceMock::getRecentImagesPath_callCounter() const { return mGetRecentImagesPathCallCounter.count(0); } ksnip-1.9.2/tests/mocks/RecentImageServiceMock.h000066400000000000000000000032261414701001100216040ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_RECENTIMAGESERVICEMOCK_H #define KSNIP_RECENTIMAGESERVICEMOCK_H #include #include #include "src/backend/recentImages/IRecentImageService.h" #include "tests/utils/CallCounter.h" class RecentImageServiceMock : public IRecentImageService { public: void storeImagePath(const QString &imagePath) override; QStringList getRecentImagesPath() const override; // Mock Methods QString storeImagePath_get() const; int storeImagePath_callCounter(const QString &path) const; int storeImagePath_callCounter() const; void getRecentImagesPath_set(const QStringList &imagePaths); int getRecentImagesPath_callCounter() const; private: QString mLastStoreImagePathParameter; CallCounter mStoreImagePathCallCounter; QStringList mGetRecentImagesPathResult; CallCounter mGetRecentImagesPathCallCounter; }; #endif //KSNIP_RECENTIMAGESERVICEMOCK_H ksnip-1.9.2/tests/mocks/ServiceLocatorMock.cpp000066400000000000000000000043311414701001100213550ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "ServiceLocatorMock.h" ServiceLocatorMock::ServiceLocatorMock() : mMessageBoxServiceMock(new MessageBoxServiceMock), mFileServiceMock(new FileServiceMock), mClipboardMock(new ClipboardMock), mDesktopServiceMock(new DesktopServiceMock), mRecentImageServiceMock(new RecentImageServiceMock) { } ServiceLocatorMock::~ServiceLocatorMock() { delete mMessageBoxServiceMock; delete mFileServiceMock; delete mClipboardMock; delete mDesktopServiceMock; delete mRecentImageServiceMock; } IMessageBoxService *ServiceLocatorMock::messageBoxService() const { return mMessageBoxServiceMock; } IFileService *ServiceLocatorMock::fileService() const { return mFileServiceMock; } IClipboard *ServiceLocatorMock::clipboard() const { return mClipboardMock; } IDesktopService *ServiceLocatorMock::desktopService() const { return mDesktopServiceMock; } IRecentImageService *ServiceLocatorMock::recentImageService() const { return mRecentImageServiceMock; } MessageBoxServiceMock *ServiceLocatorMock::messageBoxService_mock() const { return mMessageBoxServiceMock; } FileServiceMock *ServiceLocatorMock::fileService_mock() const { return mFileServiceMock; } ClipboardMock *ServiceLocatorMock::clipboard_mock() const { return mClipboardMock; } DesktopServiceMock *ServiceLocatorMock::desktopService_mock() const { return mDesktopServiceMock; } RecentImageServiceMock *ServiceLocatorMock::recentImageService_mock() const { return mRecentImageServiceMock; } ksnip-1.9.2/tests/mocks/ServiceLocatorMock.h000066400000000000000000000037651414701001100210340ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_SERVICELOCATORMOCK_H #define KSNIP_SERVICELOCATORMOCK_H #include "src/gui/serviceLocator/IServiceLocator.h" #include "tests/mocks/MessageBoxServiceMock.h" #include "tests/mocks/FileServiceMock.h" #include "tests/mocks/ClipboardMock.h" #include "tests/mocks/DesktopServiceMock.h" #include "tests/mocks/RecentImageServiceMock.h" class ServiceLocatorMock : public IServiceLocator { public: explicit ServiceLocatorMock(); ~ServiceLocatorMock() override; IMessageBoxService* messageBoxService() const override; IFileService* fileService() const override; IClipboard* clipboard() const override; IDesktopService* desktopService() const override; IRecentImageService* recentImageService() const override; // Mock Methods MessageBoxServiceMock* messageBoxService_mock() const; FileServiceMock* fileService_mock() const; ClipboardMock* clipboard_mock() const; DesktopServiceMock* desktopService_mock() const; RecentImageServiceMock* recentImageService_mock() const; private: MessageBoxServiceMock *mMessageBoxServiceMock; FileServiceMock *mFileServiceMock; ClipboardMock *mClipboardMock; DesktopServiceMock *mDesktopServiceMock; RecentImageServiceMock *mRecentImageServiceMock; }; #endif //KSNIP_SERVICELOCATORMOCK_H ksnip-1.9.2/tests/mocks/ToastServiceMock.cpp000066400000000000000000000040211414701001100210400ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "ToastServiceMock.h" void ToastServiceMock::showInfoToast(const QString &title, const QString &message, const QString &contentUrl) { mShowInfoToastCallCounter.increment(message); } void ToastServiceMock::showWarningToast(const QString &title, const QString &message, const QString &contentUrl) { mShowWarningToastCallCounter.increment(message); } void ToastServiceMock::showCriticalToast(const QString &title, const QString &message, const QString &contentUrl) { mShowCriticalToastCallCounter.increment(message); } int ToastServiceMock::showInfoToast_callCounter(const QString &message) const { return mShowInfoToastCallCounter.count(message); } int ToastServiceMock::showInfoToast_callCounter() const { return mShowInfoToastCallCounter.count(); } int ToastServiceMock::showWarningToast_callCounter(const QString &message) const { return mShowWarningToastCallCounter.count(message); } int ToastServiceMock::showWarningToast_callCounter() const { return mShowWarningToastCallCounter.count(); } int ToastServiceMock::showCriticalToast_callCounter(const QString &message) const { return mShowCriticalToastCallCounter.count(message); } int ToastServiceMock::showCriticalToast_callCounter() const { return mShowCriticalToastCallCounter.count(); } ksnip-1.9.2/tests/mocks/ToastServiceMock.h000066400000000000000000000035101414701001100205070ustar00rootroot00000000000000/* * Copyright (C) 2021 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_TOASTSERVICEMOCK_H #define KSNIP_TOASTSERVICEMOCK_H #include #include "src/gui/IToastService.h" #include "tests/utils/CallCounter.h" class ToastServiceMock : public IToastService { public: void showInfoToast(const QString &title, const QString &message, const QString &contentUrl) override; void showWarningToast(const QString &title, const QString &message, const QString &contentUrl) override; void showCriticalToast(const QString &title, const QString &message, const QString &contentUrl) override; // Mock Methods int showInfoToast_callCounter(const QString &message) const; int showInfoToast_callCounter() const; int showWarningToast_callCounter(const QString &message) const; int showWarningToast_callCounter() const; int showCriticalToast_callCounter(const QString &message) const; int showCriticalToast_callCounter() const; private: CallCounter mShowInfoToastCallCounter; CallCounter mShowWarningToastCallCounter; CallCounter mShowCriticalToastCallCounter; }; #endif //KSNIP_TOASTSERVICEMOCK_H ksnip-1.9.2/tests/utils/000077500000000000000000000000001414701001100151365ustar00rootroot00000000000000ksnip-1.9.2/tests/utils/CallCounter.cpp000066400000000000000000000014631414701001100200610ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "CallCounter.h" ksnip-1.9.2/tests/utils/CallCounter.h000066400000000000000000000032201414701001100175170ustar00rootroot00000000000000/* * Copyright (C) 2020 Damir Porobic * * 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 2 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KSNIP_CALLCOUNTER_H #define KSNIP_CALLCOUNTER_H #include #include template class CallCounter { public: explicit CallCounter() = default; ~CallCounter() = default; void increment(K key); int count(K key) const; int count() const; private: QList> mInnerCounter; }; template void CallCounter::increment(K key) { for(auto entry : mInnerCounter) { if(entry.first == key) { entry.second++; return; } } mInnerCounter.append(QPair(key,1)); } template int CallCounter::count(K key) const { for(auto entry : mInnerCounter) { if(entry.first == key) { return entry.second; } } return 0; } template int CallCounter::count() const { int counter = 0; for(auto entry : mInnerCounter) { counter += entry.second; } return counter; } #endif //KSNIP_CALLCOUNTER_H ksnip-1.9.2/translations/000077500000000000000000000000001414701001100153555ustar00rootroot00000000000000ksnip-1.9.2/translations/CMakeLists.txt000066400000000000000000000015471414701001100201240ustar00rootroot00000000000000find_package(Qt5LinguistTools) set(KSNIP_LANG_TS ksnip_ar.ts ksnip_bn_BD.ts ksnip_cs.ts ksnip_da.ts ksnip_de.ts ksnip_el.ts ksnip_es.ts ksnip_eu.ts ksnip_fa.ts ksnip_fi.ts ksnip_fr.ts ksnip_fr_CA.ts ksnip_gl.ts ksnip_hr.ts ksnip_hu.ts ksnip_id.ts ksnip_it.ts ksnip_ja.ts ksnip_ko.ts ksnip_nl.ts ksnip_no.ts ksnip_pl.ts ksnip_pt.ts ksnip_pt_BR.ts ksnip_ro.ts ksnip_ru.ts ksnip_si.ts ksnip_sv.ts ksnip_tr.ts ksnip_uk.ts ksnip_zh_CN.ts) if (DEFINED UPDATE_TS_FILES) qt5_create_translation(KSNIP_LANG_QM ${CMAKE_SOURCE_DIR}/translations ${KSNIP_SRCS} ${KSNIP_LANG_TS} OPTIONS "-no-obsolete") else () qt5_add_translation(KSNIP_LANG_QM ${KSNIP_LANG_TS}) endif () add_custom_target(translations ALL DEPENDS ${KSNIP_LANG_QM}) install(FILES ${KSNIP_LANG_QM} DESTINATION ${KSNIP_LANG_INSTALL_DIR}) ksnip-1.9.2/translations/ksnip_ar.ts000066400000000000000000001524711414701001100175450ustar00rootroot00000000000000 AboutDialog About عن البرنامج About عن البرنامج Version الإصدار Author المؤلف Close إغلاق Donate تبرع Contact توصال AboutTab License: الرخصة Screenshot and Annotation Tool لقطة الشاشة وأدوات التوضيح ActionSettingTab Name الاسم Shortcut اختصار Clear مسح Take Capture التقط صورة Include Cursor اشمل مؤشر الفأرة Delay تأخير التقاط الشاشة s Capture Mode وضع التقاط الشاشة Show image in Pin Window ثبت الصورة الملتقطة في نافذة Copy image to Clipboard انسخ الصورة Upload image ارفع الصورة Open image parent directory افتح مجلد الصورة Save image احفظ الصورة Hide Main Window اخفي النافذة الرئيسية ActionsSettings Add أضف Actions Settings إعدادات الإجراءات Action الإجراء AddWatermarkOperation Watermark Image Required العلامة المائية مطلوبة Please add a Watermark Image via Options > Settings > Annotator > Update الرجاء أفاضة صورة العلامة المائية عن طريق إختيارات > إعدادت > أداة التوضيع > تحديث AnnotationSettings Smooth Painter Paths مؤشر رسم سلس When enabled smooths out pen and marker paths after finished drawing. Smooth Factor عامل سلس Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. زيادة عامل السلاسة سينقص دقة القلم ولكن سيجعل خطوط الرسم سلسة Annotator Settings إعدادات علامات التوضيح Remember annotation tool selection and load on startup تذكر أداة التوضيح المختارة وحملها عند بدئ التشغيل Switch to Select Tool after drawing Item انتقل إلى أداة الاختيار بعد رسم العنصر Number Tool Seed change updates all Number Items تحديث جميع الأرقام في أداة الترقيم Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. تعطيل هذا الاختيار يغير تحديث الترقيم تشمل العناصر الجديدة فقط. تعطيل هذا الاختيار يسمح بوجود ترقيم مكررز Canvas Color Default Canvas background color for annotation area. Changing color affects only new annotation areas. Select Item after drawing اختر العنصر بعد الرسم With this option enabled the item gets selected after being created, allowing changing settings. تفعيل هذا الاختيار يقوم باختيار العنصر بعد انشاءه, للسماح بتغير اعداداته. ApplicationSettings Capture screenshot at startup with default mode التقط الشاشة عند بدئ التشغيل بالوضع الافتراضي Application Style تصميم التطبيق Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. Application Settings إعدادات البرنامج Automatically copy new captures to clipboard انسخ الصورة الملتقطة تلقائيا Use Tabs Change requires restart. التغير يتطلب إعادة تشغيل البرنامج لتفعيله. Run ksnip as single instance Hide Tabbar when only one Tab is used. Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. Remember Main Window position on move and load on startup تذكر مكان الشاشة الرئيسية عند تحريكها وحملها عند بدئ التشغيل Auto hide Tabs اخف التبويب تلقائيا Auto hide Docks On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. Auto resize to content Automatically resize Main Window to fit content image. AuthorTab Contributors: المساهمون: Spanish Translation الترجمة الأسبانية Dutch Translation الترجمة الهولندية Russian Translation الترجمة الروسية Norwegian Bokmål Translation الترجمة النرويجية French Translation الترجمة الفرنسية Polish Translation الترجمة البوليندية Snap & Flatpak Support دعم Snap و Flatpak The Authors: المؤلف: CanDiscardOperation Warning - تحذير- The capture %1%2%3 has been modified. Do you want to save it? تم التعديل على الصورة الملتقطة %1%2%3 هل تريد حفظ التعديلات؟ CaptureModePicker New جديد Draw a rectangular area with your mouse ارسم مربع بالفأرة Capture full screen including all monitors التقط صورة لكامل الشاشة ولجميع الشاشات Capture screen where the mouse is located التقط صورة للشاشة تحت مؤشر الفأرة Capture window that currently has focus التقط صورة للنافذة المفعلة Capture that is currently under the mouse cursor Capture a screenshot of the last selected rectangular area Uses the screenshot Portal for taking screenshot ContactTab Community If you have general questions, ideas or just want to talk about ksnip, please join our server. Bug Reports Please use to report bugs. ابلغ عن المشاكل. CopyAsDataUriOperation Failed to copy to clipboard فشل في نسخ الصورة الملتقطة Failed to copy to clipboard as base64 encoded image. فشل في نسخة الصورة بترميز Base64. Copied to clipboard تم النسخ Copied to clipboard as base64 encoded image. تم نسخ الصورة كترميز Base64. DeleteImageOperation Delete Image امسح الصورة The item '%1' will be deleted. Do you want to continue? DonateTab here هنا Also possible, ممكن أيضا Donations are always welcome التبرع مرحب بها دوما Donation تبرع Become a GitHub Sponsor كن راع لنا على GitHub ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. EnumTranslator Rectangular Area Last Rectangular Area Full Screen (All Monitors) Current Screen Active Window Window Under Cursor Screenshot Portal HandleUploadResultOperation Upload Successful Upload script finished successfully. Uploaded to Unable to save temporary image for upload. Unable to start process, check path and permissions. Process crashed Process timed out. Process read error. Process write error. Web error, check console output. Unknown process error. Upload Failed Script wrote to StdErr. HotKeySettings Enable Global HotKeys Capture Rect Area Capture Full Screen Capture current Screen Capture active Window Capture Window under Cursor Global HotKeys Capture Last Rect Area Clear Capture using Portal HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. ImageGrabberSettings Capture mouse cursor on screenshot Should mouse cursor be visible on screenshots. Image Grabber Force Generic Wayland Screenshot Scale Generic Wayland Screenshots Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. Show Main Window after capturing screenshot Hide Main Window during screenshot Hide Main Window when capturing a new screenshot. Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. ImgurHistoryDialog Imgur History Close Time Stamp Link Delete Link ImgurUploader Upload to imgur.com finished! Received new token, trying upload again… Imgur token has expired, requesting new token… ImgurUploaderSettings Force anonymous upload Always copy Imgur link to clipboard Client ID Client Secret PIN Enter imgur Pin which will be exchanged for a token. Get PIN Get Token Imgur History Imgur Uploader Username Waiting for imgur.com… Imgur.com token successfully updated. Imgur.com token update error. After uploading open Imgur link in default browser Link directly to image Base Url: Base url that will be used for communication with Imgur. Changing requires restart. Clear Token LoadImageFromFileOperation Unable to open image Unable to open image from path %1 MainToolBar New Delay in seconds between triggering and capturing screenshot. s Save Save Screen Capture to file system Copy Copy Screen Capture to clipboard Tools Undo Redo Crop Crop Screen Capture MainWindow Unsaved Upload Print Opens printer dialog and provide option to print image Print Preview Opens Print Preview dialog where the image orientation can be changed Scale Quit Settings &About Open &Edit &Options &Help Image Files (*.png *.jpg *.bmp) Add Watermark Add Watermark to captured image. Multiple watermarks can be added. &File Unable to show image Save As... Paste Paste Embedded Pin Pin screenshot to foreground in frameless window No image provided but one was expected. Copy Path Open Directory &View Delete Rename Open Images Show Docks Hide Docks Copy as data URI Open &Recent Modify Canvas Upload triggerCapture to external source Copy triggerCapture to system clipboard Scale Image Rotate Rotate Image MultiCaptureHandler Save Save As Open Directory Copy Copy Path Delete Rename NewCaptureNameProvider Capture PinWindow Close Close Other Close All PinWindowHandler Pin Window %1 RenameOperation Image Renamed Successfully renamed image to Image Rename Failed Failed to rename image to Rename image New filename: SaveOperation Save As Images All Files Image Saved Saving Image Failed Saved to Failed to save image to SaverSettings Automatically save new captures to default location Prompt to save before discarding unsaved changes Remember last Save Directory When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. Capture save location and filename Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. Browse Saver Settings Capture save location Default Factor Save Quality Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. ScriptUploaderSettings Copy script output to clipboard Script: Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. Browse Script Uploader Select Upload Script Stop when upload script writes to StdErr Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. Filter: RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. SettingsDialog Settings OK Cancel Image Grabber Imgur Uploader Application Annotator HotKeys Uploader Script Uploader Saver Stickers Snipping Area Tray Icon Watermark Actions SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Use arrow keys to move the selection. Use arrow keys while pressing CTRL to move top left handle. Use arrow keys while pressing ALT to move bottom right handle. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. This message can be disabled via settings. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Hold CTRL pressed to resize selection after selecting. Hold CTRL pressed to prevent resizing after selecting. Operation will be canceled after 60 sec when no selection made. This message can be disabled via settings. SnippingAreaSettings Freeze Image while snipping When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. Show magnifying glass on snipping area Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. Show Snipping Area rulers Horizontal and vertical lines going from desktop edges to cursor on snipping area. Show Snipping Area position and size info When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. Allow resizing rect area selection by default When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. Show Snipping Area info text Snipping Area cursor color Sets the color of the snipping area cursor. Snipping Area cursor thickness Sets the thickness of the snipping area cursor. Snipping Area Snipping Area adorner color Sets the color of all adorner elements on the snipping area. Snipping Area Transparency Alpha for not selected region on snipping area. Smaller number is more transparent. StickerSettings Up Down Use Default Stickers Sticker Settings Vector Image Files (*.svg) Add Remove Add Stickers TrayIcon Show Editor TrayIconSettings Use Tray Icon When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. Minimize to Tray Start Minimized to Tray Close to Tray Show Editor Capture Default Tray Icon action Default Action that is triggered by left clicking the tray icon. Tray Icon Settings Display Tray icon notifications Use platform specific notification service When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. UpdateWatermarkOperation Select Image Images All Files UploadOperation Upload Script Required Please add an upload script via Options > Settings > Upload Script Capture Upload You are about to upload the image to an external destination, do you want to proceed? UploaderSettings Ask for confirmation before uploading Uploader Type: Imgur Script Uploader VersionTab Version Build Using: WatermarkSettings Watermark Image Update Rotate Watermark When enabled, Watermark will be added with a rotation of 45° Watermark Settings ksnip-1.9.2/translations/ksnip_bn_BD.ts000066400000000000000000001501031414701001100200750ustar00rootroot00000000000000 AboutDialog About সম্পর্কে About সম্পর্কে Version ভার্সন Author প্রোগ্রামার Close বন্ধ করুন Donate অনুদান করুন Contact AboutTab License: লাইসেন্স Screenshot and Annotation Tool ActionSettingTab Name Shortcut Clear Take Capture Include Cursor Delay s Capture Mode Show image in Pin Window Copy image to Clipboard Upload image Open image parent directory Save image Hide Main Window ActionsSettings Add Actions Settings Action AddWatermarkOperation Watermark Image Required ওয়াটারমার্ক দেয়ার ছবি লাগবে Please add a Watermark Image via Options > Settings > Annotator > Update AnnotationSettings Smooth Painter Paths When enabled smooths out pen and marker paths after finished drawing. Smooth Factor Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. Annotator Settings Remember annotation tool selection and load on startup Switch to Select Tool after drawing Item Number Tool Seed change updates all Number Items Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. Canvas Color Default Canvas background color for annotation area. Changing color affects only new annotation areas. Select Item after drawing With this option enabled the item gets selected after being created, allowing changing settings. ApplicationSettings Capture screenshot at startup with default mode Application Style Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. Application Settings Automatically copy new captures to clipboard Use Tabs Change requires restart. Run ksnip as single instance Hide Tabbar when only one Tab is used. Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. Remember Main Window position on move and load on startup Auto hide Tabs Auto hide Docks On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. Auto resize to content Automatically resize Main Window to fit content image. AuthorTab Contributors: Spanish Translation Dutch Translation Russian Translation Norwegian Bokmål Translation French Translation Polish Translation Snap & Flatpak Support The Authors: CanDiscardOperation Warning - The capture %1%2%3 has been modified. Do you want to save it? CaptureModePicker New Draw a rectangular area with your mouse Capture full screen including all monitors Capture screen where the mouse is located Capture window that currently has focus Capture that is currently under the mouse cursor Capture a screenshot of the last selected rectangular area Uses the screenshot Portal for taking screenshot ContactTab Community If you have general questions, ideas or just want to talk about ksnip, please join our server. Bug Reports Please use দয়া করে ব্যবহার করুন to report bugs. ত্রুটি রিপোর্ট করতে CopyAsDataUriOperation Failed to copy to clipboard Failed to copy to clipboard as base64 encoded image. Copied to clipboard Copied to clipboard as base64 encoded image. DeleteImageOperation Delete Image The item '%1' will be deleted. Do you want to continue? DonateTab here Also possible, Donations are always welcome Donation Become a GitHub Sponsor ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. EnumTranslator Rectangular Area Last Rectangular Area Full Screen (All Monitors) Current Screen Active Window Window Under Cursor Screenshot Portal HandleUploadResultOperation Upload Successful Upload script finished successfully. Uploaded to Unable to save temporary image for upload. Unable to start process, check path and permissions. Process crashed Process timed out. Process read error. Process write error. Web error, check console output. Unknown process error. Upload Failed Script wrote to StdErr. HotKeySettings Enable Global HotKeys Capture Rect Area Capture Full Screen Capture current Screen Capture active Window Capture Window under Cursor Global HotKeys Capture Last Rect Area Clear Capture using Portal HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. ImageGrabberSettings Capture mouse cursor on screenshot Should mouse cursor be visible on screenshots. Image Grabber Force Generic Wayland Screenshot Scale Generic Wayland Screenshots Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. Show Main Window after capturing screenshot Hide Main Window during screenshot Hide Main Window when capturing a new screenshot. Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. ImgurHistoryDialog Imgur History Close বন্ধ করুন Time Stamp Link Delete Link ImgurUploader Upload to imgur.com finished! Received new token, trying upload again… Imgur token has expired, requesting new token… ImgurUploaderSettings Force anonymous upload Always copy Imgur link to clipboard Client ID Client Secret PIN Enter imgur Pin which will be exchanged for a token. Get PIN Get Token Imgur History Imgur Uploader Username Waiting for imgur.com… Imgur.com token successfully updated. Imgur.com token update error. After uploading open Imgur link in default browser Link directly to image Base Url: Base url that will be used for communication with Imgur. Changing requires restart. Clear Token LoadImageFromFileOperation Unable to open image Unable to open image from path %1 MainToolBar New Delay in seconds between triggering and capturing screenshot. s Save Save Screen Capture to file system Copy Copy Screen Capture to clipboard Tools Undo Redo Crop Crop Screen Capture MainWindow Unsaved Upload Print Opens printer dialog and provide option to print image Print Preview Opens Print Preview dialog where the image orientation can be changed Scale Quit Settings &About Open &Edit &Options &Help Image Files (*.png *.jpg *.bmp) Add Watermark Add Watermark to captured image. Multiple watermarks can be added. &File Unable to show image Save As... Paste Paste Embedded Pin Pin screenshot to foreground in frameless window No image provided but one was expected. Copy Path Open Directory &View Delete Rename Open Images Show Docks Hide Docks Copy as data URI Open &Recent Modify Canvas Upload triggerCapture to external source Copy triggerCapture to system clipboard Scale Image Rotate Rotate Image MultiCaptureHandler Save Save As Open Directory Copy Copy Path Delete Rename NewCaptureNameProvider Capture PinWindow Close বন্ধ করুন Close Other Close All PinWindowHandler Pin Window %1 RenameOperation Image Renamed Successfully renamed image to Image Rename Failed Failed to rename image to Rename image New filename: SaveOperation Save As Images All Files Image Saved Saving Image Failed Saved to Failed to save image to SaverSettings Automatically save new captures to default location Prompt to save before discarding unsaved changes Remember last Save Directory When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. Capture save location and filename Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. Browse Saver Settings Capture save location Default Factor Save Quality Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. ScriptUploaderSettings Copy script output to clipboard Script: Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. Browse Script Uploader Select Upload Script Stop when upload script writes to StdErr Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. Filter: RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. SettingsDialog Settings OK Cancel Image Grabber Imgur Uploader Application Annotator HotKeys Uploader Script Uploader Saver Stickers Snipping Area Tray Icon Watermark Actions SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Use arrow keys to move the selection. Use arrow keys while pressing CTRL to move top left handle. Use arrow keys while pressing ALT to move bottom right handle. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. This message can be disabled via settings. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Hold CTRL pressed to resize selection after selecting. Hold CTRL pressed to prevent resizing after selecting. Operation will be canceled after 60 sec when no selection made. This message can be disabled via settings. SnippingAreaSettings Freeze Image while snipping When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. Show magnifying glass on snipping area Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. Show Snipping Area rulers Horizontal and vertical lines going from desktop edges to cursor on snipping area. Show Snipping Area position and size info When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. Allow resizing rect area selection by default When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. Show Snipping Area info text Snipping Area cursor color Sets the color of the snipping area cursor. Snipping Area cursor thickness Sets the thickness of the snipping area cursor. Snipping Area Snipping Area adorner color Sets the color of all adorner elements on the snipping area. Snipping Area Transparency Alpha for not selected region on snipping area. Smaller number is more transparent. StickerSettings Up Down Use Default Stickers Sticker Settings Vector Image Files (*.svg) Add Remove Add Stickers TrayIcon Show Editor TrayIconSettings Use Tray Icon When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. Minimize to Tray Start Minimized to Tray Close to Tray Show Editor Capture Default Tray Icon action Default Action that is triggered by left clicking the tray icon. Tray Icon Settings Display Tray icon notifications Use platform specific notification service When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. UpdateWatermarkOperation Select Image Images All Files UploadOperation Upload Script Required Please add an upload script via Options > Settings > Upload Script Capture Upload You are about to upload the image to an external destination, do you want to proceed? UploaderSettings Ask for confirmation before uploading Uploader Type: Imgur Script Uploader VersionTab Version ভার্সন Build Using: WatermarkSettings Watermark Image Update Rotate Watermark When enabled, Watermark will be added with a rotation of 45° Watermark Settings ksnip-1.9.2/translations/ksnip_cs.ts000066400000000000000000001652201414701001100175440ustar00rootroot00000000000000 AboutDialog About O aplikaci About O aplikaci Version Verze Author Autor Close Zavřít Donate Podpořit vývoj darem Contact AboutTab License: Licence: Screenshot and Annotation Tool ActionSettingTab Name Název Shortcut Zkratka Clear Vymazat Take Capture Zachytit Include Cursor Včetně kurzoru Delay Zpoždění s s Capture Mode Režim Zachycení Show image in Pin Window Copy image to Clipboard Zkopírovat obrázek do schránky Upload image Nahrát obrázek Open image parent directory Otevřít nadřazený adresář obrázku Save image Uložit obrázek Hide Main Window ActionsSettings Add Přidat Actions Settings Nastavení akcí Action Akce AddWatermarkOperation Watermark Image Required Je vyžadován obrázek vodoznaku Please add a Watermark Image via Options > Settings > Annotator > Update Přidejte obrázek vodoznaku přes Možnosti> Nastavení> Značkovač> Aktualizovat AnnotationSettings Smooth Painter Paths Vyhlazovat cesty kreslení When enabled smooths out pen and marker paths after finished drawing. Pokud je povoleno, vyhlazuje čáry pera a cesty zvýrazňovačů po dokončení kreslení. Smooth Factor Síla vyhlazení Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. Zvýšením síly vyhlazení se sníží přesnost pera a značkovače, ale bude je více vyhlazovat. Annotator Settings Nastavení značkovače Remember annotation tool selection and load on startup Zapamatovat výběr anotačního nástroje a nahrát jej při startu Switch to Select Tool after drawing Item Přepnout do Nástroje pro výběr po nakreslení položky Number Tool Seed change updates all Number Items Změna nástroje pro číslování aktualizuje všechny číselné položky Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. Zakázání této možnosti způsobí, že změny nástroje pro číslování ovlivní pouze nové položky, ne však ty existující. Zakázání této možniosti povolí duplicitní číslování. Canvas Color Barva plátna Default Canvas background color for annotation area. Changing color affects only new annotation areas. Výchozí barva pozadí plátna pro oblast poznámek. Změna barvy ovlivní pouze nové oblasti anotací. Select Item after drawing With this option enabled the item gets selected after being created, allowing changing settings. ApplicationSettings Capture screenshot at startup with default mode Zachytit snímek obrazovky při spuštění ve výchozím režimu Application Style Styl aplikace Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. Nastavuje styl aplikace, který definuje vzhled GUI. Změna vyžaduje restartování aplikace. Application Settings Nastavení aplikace Automatically copy new captures to clipboard Automaticky kopírovat nové snímky do schránky Use Tabs Použít karty Change requires restart. Změna vyžaduje restart. Run ksnip as single instance Spustit ksnip v jedné instanci Hide Tabbar when only one Tab is used. Skrýt panel karet, pokud je použita pouze jedna karta. Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. Povolení této možnosti umožní spuštění pouze jedné instance ksnip, všechny ostatní instance spuštěné poté předají svoje argumenty první instanci. Změna této možnosti vyžaduje restart všech instancí. Remember Main Window position on move and load on startup Zapamatovat pozici hlavního okna a načíst ji při startu aplikace Auto hide Tabs Automaticky skrývat karty Auto hide Docks Automaticky skrýt doky On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. Při spuštění skrýt panel nástrojů a Nastavení poznámek. Viditelnost doků lze přepínat pomocí klávesy Tabulátor. Auto resize to content Automaticky změnit velikost podle obsahu Automatically resize Main Window to fit content image. Automaticky změnit velikost hlavního okna podle velikosti obrázku. AuthorTab Contributors: Přispěvatelé: Spanish Translation Španělský překlad Dutch Translation Holandský překlad Russian Translation Ruský překlad Norwegian Bokmål Translation Překlad do norštiny v bokmålu French Translation Francouzský překlad Polish Translation Polský překlad Snap & Flatpak Support Podpora distribuce pomocí Snap & Flatpak The Authors: Autoři: CanDiscardOperation Warning - Varování - The capture %1%2%3 has been modified. Do you want to save it? Zachycen í% 1% 2% 3 bylo upraveno. Chcete změny uložit? CaptureModePicker New Nový Draw a rectangular area with your mouse Nakreslete obdélníkovou oblast pomocí myši Capture a screenshot of the last selected rectangular area Zachytit snímek obrazovky poslední vybrané obdélníkové plochy Capture full screen including all monitors Zachytit celou obrazovku včetně všech monitorů Capture screen where the mouse is located Zachyťte obrazovku, kde se nachází myš Capture window that currently has focus Zachytit okno, které je v tuto chvíli zaměřeno Capture that is currently under the mouse cursor Zachycení okna, které je aktuálně pod kurzorem myši Uses the screenshot Portal for taking screenshot Používá Portál snímků obrazovky pro pořizování snímků obrazovky ContactTab Community If you have general questions, ideas or just want to talk about ksnip, please join our server. Bug Reports Please use Použijte prosím to report bugs. pro hlášení chyb. CopyAsDataUriOperation Failed to copy to clipboard Kopírování do schránky se nezdařilo Failed to copy to clipboard as base64 encoded image. Nezdařilo se kopírování base64 kodováného obrázku do schránky. Copied to clipboard zkopírovat do schránky Copied to clipboard as base64 encoded image. Zkopírováno do schránky jako base64 kódovaný obrázek. DeleteImageOperation Delete Image Smazat obrázek The item '%1' will be deleted. Do you want to continue? Položka %1 bude odstraněna. Chcete pokračovat? DonateTab here tady Also possible, Je také možné, Donations are always welcome Dary jsou vždy vítány Donation Sponzorský dar Become a GitHub Sponsor Staňte se sponzorem GitHub ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. ksnip je neziskový softwarový projekt copylefted libre a <br/> má však stále určité náklady, které je třeba pokrýt, <br/> jedná se o náklady na doménu nebo náklady na hardware pro podporu mezi platformami. If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that Pokud chcete pomoci nebo jen <br/> ocenit práci <br/> vývojářů kávou či pivem, můžete to udělat EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. Nové akce přidáte stisknutím tlačítka na kartě "Přidat". EnumTranslator Rectangular Area Obdélníková oblast Last Rectangular Area Poslední obdélníková oblast Full Screen (All Monitors) Celá obrazovka (všechny monitory) Current Screen Aktuální obrazovka Active Window Aktivní okno Window Under Cursor Okno pod kurzorem Screenshot Portal Portál snímků obrazovky HandleUploadResultOperation Upload Successful Odeslání proběhlo úspěšně Upload script Nahrávací skript finished successfully. úspěšně dokončen. Uploaded to Odesláno do Unable to save temporary image for upload. Nelze uložit dočasný obrázek pro nahrání. Unable to start process, check path and permissions. Nelze spustit proces, zkontrolujte cestu a oprávnění. Process crashed Proces selhal Process timed out. Proces vypršel. Process read error. Chyba čtení procesu. Process write error. Chyba zápisu procesu. Web error, check console output. Chyba webu, zkontrolujte výstup konzoly. Unknown process error. Neznámá chyba procesu. Upload Failed Nahrání se nezdařilo Script wrote to StdErr. Skript zapisoval do StdErr. HotKeySettings Enable Global HotKeys Povolit globální klávesové zkratky Capture Rect Area Zachytit oblast obdélníku Capture Last Rect Area Zachytit poslední oblast obdélníku Capture Full Screen Zachytit celou obrazovku Capture current Screen Zachytit aktuální obrazovku Capture active Window Zachytit aktivní okno Capture Window under Cursor Zachytit okno pod kurzorem Global HotKeys Globální klávesové zkratky Clear Vymazat Capture using Portal Zachycení pomocí portálu HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. ImageGrabberSettings Capture mouse cursor on screenshot Zachytit kurzor myši na snímku Should mouse cursor be visible on screenshots. Kurzor myši bude viditelný na snímku obrazovky. Image Grabber Snímkování Force Generic Wayland Screenshot Vynutit obecný snímek obrazovky Wayland Scale Generic Wayland Screenshots Škálování obecných snímků obrazovky Wayland Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. Generické implementace Wayland, které používají XDG-DESKTOP-PORTAL ošetřují měřítko obrazovky rozdílným způsobem. Povolení této možnosti bude určeno aktuální měřítko obrazovky a aplikováno na snímek obrazovky v ksnip. GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. GNOME and KDE Plasma podporují pro Wayland a Generic XDG-DESKTOP-PORTAL jejich vlastní snímkování obrazovky. Zapnutí této možnosti přinutí KDE Plasma a GNOME použít XDG-DESKTOP-PORTAL snímkování obrazovky. Změna tohoto nastavení se projeví po restartu ksnip. Show Main Window after capturing screenshot Zobrazit hlavní okno po pořízení snímku obrazovky Hide Main Window during screenshot Skrýt hlavní okno během snímku obrazovky Hide Main Window when capturing a new screenshot. Skrýt hlavní okno při pořizování nového snímku obrazovky. Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. ImgurHistoryDialog Imgur History Historie Imgur Close Zavřít Time Stamp Časové razítko Link Odkaz Delete Link Odstranit odkaz ImgurUploader Upload to imgur.com finished! Nahrávání na imgur.com dokončeno! Received new token, trying upload again… Byl přijat nový token, zkouším znovu odeslat … Imgur token has expired, requesting new token… Platnost tokenu imgur vypršela, žádání o nový token… ImgurUploaderSettings Force anonymous upload Vynutit anonymní odesílání After uploading open Imgur link in default browser Po odeslání otevřít odkaz Imgur ve výchozím prohlížeči Always copy Imgur link to clipboard Vždy kopírovat odkaz Imgur do schránky Client ID ID klienta Client Secret Heslo klienta PIN PIN Enter imgur Pin which will be exchanged for a token. Zadejte PIN Imgur, který bude vyměněn za token. Get PIN Získat PIN Get Token Získat token Imgur History Historie Imgur Imgur Uploader Imgur služba Username Uživatelské jméno Waiting for imgur.com… Čekání na imgur.com… Imgur.com token successfully updated. Token Imgur.com byl úspěšně aktualizován. Imgur.com token update error. Chyba aktualizace Imgur.com tokenu. Link directly to image Odkaz přímo na obrázek Base Url: Základní adresa URL: Base url that will be used for communication with Imgur. Changing requires restart. Základní adresa URL, která bude použita pro komunikaci s Imgurem. Změna vyžaduje restart. Clear Token Vymazat token LoadImageFromFileOperation Unable to open image Obrázek nelze otevřít Unable to open image from path %1 Nelze otevřít obrázek z místa %1 MainToolBar New Nový Delay in seconds between triggering and capturing screenshot. Prodleva v sekundách mezi spuštěním a zachycením obrazovky. s s Save Uložit Save Screen Capture to file system Uložit výstřižek obrazovky do systému souborů Copy Kopírovat Copy Screen Capture to clipboard Kopírovat výstřižek obrazovky do schránky Undo Zpět Redo Znovu Crop Oříznutí Crop Screen Capture Oříznout snímek obrazovky Tools Nástroje MainWindow Unable to show image Obrázek nelze zobrazit Unsaved Neuloženo Upload Odeslat Print Tisk Opens printer dialog and provide option to print image Otevře dialog tiskárny a poskytne možnost pro tisk obrázku Print Preview Náhled tisku Opens Print Preview dialog where the image orientation can be changed Otevře dialog náhledu, kde lze změnit orientaci obrázku Scale Změnit velikost Add Watermark Přidat vodoznak Add Watermark to captured image. Multiple watermarks can be added. Přidat vodoznak do zachyceného obrázku. Lze přidat i více vodoznaků. Quit Ukončit Settings Nastavení &About &O aplikaci Open Otevřít &File &Soubor &Edit &Upravit &Options &Možnosti &Help &Pomoc Image Files (*.png *.jpg *.bmp) Soubory obrázků (*. png *. jpg *. bmp) Save As... Uložit jako... Paste Vložit Paste Embedded Vložit do aktvní karty Pin PIN Pin screenshot to foreground in frameless window Připnout snímek obrazovky k popředí v bezrámovém okně No image provided but one was expected. Nebyl poskytnut žádný obrázek, ale jeden se očekával. Copy Path Kopírovat cestu Open Directory Otevřít adresář &View &Pohled Delete Vymazat Rename Přejmenovat Open Images Otevřít obrázky Show Docks Zobrazit doky Hide Docks Skrýt doky Copy as data URI Kopírovat jako data URI Open &Recent Otevřít nedávné Modify Canvas Upravit plátno Upload triggerCapture to external source Copy triggerCapture to system clipboard Scale Image Změnit Velikost Rotate Otočit Rotate Image Otočit Obrázek MultiCaptureHandler Save Uložit Save As Uložit jako Open Directory Otevřít adresář Copy Kopírovat Copy Path Kopírovat cestu Delete Smazat Rename Přejmenovat NewCaptureNameProvider Capture Zachytit PinWindow Close Zavřít Close Other Zavřít ostatní Close All Zavřít vše PinWindowHandler Pin Window %1 Připnout okno %1 RenameOperation Image Renamed Obrázek byl přejmenován Successfully renamed image to Obrázek byl úspěšně přejmenován na Image Rename Failed Přejmenování obrázku se nezdařilo Failed to rename image to Nepodařilo se přejmenovat obrázek na Rename image Přejmenovat obrázek New filename: Nový název souboru: SaveOperation Save As Uložit jako Images Obrázky All Files Všechny soubory Image Saved Obrázek uložen Saved to Uložen do Saving Image Failed Ukládání obrázku selhalo Failed to save image to Nepodařilo se uložit obrázek do SaverSettings Automatically save new captures to default location Automaticky ukládat nové snímky do výchozího umístění Prompt to save before discarding unsaved changes Zobrazit výzvu k uložení před zahozením neuložených změn Remember last Save Directory Zapamatovat si poslední adresář uložení When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. Je-li povoleno, je přepsán adresář pro ukládání v Nastavení cestou posledního uloženého obrázku pro každé následující uložení. Capture save location and filename Umístění a název souboru pro uložení zachycení Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. Podporované formáty jsou JPG, PNG a BMP. Pokud není k dispozici žádný formát, použije se jako výchozí PNG. Název souboru může obsahovat následující zástupné znaky: - $Y, $M, $D pro datum, $h, $m, $s pro čas nebo $T pro čas ve formátu hhmmss. - Více po sobě jdoucích # pro počítadlo. #### generuje první položku 0001, další snímek bude 0002. Browse Procházet Saver Settings Nastavení Ukládače Capture save location Umístění pro uložení zachycení Default Výchozí Factor Faktor Save Quality Kvalita uložení Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. Zadejte 0 pro získání malých komprimovaných souborů, 100 pro velké nekomprimované soubory. Ne všechny formáty obrázků podporují celý rozsah, JPEG ano. ScriptUploaderSettings Copy script output to clipboard Kopírování výstupu skriptu do schránky Script: Skript: Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. Cesta ke skriptu, který bude použit pro nahrávání. Během nahrávání bude skript volán s jedním argumentem a to cestou k dočasnému souboru png. Browse Procházet Script Uploader Nahrávací skript Select Upload Script Vybrat nahrávací skript Stop when upload script writes to StdErr Zastavit, když nahrávací skript zapíše do StdErr Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. Označí nahrávání jako neúspěšné, když skript zapíše do StdErr. Bez tohoto nastavení budou chyby ve skriptu ignorovány. Filter: Filter: RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. RegEx výraz. Zkopírujte do schránky pouze to, co odpovídá výrazu RegEx. Když je vynechán, zkopíruje se vše. SettingsDialog Settings Nastavení OK OK Cancel Zrušit Application Aplikace Image Grabber Snímkování Imgur Uploader Imgur služba Annotator Značkovač HotKeys Klávesové zkratky Uploader Uploader Script Uploader Nahrávací skript Saver Ukládač Stickers Samolepky Snipping Area Výstřižková oblast Tray Icon Ikona v systémové oblasti Watermark Vodoznak Actions Akce SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Změňte velikost vybraného tvaru pomocí úchytů nebo jej přesuňte přetažením výběru. Use arrow keys to move the selection. K přesunutí výběru použijte klávesy se šipkami. Use arrow keys while pressing CTRL to move top left handle. Pomocí kláves se šipkami současně se stisknutou klávesou CTRL pohybujte levým horním úchytem. Use arrow keys while pressing ALT to move bottom right handle. Pomocí kláves se šipkami současně se stisknutou klávesou ALT posuňte pravý dolní úchyt. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. Potvrďte výběr stisknutím ENTER / RETURN nebo zrušte stisknutím ESC. This message can be disabled via settings. Tuto zprávu lze deaktivovat pomocí nastavení. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Kliknutím a tažením vyberte obdélníkovou oblast nebo ji ukončete stisknutím klávesy ESC. Hold CTRL pressed to resize selection after selecting. Po výběru podržte stisknutou klávesu CTRL a změňte tak velikost výběru. Hold CTRL pressed to prevent resizing after selecting. Podržte stisknutou klávesu CTRL, abyste po výběru zabránili změně velikosti. Operation will be canceled after 60 sec when no selection made. Pokud nebude proveden žádný výběr, operace bude zrušena po 60 sekundách. This message can be disabled via settings. Tuto zprávu lze deaktivovat pomocí nastavení. SnippingAreaSettings Freeze Image while snipping Zmrazení obrazu při snímání When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. Pokud je tato možnost povolena, zamrzne pozadí při výběru obdélníkové oblasti. Mění také chování zpožděných snímků obrazovky, s touto možností povolenou se zpoždění objeví před zobrazením oblasti a s vypnutou možností se zpoždění provede až po zobrazení oblasti. Tato funkce nefunguje pro Wayland a je vždy používána pro MacO. Show magnifying glass on snipping area Zobrazit lupu v oblasti výstřižku Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. Zobrazit lupu, která přiblíží obrázek na pozadí. Tato možnost funguje pouze se zapnutou funkcí 'Zmrazení obrazu při snímání'. Show Snipping Area rulers Zobrazit pravítko oblasti výstřižku Horizontal and vertical lines going from desktop edges to cursor on snipping area. Vodorovné a svislé čáry vedoucí z okraje plochy ke kurzoru snímané oblasti. Show Snipping Area position and size info Zobrazit informace o poloze a velikosti oblasti snímku When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. Pokud není stisknuto levé tlačítko myši, je zobrazena pozice, při stisknutí tlačítka myši je zobrazna velikost vybrané oblasti vlevo a nad zachycenou oblastí. Allow resizing rect area selection by default Ve výchozím nastavení povolit změnu velikosti obdélníkové oblasti When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. Je-li povoleno, po výběru obdélníkové oblasti, je možno změnit velikosti tohot výběru. Ukončení změny velikosti lze potvrdit klávesou return. Show Snipping Area info text Zobrazit text informací o oblasti výstřižku Snipping Area cursor color Barva kurzoru v oblasti výstřižku Sets the color of the snipping area cursor. Nastaví barvu kurzoru oblasti výstřižku. Snipping Area cursor thickness Tloušťka kurzoru v oblasti výstřižku Sets the thickness of the snipping area cursor. Nastaví tloušťku kurzoru oblasti výstřižku. Snipping Area Výstřižková oblast Snipping Area adorner color Barva doplňků Výstřižkové oblasti Sets the color of all adorner elements on the snipping area. Nastaví barvu všech doplňkových prvků v odstřižené oblasti. Snipping Area Transparency Průhlednost výstřižkové oblasti Alpha for not selected region on snipping area. Smaller number is more transparent. Průhlednost pro nevybranou oblast v oblasti výstřižku. Menší číslo je průhlednější. StickerSettings Up Nahoru Down Dolů Use Default Stickers Použití výchozích nálepek Sticker Settings Nastavení nálepky Vector Image Files (*.svg) Soubory vektorových obrázků (* .svg) Add Přidat Remove Odstranit Add Stickers Přidat samolepky TrayIcon Show Editor Zobrazit editor TrayIconSettings Use Tray Icon Použít ikonu v oznamovací oblasti When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. Pokud je tato možnost povolena, přidá se ikona do oznamovací oblasti, pokud ji správce oken sytému podporuje. Změna vyžaduje restart. Minimize to Tray Minimalizovat do oznamovací oblasti Start Minimized to Tray Spustit minimalizované do oznamovací oblasti Close to Tray Zavřít do oznamovací oblasti Show Editor Zobrazit editor Capture Zachytit Default Tray Icon action Výchozí akce pro ikonu v oznamovací oblasti Default Action that is triggered by left clicking the tray icon. Výchozí akce, která se spustí klepnutím levým tlačítkem myši na ikonu v oznamovací oblasti. Tray Icon Settings Nastavení ikony v oznamovací oblasti Display Tray icon notifications Zobrazit oznámení ikony v oznamovací oblasti Use platform specific notification service Používat službu oznámení dané platformy When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. Pokud je možnost povolená, ksnip se pokusí používat službu oznámení dané platformy, pokud existuje. Změna vyžaduje restart pro projevení. UpdateWatermarkOperation Select Image Vybrat obrázek Images Obrázky All Files Všechny soubory UploadOperation Upload Script Required Je vyžadován skript pro nahrávání Please add an upload script via Options > Settings > Upload Script Přidejte prosím skript pro nahrávání pomocí Možnosti> Nastavení> Nahrát skript Capture Upload Zachytit nahraní You are about to upload the image to an external destination, do you want to proceed? Chystáte se nahrát obrázek do externího umístění, chcete pokračovat? UploaderSettings Ask for confirmation before uploading Před odesláním požádat o potvrzení Uploader Type: Typ uploaderu: Imgur Imgur Script Skript Uploader Uploader VersionTab Version Verze Build Sestavení Using: Používá: WatermarkSettings Watermark Image Obrázek vodoznaku Update Aktualizovat Rotate Watermark Otočit vodoznak When enabled, Watermark will be added with a rotation of 45° Pokud je povoleno, bude vodoznak přidán s rotací 45 ° Watermark Settings Nastavení vodoznaku ksnip-1.9.2/translations/ksnip_da.ts000066400000000000000000001474011414701001100175240ustar00rootroot00000000000000 AboutDialog About Om About Om Version Version Author Forfatter Donate Donér Close Luk Contact AboutTab License: Licens: Screenshot and Annotation Tool ActionSettingTab Name Shortcut Clear Take Capture Include Cursor Delay s Capture Mode Show image in Pin Window Copy image to Clipboard Upload image Open image parent directory Save image Hide Main Window ActionsSettings Add Actions Settings Action AddWatermarkOperation Watermark Image Required Vandmærke billede krævet Please add a Watermark Image via Options > Settings > Annotator > Update AnnotationSettings Smooth Painter Paths When enabled smooths out pen and marker paths after finished drawing. Smooth Factor Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. Annotator Settings Remember annotation tool selection and load on startup Switch to Select Tool after drawing Item Number Tool Seed change updates all Number Items Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. Canvas Color Default Canvas background color for annotation area. Changing color affects only new annotation areas. Select Item after drawing With this option enabled the item gets selected after being created, allowing changing settings. ApplicationSettings Capture screenshot at startup with default mode Application Style Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. Application Settings Automatically copy new captures to clipboard Use Tabs Change requires restart. Run ksnip as single instance Hide Tabbar when only one Tab is used. Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. Remember Main Window position on move and load on startup Auto hide Tabs Auto hide Docks On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. Auto resize to content Automatically resize Main Window to fit content image. AuthorTab Contributors: Spanish Translation Dutch Translation Russian Translation Norwegian Bokmål Translation French Translation Polish Translation Snap & Flatpak Support The Authors: CanDiscardOperation Warning - The capture %1%2%3 has been modified. Do you want to save it? CaptureModePicker New Draw a rectangular area with your mouse Capture a screenshot of the last selected rectangular area Capture full screen including all monitors Capture screen where the mouse is located Capture window that currently has focus Capture that is currently under the mouse cursor Uses the screenshot Portal for taking screenshot ContactTab Community If you have general questions, ideas or just want to talk about ksnip, please join our server. Bug Reports Please use Brug venligst to report bugs. til rapporter fejl. CopyAsDataUriOperation Failed to copy to clipboard Failed to copy to clipboard as base64 encoded image. Copied to clipboard Copied to clipboard as base64 encoded image. DeleteImageOperation Delete Image The item '%1' will be deleted. Do you want to continue? DonateTab here Also possible, Donations are always welcome Donation Become a GitHub Sponsor ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. EnumTranslator Rectangular Area Last Rectangular Area Full Screen (All Monitors) Current Screen Active Window Window Under Cursor Screenshot Portal HandleUploadResultOperation Upload Successful Upload script finished successfully. Uploaded to Unable to save temporary image for upload. Unable to start process, check path and permissions. Process crashed Process timed out. Process read error. Process write error. Web error, check console output. Unknown process error. Upload Failed Script wrote to StdErr. HotKeySettings Enable Global HotKeys Capture Rect Area Capture Last Rect Area Capture Full Screen Capture current Screen Capture active Window Capture Window under Cursor Global HotKeys Clear Capture using Portal HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. ImageGrabberSettings Capture mouse cursor on screenshot Should mouse cursor be visible on screenshots. Image Grabber Force Generic Wayland Screenshot Scale Generic Wayland Screenshots Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. Show Main Window after capturing screenshot Hide Main Window during screenshot Hide Main Window when capturing a new screenshot. Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. ImgurHistoryDialog Imgur History Close Luk Time Stamp Link Delete Link ImgurUploader Upload to imgur.com finished! Received new token, trying upload again… Imgur token has expired, requesting new token… ImgurUploaderSettings Force anonymous upload After uploading open Imgur link in default browser Link directly to image Always copy Imgur link to clipboard Client ID Client Secret PIN Enter imgur Pin which will be exchanged for a token. Get PIN Get Token Imgur History Imgur Uploader Username Waiting for imgur.com… Imgur.com token successfully updated. Imgur.com token update error. Base Url: Base url that will be used for communication with Imgur. Changing requires restart. Clear Token LoadImageFromFileOperation Unable to open image Unable to open image from path %1 MainToolBar New Delay in seconds between triggering and capturing screenshot. s Save Save Screen Capture to file system Copy Copy Screen Capture to clipboard Undo Redo Crop Crop Screen Capture Tools MainWindow Unable to show image Unsaved Upload Print Opens printer dialog and provide option to print image Print Preview Opens Print Preview dialog where the image orientation can be changed Scale Add Watermark Add Watermark to captured image. Multiple watermarks can be added. Quit Settings &About Open &File &Edit &Options &Help Image Files (*.png *.jpg *.bmp) Save As... Paste Paste Embedded Pin Pin screenshot to foreground in frameless window No image provided but one was expected. Copy Path Open Directory &View Delete Rename Open Images Show Docks Hide Docks Copy as data URI Open &Recent Modify Canvas Upload triggerCapture to external source Copy triggerCapture to system clipboard Scale Image Rotate Rotate Image MultiCaptureHandler Save Save As Open Directory Copy Copy Path Delete Rename NewCaptureNameProvider Capture PinWindow Close Luk Close Other Close All PinWindowHandler Pin Window %1 RenameOperation Image Renamed Successfully renamed image to Image Rename Failed Failed to rename image to Rename image New filename: SaveOperation Save As Images All Files Image Saved Saved to Saving Image Failed Failed to save image to SaverSettings Automatically save new captures to default location Prompt to save before discarding unsaved changes Remember last Save Directory When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. Capture save location and filename Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. Browse Saver Settings Capture save location Default Factor Save Quality Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. ScriptUploaderSettings Copy script output to clipboard Script: Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. Browse Script Uploader Select Upload Script Stop when upload script writes to StdErr Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. Filter: RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. SettingsDialog Settings OK Cancel Application Image Grabber Imgur Uploader Annotator HotKeys Uploader Script Uploader Saver Stickers Snipping Area Tray Icon Watermark Actions SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Use arrow keys to move the selection. Use arrow keys while pressing CTRL to move top left handle. Use arrow keys while pressing ALT to move bottom right handle. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. This message can be disabled via settings. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Hold CTRL pressed to resize selection after selecting. Hold CTRL pressed to prevent resizing after selecting. Operation will be canceled after 60 sec when no selection made. This message can be disabled via settings. SnippingAreaSettings Freeze Image while snipping When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. Show magnifying glass on snipping area Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. Show Snipping Area rulers Horizontal and vertical lines going from desktop edges to cursor on snipping area. Show Snipping Area position and size info When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. Allow resizing rect area selection by default When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. Show Snipping Area info text Snipping Area cursor color Sets the color of the snipping area cursor. Snipping Area cursor thickness Sets the thickness of the snipping area cursor. Snipping Area Snipping Area adorner color Sets the color of all adorner elements on the snipping area. Snipping Area Transparency Alpha for not selected region on snipping area. Smaller number is more transparent. StickerSettings Up Down Use Default Stickers Sticker Settings Vector Image Files (*.svg) Add Remove Add Stickers TrayIcon Show Editor TrayIconSettings Use Tray Icon When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. Minimize to Tray Start Minimized to Tray Close to Tray Show Editor Capture Default Tray Icon action Default Action that is triggered by left clicking the tray icon. Tray Icon Settings Display Tray icon notifications Use platform specific notification service When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. UpdateWatermarkOperation Select Image Images All Files UploadOperation Upload Script Required Please add an upload script via Options > Settings > Upload Script Capture Upload You are about to upload the image to an external destination, do you want to proceed? UploaderSettings Ask for confirmation before uploading Uploader Type: Imgur Script Uploader VersionTab Version Version Build Using: WatermarkSettings Watermark Image Update Rotate Watermark When enabled, Watermark will be added with a rotation of 45° Watermark Settings ksnip-1.9.2/translations/ksnip_de.ts000066400000000000000000001637441414701001100175400ustar00rootroot00000000000000 AboutDialog About Über About Über Version Version Author Autor Close Schließen Donate Spenden Contact AboutTab License: Lizenz: Screenshot and Annotation Tool ActionSettingTab Name Name Shortcut Verknüpfung Clear Leeren Take Capture Include Cursor Cursor einschließen Delay s s Capture Mode Show image in Pin Window Copy image to Clipboard Bild in die Zwischenablage kopieren Upload image Bild hochladen Open image parent directory Übergeordnetes Bildverzeichnis öffnen Save image Bild speichern Hide Main Window ActionsSettings Add Hinzufügen Actions Settings Aktionen-Einstellungen Action Aktion AddWatermarkOperation Watermark Image Required Bild für Wasserzeichen erforderlich Please add a Watermark Image via Options > Settings > Annotator > Update Bitte fügen Sie ein Bild für das Wasserzeichen via Optionen > Einstellungen > Annotator > Aktualisieren hinzu AnnotationSettings Smooth Painter Paths Glatte Malpfade When enabled smooths out pen and marker paths after finished drawing. Wenn aktiviert, werden Stift und Markerpfade nach dem fertigen Zeichnen geglättet. Smooth Factor Glättungsfaktor Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. Das Erhöhen des Glättungsfaktors wird die Präzision für Stift und Marker verringern, aber macht sie glatter. Annotator Settings Beschriftungseinstellungen Remember annotation tool selection and load on startup Merke Auswahl des Beschriftungstool und stelle diese beim Starten wieder her Switch to Select Tool after drawing Item Nach dem Zeichnen des Elements zum Auswahlwerkzeug wechseln Number Tool Seed change updates all Number Items Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. Canvas Color Default Canvas background color for annotation area. Changing color affects only new annotation areas. Select Item after drawing With this option enabled the item gets selected after being created, allowing changing settings. ApplicationSettings Capture screenshot at startup with default mode Beim Starten Screenshot im Standardmodus aufnehmen Application Style Anwendungsstil Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. Setzt den Anwendungsstil, welcher das Aussehen des GUIs definiert. Eine Änderung benötigt einen Neustart von ksnip, um wirksam zu werden. Application Settings Anwendungseinstellungen Automatically copy new captures to clipboard Neue Aufnahmen automatisch in die Zwischenablage kopieren Use Tabs Registerkarten verwenden Change requires restart. Änderung erfordert Neustart. Run ksnip as single instance Nur eine Instanz von ksnip starten Hide Tabbar when only one Tab is used. Registerkartenleiste verstecken wenn nur eine Registerkarte offen ist. Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. Mit dieser Option wird das Ausführen von nur einer ksnip-Instanz erlaubt, alle weiteren Instanzen werden ihre Argumente an die zuerst gestartete Instanz übergeben und sich wieder schließen. Eine Änderung dieser Einstellung erfordert einen Neustartet aller Instanzen. Remember Main Window position on move and load on startup Position des Hauptfensters beim Verschieben merken und beim Starten wiederherstellen Auto hide Tabs Auto hide Docks On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. Auto resize to content Automatically resize Main Window to fit content image. AuthorTab Contributors: Mitwirkenden: Spanish Translation Spanische Übersetzung Dutch Translation Niederländische Übersetzung Russian Translation Russische Übersetzung Norwegian Bokmål Translation Norwegische Übersetzung French Translation Französische Übersetzung Polish Translation Polnische Übersetzung Snap & Flatpak Support Snap- und Flatpak-Support The Authors: Die Authoren: CanDiscardOperation Warning - Warnung - The capture %1%2%3 has been modified. Do you want to save it? Die Bildschirmaufnahme %1%2%3 wurde verändert. Speichern? CaptureModePicker New Neu Draw a rectangular area with your mouse Zeichnen Sie einen rechteckigen Bereich mit der Maus Capture full screen including all monitors Vollbild Aufnahme einschließlich aller Monitore Capture screen where the mouse is located Aufnahme des Bildschirms auf dem sich dezeit die Maus befindet Capture window that currently has focus Aufnahme des aktiven Fensters Capture that is currently under the mouse cursor Aufnahme des Fensters unter der Maus Capture a screenshot of the last selected rectangular area Einen Screenshot des zuletzt ausgewählten rechteckigen Bereichs aufnehmen Uses the screenshot Portal for taking screenshot Verwendet Screenshot Portal um Bildschirmaufnahmen zu erstellen ContactTab Community Gemeinschaft If you have general questions, ideas or just want to talk about ksnip, please join our server. Bug Reports Please use Benutzen Sie bitte to report bugs. um Fehler zu melden. CopyAsDataUriOperation Failed to copy to clipboard Failed to copy to clipboard as base64 encoded image. Copied to clipboard Copied to clipboard as base64 encoded image. DeleteImageOperation Delete Image Bild löschen The item '%1' will be deleted. Do you want to continue? Das Objekt '%1' wird gelöscht. Wollen Sie Fortfahren? DonateTab here hier Also possible, Auch möglich, Donations are always welcome Spenden sind immer willkommen Donation Spende Become a GitHub Sponsor GitHub Sponsor werden ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. ksnip ist ein unkommerzielles, freies und unter „Copyleft“ stehendes Softwareprojekt, <br/>für das jedoch Kosten anfallen, die es zu decken gilt,<br/> wie z.B. Kosten für die Internetdomäne oder Hardwarekosten für die plattformübergreifende Unterstützung. If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that Falls du helfen möchtest oder <br/>deine Wertschätzung für die Arbeit ausdrücken möchtest<br/>, indem du den Entwicklern ein Bier oder Kaffee ausgeben möchtest, kannst du das gerne tun EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. EnumTranslator Rectangular Area Rechteckiger Bereich Last Rectangular Area Letzter rechteckiger Bereich Full Screen (All Monitors) Vollbild (alle Monitore) Current Screen Aktueller Bildschirm Active Window Aktives Fenster Window Under Cursor Fenster unter der Maus Screenshot Portal Bildschirmfoto-Portal HandleUploadResultOperation Upload Successful Erfolgreich hochgeladen Upload script Script hochladen finished successfully. erfolgreich abgeschlossen. Uploaded to Hochgeladen zu Unable to save temporary image for upload. Temporäres Bild kann nicht zum Hochladen gespeichert werden. Unable to start process, check path and permissions. Starten des Prozesses nicht möglich, prüfen Sie Pfad und Berechtigungen. Process crashed Prozess abgestürzt Process timed out. Der Prozess hat ein Timeout erreicht. Process read error. Prozesslesefehler. Process write error. Prozessschreibfehler. Web error, check console output. Web-Fehler, Konsolenausgabe prüfen. Unknown process error. Unbekannter Prozess-Fehler. Upload Failed Hochladen fehlgeschlagen Script wrote to StdErr. Script hat in die Fehlerausgabe (StdErr) geschrieben. HotKeySettings Enable Global HotKeys Systemweite Tastenkürzel aktivieren Capture Rect Area Rechteckigen Bereich aufnehmen Capture Full Screen Gesamten Bildschirm aufnehmen Capture current Screen Aktuellen Bildschirm aufnehmen Capture active Window Aktives Fenster aufnehmen Capture Window under Cursor Fenster unter Mauszeiger aufnehmen Global HotKeys Systemweite Tastenkürzel Capture Last Rect Area Letzten rechteckigen Bereich aufnehmen Clear Leeren Capture using Portal Aufnahme über Portal HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. ImageGrabberSettings Capture mouse cursor on screenshot Mauszeiger auf Screenshot aufnehmen Should mouse cursor be visible on screenshots. Legt fest, ob der Mauszeiger auf Screenshots sichtbar sein soll. Image Grabber Bildgrabber Force Generic Wayland Screenshot Erzwinge Screenshot über eine standardmäßige Wayland-Funktion Scale Generic Wayland Screenshots Skaliere Screenshots über eine standardmäßige Wayland-Funktion Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. Standardmäßige Wayland-Implementationen, die XDG-DESKTOP-PORTAL verwenden, handhaben die Bildschirmskalierung unterschiedlich. Wird diese Option aktiviert, wird die aktuelle Bildschirmskalierung ermittelt und auf den Screenshot in ksnip angewendet. GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. GNOME und KDE Plasma unterstützen sowohl eigene Wayland- als auch die standardmäßigen XDG-DESKTOP-PORTAL-Screenshots. Wird diese Option aktiviert, werden KDE Plasma und GNOME gezwungen, XDG-DESKTOP-PORTAL-Screenshots zu verwenden. Eine Änderung dieser Option erfordert einen Neustart von ksnip. Show Main Window after capturing screenshot Hauptfenster nach Aufnahme des Screenshots anzeigen Hide Main Window during screenshot Hauptfenster während Screenshot ausblenden Hide Main Window when capturing a new screenshot. Hauptfenster ausblenden, wenn ein neues Bildschirmfoto aufgenommen wird. Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. ImgurHistoryDialog Imgur History Imgur-Verlauf Close Schließen Time Stamp Zeitstempel Link Link Delete Link Löschlink ImgurUploader Upload to imgur.com finished! Hochladen zu imgur.com abgeschlossen! Received new token, trying upload again… Neues Token erhalten, versuche erneut hochzuladen … Imgur token has expired, requesting new token… Das Imgur-Token ist abgelaufen, fordere neues Token an … ImgurUploaderSettings Force anonymous upload Anonymen Upload erzwingen Always copy Imgur link to clipboard Imgur-Link immer in die Zwischenablage kopieren Client ID Client-ID Client Secret Client-Geheimnis PIN PIN Enter imgur Pin which will be exchanged for a token. Imgur-PIN eingeben, die gegen ein Token ausgetauscht wird. Get PIN PIN anfordern Get Token Token anfordern Imgur History Imgur-Verlauf Imgur Uploader Imgur-Hochlader Username Benutzername Waiting for imgur.com… Warte auf imgur.com … Imgur.com token successfully updated. Imgur-Token wurde erfolgreich aktualisiert. Imgur.com token update error. Fehler beim Aktualisieren des Imgur-Tokens. After uploading open Imgur link in default browser Nach dem Hochladen Imgur-Link im Standardbrowser öffnen Link directly to image Direkt zum Bild verlinken Base Url: Basis-URL: Base url that will be used for communication with Imgur. Changing requires restart. Basis-URL, die für Kommunikation mit Imgur verwendet wird. Änderung erfordert Neustart. Clear Token Token löschen LoadImageFromFileOperation Unable to open image Bild kann nicht geöffnet werden Unable to open image from path %1 Bild kann nicht aus Pfad %1 geöffnet werden MainToolBar New Neu Delay in seconds between triggering and capturing screenshot. Zeitverzögerung in Sekunden zwischen dem Auslösen und der Aufnahme des Bildschirmfotos. s s Save Speichern Save Screen Capture to file system Bildschirmaufnahme im Dateisystem speichern Copy Kopieren Copy Screen Capture to clipboard Bildschirmaufnahme in die Zwischenablage kopieren Tools Werkzeuge Undo Rückgängig Redo Wiederherstellen Crop Zuschneiden Crop Screen Capture Bildschirmaufnahme zuschneiden MainWindow Unsaved Ungespeichert Upload Hochladen Print Drucken Opens printer dialog and provide option to print image Druckdialog öffnen Print Preview Druckvorschau Opens Print Preview dialog where the image orientation can be changed Druckvorschau öffnen Scale Skalieren Quit Beenden Settings Einstellungen &About &Über Open Öffnen &Edit &Bearbeiten &Options &Optionen &Help &Hilfe Image Files (*.png *.jpg *.bmp) Bilddateien (* .png * .jpg * .bmp) Add Watermark Wasserzeichen hinzufügen Add Watermark to captured image. Multiple watermarks can be added. Fügt dem aufgenommenem Bild ein Wasserzeichen hinzu. Mehrere Wasserzeichen können hinzugefügt werden. &File &Datei Unable to show image Bild kann nicht angezeigt werden Save As... Speichern als… Paste Einfügen Paste Embedded Eingebettet einfügen Pin Anheften Pin screenshot to foreground in frameless window Hefte Screenshot am Vordergrund in einem rahmenlosen Fenster an No image provided but one was expected. Kein Bild geliefert, obwohl eines erwartet wurde. Copy Path Pfad kopieren Open Directory Verzeichnis öffnen &View &Anzeigen Delete Löschen Rename Umbenennen Open Images Bilder öffnen Show Docks Hide Docks Copy as data URI Open &Recent Modify Canvas Upload triggerCapture to external source Copy triggerCapture to system clipboard Scale Image Rotate Rotate Image MultiCaptureHandler Save Speichern Save As Speichern als Open Directory Verzeichnis öffnen Copy Kopieren Copy Path Pfad kopieren Delete Löschen Rename Umbenennen NewCaptureNameProvider Capture Aufnahme PinWindow Close Schließen Close Other Andere schließen Close All Alles schließen PinWindowHandler Pin Window %1 Hefte Fenster %1 an RenameOperation Image Renamed Bild umbenennen Successfully renamed image to Bild erfolgreich umbenannt zu Image Rename Failed Bild Umbenennung fehlgeschlagen Failed to rename image to Fehler bei Umbennenung des Bildes zu Rename image Bild umbenennen New filename: Neuer Dateiname: SaveOperation Save As Speichern als Images Bilder All Files Alle Dateien Image Saved Bild gespeichert Saving Image Failed Speichern des Bildes fehlgeschlagen Saved to Gespeichert unter Failed to save image to Speicherung fehlgeschlagen unter SaverSettings Automatically save new captures to default location Neue Aufnahmen automatisch im Standardverzeichnis speichern Prompt to save before discarding unsaved changes Aufforderung zum Speichern, bevor nicht gespeicherte Änderungen verworfen werden Remember last Save Directory Zuletzt verwendeten Speicherort merken When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. Ist diese Option gesetzt, wird das in den Einstellungen gesetzte Verzeichnis zum Abspeichern bei jedem Speichern ignoriert und durch das zuletzt benutzte Speicherverzeichnis ersetzt. Capture save location and filename Speicherort und Dateiname für Aufnahmen Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. Unterstützte Formate sind JPG, PNG und BMP. Wenn kein Format angegeben ist, wird standardmäßig PNG benutzt. Dateinamen können die folgenden Platzhalter verwenden: - $Y, $M, $D für das Datum, $h, $m, $s für die Uhrzeit, oder $T für die Zeit im Format hhmmss. - Mehrere aufeinanderfolgende # als Zähler. #### ergibt 0001, der darauffolgende Screenshot wäre 0002. Browse Durchsuchen Saver Settings Speichereinstellungen Capture save location Speicherort für Aufnahmen Default Standard Factor Faktor Save Quality Speicherqualität Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. 0 angeben, um kleine komprimierte Dateien zu erhalten, 100 für große unkomprimierte Dateien. Nicht alle Bildformate unterstützen die gesamte Bandbreite, JPEG schon. ScriptUploaderSettings Copy script output to clipboard Skriptausgabe in Zwischenablage kopieren Script: Skript: Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. Pfad zum Skript, das zum Hochladen aufgerufen wird. Beim Hochladen wird der Pfad zur temporären png-Datei als einziges Argument an das Script übergeben. Browse Durchsuchen Script Uploader Skriptbasiertes Hochladen Select Upload Script Upload-Skript auswählen Stop when upload script writes to StdErr Stopp das Skript, wenn es in die Standardfehlerausgabe (StdErr) schreibt Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. Markiert den Upload als fehlgeschlagen, wenn das Skript in die Standardfehlerausgabe (StdErr) schreibt. Ohne diese Einstellung werden Fehler im Skript möglicherweise nicht bemerkt. Filter: Filter: RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. Reguläre Ausdrücke. Nur das in die Zwischenablage kopieren, was dem regulären Ausdruck entspricht. Alles wird kopiert wenn leer. SettingsDialog Settings Einstellungen OK OK Cancel Abbrechen Image Grabber Bildgrabber Imgur Uploader Imgur-Uploader Application Anwendung Annotator Annotator HotKeys Tastenkürzel Uploader Uploader Script Uploader Skriptbasierter Upload Saver Speichern Stickers Aufkleber Snipping Area Bereich zum Ausschneiden Tray Icon Watermark Actions SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Use arrow keys to move the selection. Use arrow keys while pressing CTRL to move top left handle. Use arrow keys while pressing ALT to move bottom right handle. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. This message can be disabled via settings. Diese Nachricht kann in den Einstellungen deaktiviert werden. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Klicken und ziehen Sie, um einen rechteckigen Bereich auszuwählen, oder drücken Sie ESC, um zu beenden. Hold CTRL pressed to resize selection after selecting. Halten Sie die STRG-Taste gedrückt, um die Größe des Bereichs nach der Auswahl zu ändern. Hold CTRL pressed to prevent resizing after selecting. Halten Sie die STRG-Taste gedrückt, um eine Größenänderung nach der Auswahl zu verhindern. Operation will be canceled after 60 sec when no selection made. Die Aktion wird nach 60 Sekunden abgebrochen, wenn keine Auswahl getroffen wurde. This message can be disabled via settings. Diese Nachricht kann in den Einstellungen deaktiviert werden. SnippingAreaSettings Freeze Image while snipping Bild während der Aufnahme einfrieren When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. Ist diese Option gesetzt, wird der Hintergrund eingefroren und eine rechteckige Auswahl kann getroffen werden. Sie wirkt sicht auch auf verzögerte Screenshots aus; wenn aktiviert, geschieht die Verzögerung, bevor die Auswahl getroffen werden kann; wenn deaktviert, geschieht die Verzögerung, nachdem die Auswahl getroffen wurde. Diese Option ist unter Wayland stets deaktiviert, unter macOS stets aktiviert. Show magnifying glass on snipping area Lupe im Ausschnittsbereich anzeigen Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. Zeigt eine Lupe an, welche in das Hintergrundbild hineinzoomt. Diese Option funktioniert nur, wenn „Bild während der Aufnahme einfrieren“ aktiviert wurde. Show Snipping Area rulers Lineale bei der Auswahl des rechteckigen Bereichs anzeigen Horizontal and vertical lines going from desktop edges to cursor on snipping area. Horizontale und vertikale Linien vom Bildschirmrand zum Mauszeiger anzeigen. Show Snipping Area position and size info Position und Größe des Ausschnittsbereichs anzeigen When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. Wenn der Mauszeiger nicht gedrückt ist, wird die Position angezeigt; wenn der Mauszeiger gedrückt ist, wird die Größe des markierten Bereichs linksseitig und oberhalb des Ausschnittsbereichs angezeigt. Allow resizing rect area selection by default Standardmäßig das Ändern der rechteckigen Auswahl erlauben When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. Wenn dies aktiviert ist, kann nach einer rechteckigen Auswahl jene skaliert werden. Nach Fertigstellung kann die Auswahl mittels ENTER bestätigt werden. Show Snipping Area info text Informationen zum Auswahlbereich anzeigen Snipping Area cursor color Mauszeigerfarbe für Auswahlbereich Sets the color of the snipping area cursor. Setzt die Farbe des Mauszeigers für den Auswahlbereich. Snipping Area cursor thickness Mauszeigerstärke für Auswahlbereich Sets the thickness of the snipping area cursor. Setzt die Stärke des Mauszeigers für den Auswahlbereich. Snipping Area Auswahlbereich Snipping Area adorner color Sets the color of all adorner elements on the snipping area. Snipping Area Transparency Alpha for not selected region on snipping area. Smaller number is more transparent. StickerSettings Up Hoch Down Runter Use Default Stickers Standard-Aufkleber nutzen Sticker Settings Aufkleber-Einstellungen Vector Image Files (*.svg) Vektorgrafik-Dateien (*.svg) Add Hinzufügen Remove Entfernen Add Stickers Sticker hinzufügen TrayIcon Show Editor Editor Anzeigen TrayIconSettings Use Tray Icon Benutze Tray Icon When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. Bei Aktivierung wird ein Tray Icon in der Taskbar hinzugefügt, sofern das Betriebssystem dies unterstützt. Diese Änderung erfordert einen Neustart. Minimize to Tray In Tray minimieren Start Minimized to Tray Im Tray minimiert starten Close to Tray In Tray schließen Show Editor Editor anzeigen Capture Aufnahme Default Tray Icon action Default Action that is triggered by left clicking the tray icon. Tray Icon Settings Display Tray icon notifications Use platform specific notification service Plattformspezifischen Benachrichtigungsdienst verwenden When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. UpdateWatermarkOperation Select Image Bild auswählen Images Bilder All Files Alle Dateien UploadOperation Upload Script Required Upload-Skript erforderlich Please add an upload script via Options > Settings > Upload Script Bitte füge ein Upload-Skript über Optionen > Einstellungen > Upload-Skript hinzu Capture Upload Aufnahme hochladen You are about to upload the image to an external destination, do you want to proceed? Du bist dabei das Bild zu einem externen Ziel hochzuladen, möchtest Du fortfahren? UploaderSettings Ask for confirmation before uploading Vor dem Hochladen nach Bestätigung fragen Uploader Type: Hochladen-Typ: Imgur Imgur Script Skript Uploader Hochladen-Programm VersionTab Version Version Build Build Using: Verwendet: WatermarkSettings Watermark Image Bild für Wasserzeichen Update Aktualisieren Rotate Watermark Wasserzeichen drehen When enabled, Watermark will be added with a rotation of 45° Wenn aktiviert, dreht Wasserzeichen beim Einfügen um 45° Watermark Settings ksnip-1.9.2/translations/ksnip_el.ts000066400000000000000000002070111414701001100175320ustar00rootroot00000000000000 AboutDialog About Σχετικά About Σχετικά Version Έκδοση Author Δημιουργός Close Κλείσιμο Donate Δωρεά Contact Επικοινωνία AboutTab License: Άδεια χρήσης: Screenshot and Annotation Tool Εργαλείο λήψης στιγμιότυπων και σημειώσεων ActionSettingTab Name Όνομα Shortcut Συντόμευση Clear Καθαρισμός Take Capture Σύλληψη Include Cursor Συμπερίληψη του δρομέα Delay Καθυστέρηση s δ Capture Mode Λειτουργία σύλληψης Show image in Pin Window Copy image to Clipboard Αντιγραφή της εικόνας στο πρόχειρο Upload image Αποστολή εικόνας Open image parent directory Save image Αποθήκευση εικόνας Hide Main Window Απόκρυψη του κύριου παραθύρου ActionsSettings Add Προσθήκη Actions Settings Ρυθμίσεις ενεργειών Action Ενέργεια AddWatermarkOperation Watermark Image Required Απαιτείται μια εικόνα υδατογραφήματος Please add a Watermark Image via Options > Settings > Annotator > Update Παρακαλώ προσθέστε μια εικόνα υδατογραφήματος από τις Επιλογές > Ρυθμίσεις > Σχολιαστής > Ενημέρωση AnnotationSettings Smooth Painter Paths Εξομάλυνση των γραμμών σχεδίασης When enabled smooths out pen and marker paths after finished drawing. Όταν είναι ενεργοποιημένο, εξομαλύνει την χάραξη της γραφίδας και των σημαδευτών μετά το πέρας της ενέργειας. Smooth Factor Συντελεστής εξομάλυνσης Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. Η αύξηση της του συντελεστή εξομάλυνσης θα μειώσει την ακρίβεια της γραφίδας και των σημαδευτών αλλά η χάραξη θα φαίνεται πιο ομαλοποιημένη. Annotator Settings Ρυθμίσεις σχολιαστή Remember annotation tool selection and load on startup Απομνημόνευση της επιλογής του εργαλείου σημειώσεων και φόρτωση στην εκκίνηση Switch to Select Tool after drawing Item Εναλλαγή στο εργαλείο επιλογής μετά τον σχεδιασμό του αντικειμένου Number Tool Seed change updates all Number Items Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. Canvas Color Default Canvas background color for annotation area. Changing color affects only new annotation areas. Select Item after drawing With this option enabled the item gets selected after being created, allowing changing settings. ApplicationSettings Capture screenshot at startup with default mode Λήψη στιγμιότυπου κατά την έναρξη στην προκαθορισμένη λειτουργία Application Style Τεχνοτροπία της εφαρμογής Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. Ορίζει την τεχνοτροπία εμφάνισης της εφαρμογής. Για να ληφθούν υπόψιν οι αλλαγές, απαιτείται επανεκκίνηση του ksnip. Application Settings Ρυθμίσεις της εφαρμογής Automatically copy new captures to clipboard Αυτόματη αντιγραφή των νέων συλλήψεων στο πρόχειρο Use Tabs Χρήση καρτελών Change requires restart. Η αλλαγή απαιτεί επανεκκίνηση. Run ksnip as single instance Μοναδική εκτέλεση του ksnip Hide Tabbar when only one Tab is used. Απόκρυψη της γραμμής καρτελών κατά την χρήση μιας καρτέλας. Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. Ενεργοποιώντας αυτήν την επιλογή θα επιτρέπεται μόνο μια υπηρεσία του ksnip, όλες οι υπόλοιπες θα εκτελεστούν όταν ολοκληρωθεί η πρώτη. Η αλλαγή αυτής της επιλογής απαιτεί επανεκκίνηση όλων των υπηρεσιών. Remember Main Window position on move and load on startup Απομνημόνευση της θέσης του κύριου παραθύρου κατά την μετακίνηση και φόρτωση στην εκκίνηση Auto hide Tabs Αυτόματη απόκρυψη των καρτελών Auto hide Docks On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. Auto resize to content Automatically resize Main Window to fit content image. AuthorTab Contributors: Οι συνεισφέροντες: Spanish Translation Ισπανική μετάφραση Dutch Translation Ολλανδική μετάφραση Russian Translation Ρωσική μετάφραση Norwegian Bokmål Translation Νορβηγική μετάφραση (Bokmål) French Translation Γαλλική μετάφραση Polish Translation Πολωνική μετάφραση Snap & Flatpak Support Υποστήριξη Snap & Flatpak The Authors: CanDiscardOperation Warning - Προειδοποίηση - The capture %1%2%3 has been modified. Do you want to save it? Η σύλληψη %1%2%3 έχει τροποποιηθεί. Θέλετε να την αποθηκεύσετε; CaptureModePicker New Νέα Draw a rectangular area with your mouse Σχεδιασμός μιας ορθογώνιας περιοχής με το ποντίκι Capture full screen including all monitors Σύλληψη ολόκληρης της οθόνης συμπεριλαμβανομένου όλων των οθονών Capture screen where the mouse is located Σύλληψη της οθόνης που βρίσκεται ο δρομέας του ποντικιού Capture window that currently has focus Σύλληψη του παραθύρου που έχει την εστίαση Capture that is currently under the mouse cursor Σύλληψη του παραθύρου κάτω από τον δρομέα του ποντικιού Capture a screenshot of the last selected rectangular area Σύλληψη στιγμιότυπου της τελευταίας επιλεγμένης ορθογώνιας περιοχής Uses the screenshot Portal for taking screenshot Χρησιμοποιήστε την πύλη στιγμιότυπου για την λήψη ενός στιγμιότυπου ContactTab Community Κοινότητα If you have general questions, ideas or just want to talk about ksnip, please join our server. εξυπηρετητή. Bug Reports Αναφορές σφαλμάτων Please use Παρακαλώ χρησιμοποιήστε το to report bugs. για αναφορά σφαλμάτων. CopyAsDataUriOperation Failed to copy to clipboard Failed to copy to clipboard as base64 encoded image. Copied to clipboard Αντιγράφηκε στο πρόχειρο Copied to clipboard as base64 encoded image. DeleteImageOperation Delete Image Διαγραφή της εικόνας The item '%1' will be deleted. Do you want to continue? Το αντικείμενο %1 δια διαγραφεί. Θέλετε να συνεχίσετε; DonateTab here εδώ Also possible, Και αυτό γίνεται, Donations are always welcome Οι δωρεές είναι ευπρόσδεκτες Donation Δωρεά Become a GitHub Sponsor Γίνετε χορηγός στο GitHub ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. Το ksnip είναι ένα μη κερδοσκοπικό λογισμικό ελευθέρων πνευματικών δικαιωμάτων, και<br/>εντούτοις έχει κάποια έξοδα που πρέπει να καλυφθούν,<br/>όπως τα έξοδα τομέα ή τα έξοδα για την υποστήριξη σε ανεξαρτήτως πλατύβαθρου υλικό. If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that Αν θέλετε να βοηθήσετε ή απλώς <br/>να εκτιμήσετε την εργασία<br/> προσφέροντας στους δημιουργούς έναν ζύθο ή καφέ, μπορείτε να το κάνετε έστω κι' έτσι EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. EnumTranslator Rectangular Area Ορθογώνια περιοχή Last Rectangular Area Τελευταία ορθογώνια περιοχή Full Screen (All Monitors) Πλήρης οθόνη (Όλες οι οθόνες) Current Screen Τρέχουσα οθόνη Active Window Ενεργό παράθυρο Window Under Cursor Παράθυρο κάτω από τον δρομέα Screenshot Portal Πύλη στιγμιότυπου HandleUploadResultOperation Upload Successful Επιτυχής αποστολή Upload script Μακροεντολή αποστολής finished successfully. ολοκληρώθηκε με επιτυχία. Uploaded to Αποστολή σε Unable to save temporary image for upload. Αδύνατη η προσωρινή αποθήκευση της εικόνας για αποστολή. Unable to start process, check path and permissions. Αδύνατη η εκκίνηση της διεργασίας· ελέγξτε την διαδρομή και τις άδειες. Process crashed Η διεργασία κατέρρευσε Process timed out. Λήξη χρονικού ορίου της διεργασίας. Process read error. Σφάλμα ανάγνωσης της διεργασίας. Process write error. Σφάλμα εγγραφής της διεργασίας. Web error, check console output. Σφάλμα ιστού, ελέγξτε την έξοδο του τερματικού. Unknown process error. Άγνωστο σφάλμα της διεργασίας. Upload Failed Αποτυχία αποστολής Script wrote to StdErr. Η μακροεντολή έγγραψε στο StdErr. HotKeySettings Enable Global HotKeys Ενεργοποίηση των καθολικών συντομεύσεων Capture Rect Area Σύλληψη ορθογώνιας περιοχής Capture Full Screen Σύλληψη πλήρους οθόνης Capture current Screen Σύλληψη τρέχουσας οθόνης Capture active Window Σύλληψη ενεργού παραθύρου Capture Window under Cursor Σύλληψη παραθύρου κάτω από τον δρομέα Global HotKeys Πλήκτρα καθολικών συντομεύσεων Capture Last Rect Area Σύλληψη της τελευταίας ορθογώνιας περιοχής Clear Καθαρισμός Capture using Portal Σύλληψη μέσω της πύλης HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. ImageGrabberSettings Capture mouse cursor on screenshot Σύλληψη του δρομέα του ποντικιού στο στιγμιότυπο Should mouse cursor be visible on screenshots. Αν θα πρέπει να είναι ορατός ο δρομέας του ποντικιού στο στιγμιότυπο. Image Grabber Σύλληψη εικόνας Force Generic Wayland Screenshot Εξαναγκασμός στιγμιότυπου με γενικό Wayland Scale Generic Wayland Screenshots Κλιμάκωση στιγμιότυπων γενικού Wayland Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. Η ενσωμάτωση σε γενικό Wayland που χρησιμοποιεί XDG-DESKTOP-PORTAL διαχειρίζεται την κλιμάκωση της εικόνας διαφορετικά. Η ενεργοποίηση αυτής της επιλογής θα προσδιορίσει την τρέχουσα κλιμάκωση της εικόνας και θα την εφαρμόσει στην στο στιγμιότυπο στο ksnip. GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. Το GNOME και το KDE Plasma υποστηρίζουν τα δικά τους Wayland και γενικού XDG-DESKTOP-PORTAL στιγμιότυπα. Ενεργοποιώντας αυτήν την επιλογή θα εξαναγκάσει το KDE Plasma και το GNOME να χρησιμοποιήσουν τα στιγμιότυπα XDG-DESKTOP-PORTAL. Η αλλαγή της επιλογής αυτής απαιτεί την επανεκκίνηση του ksnip. Show Main Window after capturing screenshot Εμφάνιση του κύριου παραθύρου μετά την σύλληψη του στιγμιότυπου Hide Main Window during screenshot Απόκρυψη του κύριου παραθύρου κατά την σύλληψη του στιγμιότυπου Hide Main Window when capturing a new screenshot. Απόκρυψη του κύριου παραθύρου κατά την σύλληψη ενός στιγμιότυπου. Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. ImgurHistoryDialog Imgur History Ιστορικό Imgur Close Κλείσιμο Time Stamp Χρονοσφραγίδα Link Σύνδεσμος Delete Link Διαγραφή δεσμού ImgurUploader Upload to imgur.com finished! Η αποστολή στο Imgur ολοκληρώθηκε! Received new token, trying upload again… Λήψη νέου αδειοδοτικού, προσπάθεια αποστολής ξανά… Imgur token has expired, requesting new token… Το αδειοδοτικό του Imgur έληξε, γίνεται αίτηση νέας αδειοδότησης… ImgurUploaderSettings Force anonymous upload Εξαναγκασμός ανώνυμης αποστολής Always copy Imgur link to clipboard Αντιγραφή πάντα του δεσμού Imgur στο πρόχειρο Client ID Αναγνωριστικό πελάτη Client Secret Μυστικό πελάτη PIN PIN Enter imgur Pin which will be exchanged for a token. Εισαγάγετε το PIN του Imgur το οποίο θα χρησιμοποιηθεί για την αδειοδότηση. Get PIN Λήψη PIN Get Token Λήψη αδειοδοτικού Imgur History Ιστορικό Imgur Imgur Uploader Αποστολέας Imgur Username Όνομα χρήστη Waiting for imgur.com… Αναμονή του imgur.com… Imgur.com token successfully updated. Το αδειοδοτικό του imgur.com ενημερώθηκε επιτυχώς. Imgur.com token update error. Σφάλμα στην ενημέρωση της αδειοδότησης του imgur.com. After uploading open Imgur link in default browser Μετά την αποστολή άνοιγμα του δεσμού Imgur στον προκαθορισμένο φυλλομετρητή Link directly to image Απευθείας δεσμός της εικόνας Base Url: Βασικό Url: Base url that will be used for communication with Imgur. Changing requires restart. Το βασικό url που θα χρησιμοποιηθεί για την επικοινωνία με το Imgur. Για να ληφθεί υπόψιν η αλλαγή απαιτείται επανεκκίνηση. Clear Token LoadImageFromFileOperation Unable to open image Unable to open image from path %1 MainToolBar New Νέα Delay in seconds between triggering and capturing screenshot. Καθυστέρηση σε δευτερόλεπτα μεταξύ της ενεργοποίησης και της σύλληψης του στιγμιότυπου. s δ Save Αποθήκευση Save Screen Capture to file system Αποθήκευση της σύλληψης στο σύστημα αρχείων Copy Αντιγραφή Copy Screen Capture to clipboard Αντιγραφή της σύλληψης στο πρόχειρο Tools Εργαλεία Undo Αναίρεση Redo Επανάληψη Crop Περικοπή Crop Screen Capture Περικοπή της σύλληψης της οθόνης MainWindow Unsaved Μη αποθηκευμένο Upload Αποστολή Print Εκτύπωση Opens printer dialog and provide option to print image Ανοίγει τον διάλογο εκτύπωσης και προσφέρει την επιλογή εκτύπωσης της εικόνας Print Preview Προεπισκόπηση εκτύπωσης Opens Print Preview dialog where the image orientation can be changed Ανοίγει τον διάλογο προεπισκόπησης της εκτύπωσης από όπου μπορεί να γίνει αλλαγή του προσανατολισμού Scale Κλιμάκωση Quit Έξοδος Settings Ρυθμίσεις &About &Σχετικά Open Άνοιγμα &Edit &Επεξεργασία &Options Επιλο&γές &Help &Βοήθεια Image Files (*.png *.jpg *.bmp) Αρχεία εικόνας (*.png *.jpg *.bmp) Add Watermark Προσθήκη υδατογραφήματος Add Watermark to captured image. Multiple watermarks can be added. Προσθήκη υδατογραφήματος στο στιγμιότυπο. Υποστηρίζεται και η πολλαπλή προσθήκη. &File &Αρχείο Unable to show image Αδύνατη η εμφάνιση της εικόνας Save As... Αποθήκευση ως... Paste Επικόλληση Paste Embedded Ενσωματωμένη επικόλληση Pin Καρφίτσωμα Pin screenshot to foreground in frameless window Καρφίτσωμα του στιγμιότυπου στο προσκήνιο σε άνευ πλαισίου παράθυρα No image provided but one was expected. Αναμενόταν μια εικόνα αλλά δεν παρείχατε κάποια. Copy Path Αντιγραφή της διαδρομής Open Directory Άνοιγμα καταλόγου &View &Προβολή Delete Διαγραφή Rename Μετονομασία Open Images Άνοιγμα εικόνων Show Docks Εμφάνιση αποβάθρας Hide Docks Απόκρυψη αποβάθρας Copy as data URI Open &Recent Άνοιγμα πρόσφατου Modify Canvas Τροποποίηση του καμβά Upload triggerCapture to external source Copy triggerCapture to system clipboard Scale Image Κλιμάκωση εικόνας Rotate Περιστροφή Rotate Image Περιστροφή εικόνας MultiCaptureHandler Save Αποθήκευση Save As Αποθήκευση ως Open Directory Άνοιγμα καταλόγου Copy Αντιγραφή Copy Path Αντιγραφή της διαδρομής Delete Διαγραφή Rename Μετονομασία NewCaptureNameProvider Capture Σύλληψη PinWindow Close Κλείσιμο Close Other Κλείσιμο των άλλων Close All Κλείσιμο όλων PinWindowHandler Pin Window %1 Καρφίτσωμα του παραθύρου %1 RenameOperation Image Renamed Η εικόνα μετονομάστηκε Successfully renamed image to Η εικόνα μετονομάστηκε επιτυχώς σε Image Rename Failed Η μετονομασία της εικόνας απέτυχε Failed to rename image to Αποτυχία μετονομασίας της εικόνας σε Rename image Μετονομασία της εικόνας New filename: Νέο όνομα αρχείου: SaveOperation Save As Αποθήκευση ως Images Εικόνες All Files Όλα τα αρχεία Image Saved Η εικόνα αποθηκεύτηκε Saving Image Failed Η αποθήκευση της εικόνας απέτυχε Saved to Αποθηκεύτηκε στο Failed to save image to Αποτυχία αποθήκευσης της εικόνας στο SaverSettings Automatically save new captures to default location Αυτόματη αποθήκευση των νέων λήψεων στην προκαθορισμένη τοποθεσία Prompt to save before discarding unsaved changes Προτροπή για αποθήκευση πριν την απόρριψη των μη αποθηκευμένων αλλαγών Remember last Save Directory Απομνημόνευση του τελευταίου καταλόγου αποθήκευσης When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. Όταν είναι ενεργοποιημένο απομνημονεύεται ο τελευταία χρησιμοποιούμενος κατάλογος για χρήση στις επόμενες αποθηκεύσεις. Capture save location and filename Τοποθεσία και όνομα αρχείου αποθήκευσης της σύλληψης Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. Οι υποστηριζόμενοι τύποι είναι JPG, PNG και BMP. Αν δεν ορίσετε τον τύπο θα χρησιμοποιηθεί εξ ορισμού το PNG. Το όνομα αρχείου μπορεί να περιέχει τα ακόλουθα σύμβολα υποκατάστασης: - $Y, $M, $D για την ημερομηνία, $h, $m, $s για την ώρα, ή $T για την ώρα σε μορφή hhmmss. - Πολλαπλές ακολουθίες # για τον μετρητή. Με χρήση των #### θα λάβετε 0001, και στην επόμενη σύλληψη θα γίνει 0002. Browse Περιήγηση Saver Settings Αποθήκευση των ρυθμίσεων Capture save location Τοποθεσία αποθήκευσης της σύλληψης Default Προεπιλογή Factor Συντελεστής Save Quality Ποιότητα αποθήκευσης Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. Ορίστε 0 για να αποκτήσετε μικρά συμπιεσμένα αρχεία, 100 για μεγάλα μη συμπιεσμένα αρχεία. Το πλήρες εύρος δεν υποστηρίζεται από όλους τους τύπους εικόνας· το JPEG το υποστηρίζει. ScriptUploaderSettings Copy script output to clipboard Αντιγραφή της εξόδου της μακροεντολής στο πρόχειρο Script: Μακροεντολή: Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. Η διαδρομή της μακροεντολής που θα εκτελεστεί για την αποστολή. Κατά την αποστολή η μακροεντολή θα εκτελεστεί με μοναδικό όρισμα την διαδρομή ενός προσωρινού αρχείου png. Browse Περιήγηση Script Uploader Μακροεντολή αποστολής Select Upload Script Επιλογή μακροεντολής αποστολής Stop when upload script writes to StdErr Διακοπή όταν η μακροεντολή αποστολής γράφει στο StdErr Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. Σημειώνει την αποστολή ως αποτυχημένη όταν η μακροεντολή γράφει στο StdErr. Χωρίς αυτήν την ρύθμιση τα τυχόν σφάλματα της μακροεντολής θα περάσουν απαρατήρητα. Filter: Φίλτρο: RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. Κανονική έκφραση. Αντιγραφή στο πρόχειρο μόνο ό,τι ταιριάζει στην κανονική έκφραση. Αν δεν οριστεί κάποιο φίλτρο θα αντιγραφούν όλες οι γραμμές. SettingsDialog Settings Ρυθμίσεις OK Εντάξει Cancel Άκυρο Image Grabber Σύλληψη εικόνας Imgur Uploader Αποστολέας Imgur Application Εφαρμογή Annotator Σχολιαστής HotKeys Πλήκτρα συντομεύσεων Uploader Αποστολέας Script Uploader Μακροεντολή αποστολής Saver Αποθήκευση Stickers Αυτοκόλλητα Snipping Area Περιοχή σύλληψης Tray Icon Εικονίδιο πλαισίου συστήματος Watermark Υδατογράφημα Actions Ενέργειες SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Use arrow keys to move the selection. Use arrow keys while pressing CTRL to move top left handle. Use arrow keys while pressing ALT to move bottom right handle. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. This message can be disabled via settings. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Hold CTRL pressed to resize selection after selecting. Hold CTRL pressed to prevent resizing after selecting. Operation will be canceled after 60 sec when no selection made. This message can be disabled via settings. SnippingAreaSettings Freeze Image while snipping Πάγωμα της οθόνης κατά την σύλληψη When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. Όταν είναι ενεργοποιημένο, το παρασκήνιο θα είναι παγωμένο κατά την επιλογή της ορθογώνιας περιοχής. Επίσης αλλάζει την συμπεριφορά των στιγμιότυπων με καθυστέρηση: η καθυστέρηση λαμβάνει χώρα πριν την εμφάνιση της περιοχής σύλληψης ενώ όταν είναι απενεργοποιημένο η καθυστέρηση λαμβάνει χώρα μετά την εμφάνιση της περιοχής σύλληψης. Αυτό το χαρακτηριστικό είναι απενεργοποιημένο για τον εξυπηρετητή Wayland και πάντα ενεργοποιημένο για το MacOs. Show magnifying glass on snipping area Εμφάνιση του μεγεθυντικού φακού στην περιοχή σύλληψης Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. Εμφανίζει έναν μεγεθυντικό φακό ο οποίος εστιάζει στην εικόνα του παρασκηνίου. Αυτή η επιλογή λειτουργεί μόνο όταν το "πάγωμα της οθόνης κατά την σύλληψη" είναι ενεργοποιημένο. Show Snipping Area rulers Εμφάνιση των χαράκων στην περιοχή σύλληψης Horizontal and vertical lines going from desktop edges to cursor on snipping area. Οριζόντιες και κάθετες γραμμές από τις άκρες της επιφάνειας εργασίας μέχρι τον δρομέα στην περιοχή της σύλληψης. Show Snipping Area position and size info Εμφάνιση των πληροφοριών θέσης και μεγέθους στην περιοχή σύλληψης When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. Όταν το αριστερό κλικ του ποντικιού δεν είναι πιεσμένο, εμφανίζεται η θέση. Όταν το κλικ του ποντικιού είναι πατημένο, το μέγεθος της επιλεγμένης περιοχής εμφανίζεται στα αριστερά και κάτω από την περιοχή σύλληψης. Allow resizing rect area selection by default When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. Όταν είναι ενεργοποιημένο και αφού έχει επιλεγεί μια ορθογώνια περιοχή, επιτρέπει την αλλαγή μεγέθους της επιλογής. Μετά το πέρας της ενέργειας επιβεβαιώστε πιέζοντας το πλήκτρο Enter. Show Snipping Area info text Snipping Area cursor color Χρώμα του δρομέα της περιοχής σύλληψης Sets the color of the snipping area cursor. Ορίζει το χρώμα του δρομέα της περιοχής σύλληψης. Snipping Area cursor thickness Πάχος του δρομέα της περιοχής σύλληψης Sets the thickness of the snipping area cursor. Ορίζει το πάχος του δρομέα της περιοχής σύλληψης. Snipping Area Snipping Area adorner color Sets the color of all adorner elements on the snipping area. Snipping Area Transparency Alpha for not selected region on snipping area. Smaller number is more transparent. StickerSettings Up Πάνω Down Κάτω Use Default Stickers Χρήση των προκαθορισμένων αυτοκόλλητων Sticker Settings Ρυθμίσεις αυτοκόλλητων Vector Image Files (*.svg) Αρχεία διανυσματικών εικόνων (*.svg) Add Προσθήκη Remove Αφαίρεση Add Stickers Προσθήκη αυτοκόλλητων TrayIcon Show Editor Εμφάνιση επεξεργαστή TrayIconSettings Use Tray Icon Εικονίδιο στο πλαίσιο συστήματος When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. Όταν είναι ενεργοποιημένο προστίθεται ένα εικονίδιο στο πλαίσιο συστήματος αν υποστηρίζεται από τον διαχειριστή παραθύρων του λειτουργικού συστήματος. Για να ληφθούν υπόψιν οι αλλαγές, απαιτείται επανεκκίνηση. Minimize to Tray Ελαχιστοποίηση στο πλαίσιο συστήματος Start Minimized to Tray Εκκίνηση ελαχιστοποιημένο στο πλαίσιο συστήματος Close to Tray Κλείσιμο στο πλαίσιο συστήματος Show Editor Εμφάνιση επεξεργαστή Capture Σύλληψη Default Tray Icon action Default Action that is triggered by left clicking the tray icon. Tray Icon Settings Display Tray icon notifications Use platform specific notification service When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. UpdateWatermarkOperation Select Image Επιλογή εικόνας Images Εικόνες All Files Όλα τα αρχεία UploadOperation Upload Script Required Απαιτείται μια μακροεντολή αποστολής Please add an upload script via Options > Settings > Upload Script Παρακαλώ προσθέστε μια μακροεντολή αποστολής από το μενού Επιλογές > Ρυθμίσεις > Μακροεντολή αποστολής Capture Upload Αποστολή της σύλληψης You are about to upload the image to an external destination, do you want to proceed? Πρόκειται να κάνετε αποστολή της εικόνας σε έναν εξωτερικό προορισμό. Επιθυμείτε να συνεχίσετε; UploaderSettings Ask for confirmation before uploading Ερώτηση επιβεβαίωσης πριν την αποστολή Uploader Type: Τύπος αποστολέα: Imgur Imgur Script Μακροεντολή Uploader Αποστολέας VersionTab Version Έκδοση Build Κατασκευή Using: Γίνεται χρήση: WatermarkSettings Watermark Image Εικόνα υδατογραφήματος Update Ενημέρωση Rotate Watermark Περιστροφή υδατογραφήματος When enabled, Watermark will be added with a rotation of 45° Όταν είναι ενεργοποιημένο, το υδατογράφημα θα εισαχθεί με περιστροφή 45° Watermark Settings Ρυθμίσεις υδατογραφήματος ksnip-1.9.2/translations/ksnip_es.ts000066400000000000000000001663721414701001100175570ustar00rootroot00000000000000 AboutDialog About Acerca de About Acerca de Version Versión Author Autor Close Cerrar Donate Donar Contact AboutTab License: Licencia: Screenshot and Annotation Tool ActionSettingTab Name Nombre Shortcut Atajo Clear Limpiar Take Capture Tomar captura Include Cursor Incluir cursor Delay Retrasar s s Capture Mode Modo de captura Show image in Pin Window Mostrar imagen en la ventana de alfiler Copy image to Clipboard Copiar imagen al portapapeles Upload image Cargar imagen Open image parent directory Abrir directorio principal de imágenes Save image Guardar imagen Hide Main Window ActionsSettings Add Añadir Actions Settings Configuración de acciones Action Acción AddWatermarkOperation Watermark Image Required Imagen de marca de agua requerida Please add a Watermark Image via Options > Settings > Annotator > Update Agrega una Imagen de Marca de Agua via Opciones > Configuracion > Anotador > Actualizar AnnotationSettings Smooth Painter Paths Suavizar Rutas del dibujo When enabled smooths out pen and marker paths after finished drawing. Cuando está habilitado, suavizar pluma y trazados de marcador al terminar de dibujar. Smooth Factor Factor del suavizado Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. Aumentar el factor del suavizado, disminuirá precisión para lápiz y marcador, los hará más suaves. Annotator Settings Ajustes del anotador Remember annotation tool selection and load on startup Recordar herramienta de selección y cargarla al iniciar Switch to Select Tool after drawing Item Cambiar a la herramienta de selección después de dibujar un elemento Number Tool Seed change updates all Number Items Al seleccionar un modo diferente en la herramienta numérica se actualizan todos los elementos numéricos Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. La desactivación de esta opción provoca cambios en la simiente de la herramienta numérica para afectar solo a los elementos nuevos, pero no a los existentes. Desactivar esta opción permite tener números duplicados. Canvas Color Color del lienzo Default Canvas background color for annotation area. Changing color affects only new annotation areas. Color de fondo del lienzo predeterminado para el área de anotaciones. El cambio de color afecta solo a las áreas de anotación nuevas. Select Item after drawing With this option enabled the item gets selected after being created, allowing changing settings. ApplicationSettings Capture screenshot at startup with default mode Captura de pantalla al inicio con el modo predeterminado Application Style Estilo de aplicación Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. Establece el estilo de la aplicación que define la apariencia de la GUI El cambio requiere el reinicio de ksnip para que tenga efecto. Application Settings Ajustes de la aplicación Automatically copy new captures to clipboard Copiar automáticamente al portapapeles las nuevas capturas Use Tabs Usar pestañas Change requires restart. El cambio requiere reiniciar. Run ksnip as single instance Mantener ksnip como una única instancia al abrirla nuevamente Hide Tabbar when only one Tab is used. Ocultar barra de pestañas solo cuando una pestaña está en uso. Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. Habilitando esta opción permitirá que solo una instancia de ksnip inicie, el resto de las instancias iniciadas después pasarán sus argumentos a la primera y se cerrarán. Cambiar esta opción requiere un nuevo inicio de todas las instancias. Remember Main Window position on move and load on startup Al mover la ventana principal recordar la posición y restaurarla al iniciar Auto hide Tabs Ocultar automáticamente las pestañas Auto hide Docks Ocultar automáticamente los Docks On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. Al inicio ocultar la barra de herramientar y las opciones de comentarios. La visibilidad del Dock puede ser alternada con el tabulador. Auto resize to content Cambio de tamaño automático al contenido Automatically resize Main Window to fit content image. Cambie automáticamente el tamaño de la ventana principal para que se ajuste a la imagen del contenido. AuthorTab Contributors: Colaboradores: Spanish Translation Traducción al castellano Dutch Translation Traducción al neerlandés Russian Translation Traducción al ruso Norwegian Bokmål Translation Traducción al noruego «bokmål» French Translation Traducción al francés Polish Translation Traducción al polaco Snap & Flatpak Support Compatibilidad con Snap y Flatpak The Authors: Autores: CanDiscardOperation Warning - Advertencia - The capture %1%2%3 has been modified. Do you want to save it? Se ha modificado la captura %1%2%3. ¿Quiere guardarla? CaptureModePicker New Nuevo Draw a rectangular area with your mouse Dibuje un área rectangular con el ratón Capture full screen including all monitors Capturar pantalla completa, incluidos todos los monitores Capture screen where the mouse is located Capturar pantalla donde se localiza el ratón Capture window that currently has focus Capturar ventana que actualmente tiene el foco Capture that is currently under the mouse cursor Captura que se encuentra actualmente debajo del cursor del mouse Capture a screenshot of the last selected rectangular area Realiza una captura de pantalla de la última área rectangular seleccionada Uses the screenshot Portal for taking screenshot Usa el portal de capturas para tomar capturas ContactTab Community If you have general questions, ideas or just want to talk about ksnip, please join our server. Bug Reports Please use Utilice to report bugs. para informar de defectos. CopyAsDataUriOperation Failed to copy to clipboard No se pudo copiar al portapapeles Failed to copy to clipboard as base64 encoded image. No se pudo copiar al portapapeles como imagen codificada en base64. Copied to clipboard Copiado al portapapeles Copied to clipboard as base64 encoded image. Copiado al portapapeles como imagen codificada en base64. DeleteImageOperation Delete Image Eliminar imagen The item '%1' will be deleted. Do you want to continue? Se eliminará el elemento «%1». ¿Quiere continuar? DonateTab here aquí Also possible, También es posible, Donations are always welcome Las donaciones son siempre bienvenidas Donation Donación Become a GitHub Sponsor Convertirse en patrocinador en GitHub ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. ksnip es un projecto de software libre, y<br/>aún tiene algunos costos que necesitan ser cubiertos,<br/>como costos de dominios o hardware para soporte multi plataforma. If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that Si quieres ayudar o solo<br/>quieres apreciar el trabajo que se está haciendo<br/>invitando a los desarrolladores a una cerveza o un café, puede hacerlo EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. Agregue nuevas acciones presionando el botón de la pestaña 'Agregar'. EnumTranslator Rectangular Area Área rectangular Last Rectangular Area Última área rectangular Full Screen (All Monitors) Pantalla completa (todos los monitores) Current Screen Pantalla actual Active Window Ventana activa Window Under Cursor Ventana bajo el puntero Screenshot Portal Portal de capturas HandleUploadResultOperation Upload Successful Subida con éxito Upload script Secuencia de carga finished successfully. finalizado exitosamente. Uploaded to Subido a Unable to save temporary image for upload. Incapaz de guardar temporalmente la imagen para subir. Unable to start process, check path and permissions. Incapaz de iniciar el proceso, revise la ruta y los permisos. Process crashed Proceso se cayó Process timed out. Proceso con tiempo de espera agotado. Process read error. Proceso con error de lectura. Process write error. Proceso con error de escritura. Web error, check console output. Error Web, revise la salida en la consola. Unknown process error. Proceso con error desconocido. Upload Failed Subida fallida Script wrote to StdErr. Secuencia transferida a la salida estándar de errores. HotKeySettings Enable Global HotKeys Activar atajos de teclado globales Capture Rect Area Capturar área rectangular Capture Full Screen Capturar pantalla completa Capture current Screen Capturar pantalla actual Capture active Window Capturar ventana activa Capture Window under Cursor Capturar ventana bajo el puntero Global HotKeys Atajos de teclado globales Capture Last Rect Area Captura la última área rectangular Clear Limpiar Capture using Portal Capturar mediante portal HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. Actualmente, las teclas de acceso rápido solo son compatibles con Windows y X11. La desactivación de esta opción también hace que los atajos de acción sean solo en ksnip. ImageGrabberSettings Capture mouse cursor on screenshot Capturar el cursor del ratón en la captura de pantalla Should mouse cursor be visible on screenshots. El cursor del mouse debe estar visible sobre las capturas de pantalla. Image Grabber Capturador de imágenes Force Generic Wayland Screenshot Forzar captura de pantalla genérica de Wayland Scale Generic Wayland Screenshots Escalar capturas de pantalla genéricas de Wayland Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. Implementaciones genéricas de Wayland que utilizan Escalado de pantalla de control XDG-DESKTOP-PORTAL diferentemente. Habilitar esta opción determinar la escala de pantalla actual y aplicar eso a la captura de pantalla en ksnip. GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. GNOME y KDE Plasma admiten su propio Wayland y las capturas de pantalla genéricas de XDG-DESKTOP-PORTAL. Habilitar esta opción forzará KDE Plasma y GNOME para usar las capturas de pantalla de XDG-DESKTOP-PORTAL. El cambio en esta opción requiere un reinicio de ksnip. Show Main Window after capturing screenshot Mostrar ventana principal después de una captura de pantalla Hide Main Window during screenshot Ocultar la ventana principal durante una captura de pantalla Hide Main Window when capturing a new screenshot. Ocultar la ventana principal al realizar una nueva captura de pantalla. Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. ImgurHistoryDialog Imgur History Historial Imgur Close Cerrar Time Stamp Cronomarcador Link Enlace Delete Link Eliminar enlace ImgurUploader Upload to imgur.com finished! Finalizó la carga en imgur.com. Received new token, trying upload again… Se recibió una ficha nueva; reintentando la carga… Imgur token has expired, requesting new token… La ficha de Imgur ha caducado; solicitando una nueva… ImgurUploaderSettings Force anonymous upload Forzar carga anónima Always copy Imgur link to clipboard Siempre copiar enlace de Imgur al portapapeles Client ID Id. de cliente Client Secret Secreto de cliente PIN PIN Enter imgur Pin which will be exchanged for a token. Introduzca el PIN de Imgur, que se intercambiará por una ficha. Get PIN Obtener PIN Get Token Obtener ficha Imgur History Historial de Imgur Imgur Uploader Cargador de Imgur Username Nombre de usuario Waiting for imgur.com… Esperando a imgur.com… Imgur.com token successfully updated. Se actualizó la ficha de Imgur.com correctamente. Imgur.com token update error. Error de actualización de la ficha de Imgur.com. After uploading open Imgur link in default browser Después de subir, abra el enlace de Imgur en el navegador predeterminado Link directly to image Enlazar directamente a la imagen Base Url: URL de base: Base url that will be used for communication with Imgur. Changing requires restart. El URL de base que se utilizará para la comunicación con Imgur. Cambiarlo requiere reiniciar. Clear Token Limpiar Token LoadImageFromFileOperation Unable to open image No se puede abrir la imagen Unable to open image from path %1 No se puede abrir la imagen de la ruta% 1 MainToolBar New Nuevo Delay in seconds between triggering and capturing screenshot. Demora en segundos entre la activación y la captura de pantalla. s s Save Guardar Save Screen Capture to file system Guardar captura de pantalla en el sistema de archivos Copy Copiar Copy Screen Capture to clipboard Copiar captura de pantalla en el portapapeles Tools Herramientas Undo Deshacer Redo Rehacer Crop Recortar Crop Screen Capture Recortar captura de pantalla MainWindow Unsaved No guardado Upload Cargar Print Imprimir Opens printer dialog and provide option to print image Abre el cuadro de diálogo de la impresora y proporciona la opción para imprimir la imagen Print Preview Previsualizar impresión Opens Print Preview dialog where the image orientation can be changed Abre el cuadro de diálogo Previsualizar impresión, donde se puede cambiar la orientación de la imagen Scale Escalar Quit Salir Settings Configuración &About &Acerca de Open Abrir &Edit &Editar &Options &Opciones &Help Ay&uda Image Files (*.png *.jpg *.bmp) Archivos de imagen (*.png *.jpg *.bmp) Add Watermark Añadir marca de agua Add Watermark to captured image. Multiple watermarks can be added. Añade la marca de agua a la imagen capturada. Se pueden añadir múltiples marcas de agua. &File &Archivo Unable to show image No se puede mostrar la imagen Save As... Guardar como... Paste Pegar Paste Embedded Pegar incrustado Pin Anclar Pin screenshot to foreground in frameless window Fija la captura de pantalla al primer plano en una ventana sin marco No image provided but one was expected. No se proporcionó ninguna imagen aunque se esperaba una. Copy Path Copiar ruta Open Directory Abrir directorio &View &Ver Delete Eliminar Rename Renombrar Open Images Abrir imagenes Show Docks Mostrar muelles Hide Docks Esconder Docks Copy as data URI Copiar como URI de datos Open &Recent Abierto & reciente Modify Canvas Modificar lienzo Upload triggerCapture to external source Cargar captura de disparo a una fuente externa Copy triggerCapture to system clipboard Copiar captura de disparador al portapapeles del sistema Scale Image Rotate Rotate Image MultiCaptureHandler Save Guardar Save As Guardar como Open Directory Abrir directorio Copy Copiar Copy Path Copiar ruta Delete Eliminar Rename Renombrar NewCaptureNameProvider Capture Capturar PinWindow Close Cerrar Close Other Cerrar otros Close All Cerrar todo PinWindowHandler Pin Window %1 Anclar ventana %1 RenameOperation Image Renamed Imagen renombrada Successfully renamed image to Imagen renombrada exitosamente a Image Rename Failed Fallo al renombrar la imagen Failed to rename image to Falli al renombrar la imagen a Rename image Renombrar imagen New filename: Nuevo nombre de archivo: SaveOperation Save As Guardar como Images Imágenes All Files Todos los archivos Image Saved Imagen guardada Saving Image Failed No se pudo guardar la imagen Saved to Guardado en Failed to save image to No se pudo guardar la imagen en SaverSettings Automatically save new captures to default location Guardar automáticamente las capturas nuevas a la ubicación predeterminada Prompt to save before discarding unsaved changes Preguntar antes de descartar cambios no guardados Remember last Save Directory Recordar última carpeta de guardado When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. Cuando está habilitado, sobreescribe la última carpeta guardada en las configuraciones con la última carpeta en donde se guarda, esto lo hace en cada guardado. Capture save location and filename Captura la ubicación de guardado y el nombre del archivo Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. Los formatos soportados son JPG, PNG and BMP. Si no se indica un formato, se usará PNG por defecto. El nombre del archivo puede contener los siguientes comodines: - $Y, $M, $D para la fecha, $h, $m, $s para la hora, or $T para hora en el formato hhmmss. - Multiples consecutivos # para un correlativo. #### generará un 0001, siguiente captura será 0002. Browse Examinar Saver Settings Configuraciones de guardado Capture save location Ubicación de guardado de capturas Default Predeterminado Factor Factor Save Quality Calidad de guardado Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. Defina 0 para obtener archivos pequeños y comprimidos o 100 para archivos grandes y sin comprimir. No todos los formatos de archivo admiten todo el intervalo; JPG lo hace. ScriptUploaderSettings Copy script output to clipboard Copiar salida de la secuencia en el portapapeles Script: Secuencia de órdenes: Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. Ruta a la secuencia que se llamará para la carga. Durante la carga la secuencia se invocará con la ruta a un archivo PNG temporal como único argumento. Browse Examinar Script Uploader Cargador por secuencia Select Upload Script Seleccione secuencia de carga Stop when upload script writes to StdErr Detener cuando la secuencia de carga escriba en la salida de errores estándar Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. Marca la carga como fallida cuando el script escribe en StdErr. Sin esta configuración, los errores en el script pasarán desapercibidos. Filter: Filtro: RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. Expresión RegEx. Solo copie al portapapeles lo que coincida con la expresión RegEx. Cuando se omite, se copia todo. SettingsDialog Settings Ajustes OK Aceptar Cancel Cancelar Image Grabber Capturador de imágenes Imgur Uploader Cargador de Imgur Application Aplicación Annotator Anotador HotKeys Atajos de teclado Uploader Cargador Script Uploader Cargar con secuencia Saver Guardado Stickers Adhesivos Snipping Area Área de recorte Tray Icon Icono de bandeja Watermark Marca de Agua Actions Acciones SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Cambie el tamaño del rectángulo seleccionado usando las manijas o muévalo arrastrando la selección. Use arrow keys to move the selection. Utilice las teclas de flecha para mover la selección. Use arrow keys while pressing CTRL to move top left handle. Use las teclas de flecha mientras presiona CTRL para mover la manija superior izquierda. Use arrow keys while pressing ALT to move bottom right handle. Use las teclas de flecha mientras presiona ALT para mover la manija inferior derecha. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. Confirme la selección presionando ENTER / RETURN o cancele presionando ESC. This message can be disabled via settings. Este mensaje se puede desactivar a través de la configuración. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Haga clic y arrastre para seleccionar un área rectangular o presione ESC para salir. Hold CTRL pressed to resize selection after selecting. Mantenga presionada la tecla CTRL para cambiar el tamaño de la selección después de seleccionarla. Hold CTRL pressed to prevent resizing after selecting. Mantenga presionada la tecla CTRL para evitar cambiar el tamaño después de seleccionar. Operation will be canceled after 60 sec when no selection made. La operación se cancelará después de 60 segundos cuando no se realice ninguna selección. This message can be disabled via settings. Este mensaje se puede desactivar a través de la configuración. SnippingAreaSettings Freeze Image while snipping Congele la imagen mientras corta When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. Cuando está habilitado, congelará el fondo mientras seleccionando una región rectangular. También cambia el comportamiento de las capturas de pantalla retrasadas, con esto opción habilitada, el retraso ocurre antes de que se muestra el área de recorte y con la opción desactivada el retraso ocurre después de que se muestra el área de recorte. Esta función siempre está desactivada para Wayland y siempre habilitado para MacOs. Show magnifying glass on snipping area Mostrar lupa en el área de corte Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. Muestra una lupa que se acerca a la imagen de fondo. Esta opción solo funciona con la opción "Congelar la imagen mientras se corta" activada. Show Snipping Area rulers Mostrar reglas del área de recorte Horizontal and vertical lines going from desktop edges to cursor on snipping area. Líneas horizontales y verticales que van desde los bordes del escritorio al cursor en el área de corte. Show Snipping Area position and size info Mostrar la posición del área de corte y la información del tamaño When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. Allow resizing rect area selection by default When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. Show Snipping Area info text Snipping Area cursor color Color del área de corte del cursor Sets the color of the snipping area cursor. Snipping Area cursor thickness Grosor del área de corte del cursor Sets the thickness of the snipping area cursor. Snipping Area Área de recorte Snipping Area adorner color Sets the color of all adorner elements on the snipping area. Snipping Area Transparency Alpha for not selected region on snipping area. Smaller number is more transparent. StickerSettings Up Arriba Down Abajo Use Default Stickers Utilizar adhesivos predeterminados Sticker Settings Configuración de adhesivos Vector Image Files (*.svg) Archivos de imagen vectorial (*.svg) Add Añadir Remove Quitar Add Stickers Adicionar pegatina TrayIcon Show Editor Mostrar editor TrayIconSettings Use Tray Icon Usa el icono de la bandeja When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. Al activarse, añadirá un icono de bandeja a la barra de tareas si el administrador de ventanas del sistema operativo lo admite. El cambio requiere que se reinicie. Minimize to Tray Minimizar a la bandeja Start Minimized to Tray Iniciar minimizado en la bandeja Close to Tray Cierre a la Bandeja Show Editor Mostrar editor Capture Capturar Default Tray Icon action Default Action that is triggered by left clicking the tray icon. Tray Icon Settings Display Tray icon notifications Use platform specific notification service When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. UpdateWatermarkOperation Select Image Seleccionar imagen Images Imágenes All Files Todos los archivos UploadOperation Upload Script Required Se requiere la secuencia de carga Please add an upload script via Options > Settings > Upload Script Añada una secuencia de carga en Opciones ▸ Configuración ▸ Secuencia de carga Capture Upload Carga de captura You are about to upload the image to an external destination, do you want to proceed? Está a punto de cargar la imagen en un destino externo. ¿Quiere continuar? UploaderSettings Ask for confirmation before uploading Pedir confirmación antes de cargar Uploader Type: Tipo de cargador: Imgur Imgur Script Secuencia de órdenes Uploader Subir imagen VersionTab Version Versión Build Construcción Using: Usando: WatermarkSettings Watermark Image Imagen de marca de agua Update Actualización Rotate Watermark Rotar la marca de agua When enabled, Watermark will be added with a rotation of 45° Cuando esté activada, la marca de agua se añadirá con una rotación de 45° Watermark Settings ksnip-1.9.2/translations/ksnip_eu.ts000066400000000000000000001647151414701001100175600ustar00rootroot00000000000000 AboutDialog About Honi buruz About Honi buruz Version Bertsioa Author Egilea Donate Diruz lagundu Close Itxi Contact Kontaktua AboutTab License: Lizentzia: Screenshot and Annotation Tool Pantaila argazkia eta oharrak hartzeko tresna ActionSettingTab Name Izena Shortcut Lasterbidea Clear Garbitu Take Capture Argazkia egin Include Cursor Kurtsorea hartu Delay Atzerapena s s Capture Mode Argazki modua Show image in Pin Window Erakutsi irudia finkatutako leihoan Copy image to Clipboard Kopiatu irudia arbelera Upload image Kargatu irudia Open image parent directory Ireki irudien direktorio nagusia Save image Gorde irudia Hide Main Window Ezkutatu leiho nagusia ActionsSettings Add Gehitu Actions Settings Ekintzen ezarpenak Action Ekintza AddWatermarkOperation Watermark Image Required Ur-markarako irudia behar da Please add a Watermark Image via Options > Settings > Annotator > Update Ur-markarako irudia gehitu honela Aukerak > Ezarpenak > Ohar-hartzailea > Eguneratu AnnotationSettings Smooth Painter Paths Leundu marrazkien lineak When enabled smooths out pen and marker paths after finished drawing. Aktibatuta dagoenean, leundu arkatza eta markatzailearen lerroak marrazketa bukatzean. Smooth Factor Leuntze faktorea Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. Leuntze faktorean handitzeak arkatza eta markatzailearen zehaztasun galera dakar, haien leuntasuna areagotuz. Annotator Settings Nabarmentzearen ezarpenak Remember annotation tool selection and load on startup Gogoratu ohargilearen hautaketa eta kargatu abiatzean Switch to Select Tool after drawing Item Aldatu Hautatu tresnara elementua marraztu ondoren Number Tool Seed change updates all Number Items Zenbakien tresna aldatzean zenbaki elementu guztiak eguneratzen dira Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. Aukera hau desgaitzeak zenbakien tresnan aldaketak eragiten ditu soilik elementu berrietan, baina ez dauden elementuak. Aukera hau desgaitzeak zenbaki bikoiztuak edukitzea ahalbidetzen du. Canvas Color Oihalaren kolorea Default Canvas background color for annotation area. Changing color affects only new annotation areas. Oharpen-eremurako oihalaren atzeko planoaren kolore lehenetsia. Koloreak aldatzeak oharpen gune berriei eragiten die. Select Item after drawing Hautatu elementua marraztu ondoren With this option enabled the item gets selected after being created, allowing changing settings. Aukera hau gaituta dagoenean, elementua hautatuta geratzen da sortu ondoren, hartara ezarpenak aldatu daitezke. ApplicationSettings Capture screenshot at startup with default mode Kapturatu pantaila-argazkia abiaraztean modu lehenetsian Application Style Aplikazioaren estiloa Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. Erabiltzailearen Interfaze Grafikoaren itxura ezartzen du. Ksnip berrabiarazi behar du aldaketek eragina izateko. Application Settings Aplikazioaren ezarpenak Automatically copy new captures to clipboard Kopiatu kaptura berriak arbelera automatikoki Use Tabs Erabili fitxak Change requires restart. Aldaketak berrabiaraztea eskatzen du. Run ksnip as single instance Erabili ksnip instantzia bakarrean Hide Tabbar when only one Tab is used. Ezkutatu fitxen barra fitxa bakarra dagoenean. Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. Aukera hau gaituz gero ksnip instantzia bakarra exekutatu ahal izango da, haren ondoren abiatutako beste instantziek lehenegoari pasatuko diote euren argumentuak eta itxiko dira. Aukera hau aldatzeak instantzia guztiak berrabiaraztea eskatzen du. Remember Main Window position on move and load on startup Gogoratu leiho nagusiaren kokapena mugitzean eta kargatu abioan Auto hide Tabs Ezkutatu fitxak automatikoki Auto hide Docks Auto ezkutatu kaiak On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. Ezkutatu tresna barra eta oharpen ezarpenak abiatzean. Kaien ikusgarritasuna Tab teklarekin txandakatu daiteke. Auto resize to content Aldatu automatikoki tamainara egokituz Automatically resize Main Window to fit content image. Aldatu automatikoki leiho nagusiaren tamaina edukiaren irudira doitzeko. AuthorTab Contributors: Laguntzaileak: Spanish Translation Gaztelerako itzulpena Dutch Translation Alemanerako itzulpena Russian Translation Errusierako itzulpena Norwegian Bokmål Translation Norvegierako itzulpena French Translation Frantseserako itzulpena Polish Translation Polonierako itzulpena Snap & Flatpak Support Snap eta Flatpak euskarria The Authors: Egileak: CanDiscardOperation Warning - Oharra - The capture %1%2%3 has been modified. Do you want to save it? %1%2%3 argazkia aldatu da. Nahi duzu gordetzea? CaptureModePicker New Berria Draw a rectangular area with your mouse Marraztu area laukizuzena saguaren bidez Capture a screenshot of the last selected rectangular area Egin pantailan hautatutako azken area laukizuzenaren argazkia Capture full screen including all monitors Egin monitore guztiak barne hartzen dituen pantaila-argazkia Capture screen where the mouse is located Egin sagua kokatuta dagoen pantailaren argazkia Capture window that currently has focus Egin fokuratuta dagoen leihoaren argazkia Capture that is currently under the mouse cursor Egin kurtsorearen azpian dagoenaren argazkia Uses the screenshot Portal for taking screenshot Pantaila-argazkien ataria erabiltzen du pantaila-argazkia egiteko ContactTab Community Komunitatea If you have general questions, ideas or just want to talk about ksnip, Galdera orokorrak edo ideiak badituzu, nahiz Ksnip-en gainean hitz egiteko, please join our mesedez sartu gure server. zerbitzaria. Bug Reports Erroreen txostenak Please use Erabili to report bugs. erroreen berri emateko. CopyAsDataUriOperation Failed to copy to clipboard Arbelera kopiatzeak huts egin du Failed to copy to clipboard as base64 encoded image. Arbelera base54 kodetutako irudi gisa kopiatzeak huts egin du. Copied to clipboard Arbelera kopiatu da Copied to clipboard as base64 encoded image. Arbelera base64 kodetutako irudi gisa kopiatu da. DeleteImageOperation Delete Image Ezabatu irudia The item '%1' will be deleted. Do you want to continue? '%1' elementua ezabatuko da. Jarraitu nahi duzu? DonateTab here hemen Also possible, Izan liteke ere, Donations are always welcome Diru-laguntzak beti dira ongi etorriak Donation Dohaintza Become a GitHub Sponsor Bihurtu GitHub-en babeslea ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. Ksnip irabazi asmorik gabeko software libreko proektua da, eta <br/>oraindik estali gabeko kostu batzuk ditu<br/>, hala nola plataforma anitzen sustengua emateko behar diren domeinuaren eta hardwarearen kostuak. If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that Lagundu nahi bagaituzu edo <br/>egindako lana saritu nahi baduzu<br/> garatzaileak garagardo bat edo kafe batera gonbidatuz, egin dezakezu EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. Gehitu ekintza berriak 'Gehitu' fitxaren botoia sakatuta. EnumTranslator Rectangular Area Area laukizuzena Last Rectangular Area Azken area laukizuzena Full Screen (All Monitors) Pantaila osoa (monitore guztiak) Current Screen Uneko pantaila Active Window Leiho aktiboa Window Under Cursor Kurtsorearen azpiko leihoa Screenshot Portal Pantaila argazkien ataria HandleUploadResultOperation Upload Successful Karga ongi burutu da Upload script Kargarako scripta finished successfully. behar bezala burutu da. Uploaded to Kargatuta hona Unable to save temporary image for upload. Ezin izan da irudia behin behinean gorde kargatzeko. Unable to start process, check path and permissions. Ezin izan da prozesua abiarazi, begiratu bidea eta baimenak. Process crashed Prozesuak huts egin du Process timed out. Prozesuaren epemuga agortu da. Process read error. Prozesuaren irakurketa errorea. Process write error. Prozesuaren irakurketa errorea. Web error, check console output. Web errorea, begiratu kontsolaren irteera. Unknown process error. Prozesuaren errore ezezaguna. Upload Failed Kargak huts egin du Script wrote to StdErr. StdErr-ra bidalitako scripta. HotKeySettings Enable Global HotKeys Aktibatuta laster-tekla globalak Capture Rect Area Egin laukizuzenaren arearen argazkia Capture Last Rect Area Egin azken laukizuzenaren arearen argazkia Capture Full Screen Egin pantaila osoaren argazkia Capture current Screen Egin uneko pantailaren argazkia Capture active Window Egin leiho aktiboaren argazkia Capture Window under Cursor Egin kurtsore azpiko leihoaren argazkia Global HotKeys Laster-teklak Clear Garbitu Capture using Portal Egin argazkia atariaren bidez HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. Laster-teklak une honetan bakarrik onartzen dira Windows eta X11n. Aukera hau desgaituz gero, ekintza lasterbideak ksnip-en soilik izango dira. ImageGrabberSettings Capture mouse cursor on screenshot Kurtsorea sartu pantailaren argazkian Should mouse cursor be visible on screenshots. Kurtsorea pantailen argazkietan ikusiko da. Image Grabber Irudien kapturatzailea Force Generic Wayland Screenshot Behartu Wayland-en pantaila generikoa Scale Generic Wayland Screenshots Eskalatu Wayland-en pantaila-argazki generikoak Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. XDG-DESKTOP-PORTAL erabiltzen duten Wayland inplementazio generikoak pantailaren eskalatzea desberdin egiten du. Aukera hau gaituz gero zehaztu uneko pantailaren eskala eta aplikatu hori ksnip-eko pantailan. GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. GNOMEk eta KDE Plasma-k onartzen ditu beren Wayland eta XDG-DESKTOP-PORTAL generikoaren pantaila-argazkiak. Aukera hau gaitzeak behartzen ditu KDE Plasma eta GNOME pantaila-argazkiak XDG-DESKTOP-PORTALaren bidez egiten. Aukera hau aldatzeak ksnip berrabiaraztea eskatzen du. Show Main Window after capturing screenshot Erakutsi leiho nagusia pantaila-argazkia egin ondoren Hide Main Window during screenshot Ezkutatu leiho nagusia pantaila-argazkiak egitean Hide Main Window when capturing a new screenshot. Ezkutatu leiho nagusia pantaila-argazki berria egitean. Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. Erakutsi leiho nagusia pantaila argazki berri bat egin ondoren leiho nagusia ezkutuan edo minimizatuta dagoenean. ImgurHistoryDialog Imgur History Imgur historia Close Itxi Time Stamp Denbora-zigilua Link Esteka Delete Link Ezabatu esteka ImgurUploader Upload to imgur.com finished! imgur.com gunera kargatu da! Received new token, trying upload again… Token berri bat jaso da, berriro kargatzen saiatzen… Imgur token has expired, requesting new token… Imgur-en tokena iraungi da, token berria eskatzen… ImgurUploaderSettings Force anonymous upload Behartu karga anonimoa After uploading open Imgur link in default browser Kargatu ondoren ireki Imgur-en esteka lehenetsitako nabigatzailean Link directly to image Estekatu irudia zuzenean Always copy Imgur link to clipboard Kopiatu beti Imgur-en esteka arbelera Client ID Bezeroaren ID Client Secret Bezeroaren sekretua PIN PINa Enter imgur Pin which will be exchanged for a token. Sartu imgur-en Pina haren truke tokena eskuratzeko. Get PIN Eskuratu PINa Get Token Eskuratu tokena Imgur History Imgur historia Imgur Uploader Imgur-en kargatzailea Username Erabiltzaile-izena Waiting for imgur.com… imgur.com-en zain… Imgur.com token successfully updated. Imgur.com-en tokena behar bezala eguneratu da. Imgur.com token update error. Imgur.com-en tokenaren eguneraketak huts egin du. Base Url: Url oinarria: Base url that will be used for communication with Imgur. Changing requires restart. Imgur-ekin komunikatzeko erabiliko den url oinarria. Aldatzeak berrabiaraztea eskatzen du. Clear Token Garbitu Tokena LoadImageFromFileOperation Unable to open image Ezin izan da irudia ireki Unable to open image from path %1 Ezin izan da irudia path %1-tik ireki MainToolBar New Berria Delay in seconds between triggering and capturing screenshot. Atzerapena segundotan aktibazioa eta pantaila-argazkiaren artean. s s Save Gorde Save Screen Capture to file system Gorde pantaila-argazkia fitxategi-sisteman Copy Kopiatu Copy Screen Capture to clipboard Kopiatu pantaila-argazkia arbelera Undo Desegin Redo Berregin Crop Moztu Crop Screen Capture Moztu pantaila-argazkia Tools Tresnak MainWindow Unable to show image Ezin da irudia erakutsi Unsaved Gorde gabe Upload Kargatu Print Inprimatu Opens printer dialog and provide option to print image Irekitzen du inprimagailuaren elkarrizketa-koadroa eta irudia inprimatzeko aukera ematen du Print Preview Inprimatzeko aurrebista Opens Print Preview dialog where the image orientation can be changed Irekitzen du inprimatzeko aurrebistaren elkarrizketa-koadroa non irudiaren orientazioa alda daitekeen Scale Eskalatu Add Watermark Gehitu ur-marka Add Watermark to captured image. Multiple watermarks can be added. Gehitu ur-marka egindako argazkiari. Hainbat ur-marka gehitu daitezke. Quit Irten Settings Ezarpenak &About Honi buruz Open Ireki &File &Fitxategia &Edit &Editatu &Options Aukerak &Help &Laguntza Image Files (*.png *.jpg *.bmp) Irudi-fitxategiak (*.png *.jpg *.bmp) Save As... Gorde honela... Paste Itsatsi Paste Embedded Itsatsi kapsulatua Pin Ainguratu Pin screenshot to foreground in frameless window Finkatu pantaila-argazkia markorik gabeko lehen plano batean No image provided but one was expected. Espero bazen arren, ez da irudirik jaso. Copy Path Kopiatu bidea Open Directory Ireki direktorioa &View &Ikusi Delete Ezabatu Rename Aldatu izena Open Images Ireki irudiak Show Docks Erakutsi kaiak Hide Docks Ezkutatu kaiak Copy as data URI URl data gisa kopiatu da Open &Recent Ireki duela gutxikoa Modify Canvas Aldatu oihala Upload triggerCapture to external source Kargatu egindako argazkia kanpoko iturri batera Copy triggerCapture to system clipboard Kopiatu egindako argazkia sistemaren arbelera Scale Image Eskalako irudia Rotate Biratu Rotate Image Biratu irudia MultiCaptureHandler Save Gorde Save As Gorde honela Open Directory Ireki direktorioa Copy Kopiatu Copy Path Kopiatu bidea Delete Ezabatu Rename Aldatu izena NewCaptureNameProvider Capture Argazkia PinWindow Close Itxi Close Other Itxi besteak Close All Itxi denak PinWindowHandler Pin Window %1 Ainguratu %1 leihoa RenameOperation Image Renamed Irudia berrizendatua Successfully renamed image to Irudia behar bezala berrizendatu da horrela Image Rename Failed Irudiaren berrizendatzeak huts egin du Failed to rename image to Huts egin du horrela berrizendatzen Rename image Berrizendatu irudia New filename: Fitxategi-izen berria: SaveOperation Save As Gorde honela Images Irudiak All Files Fitxategi guztiak Image Saved Irudia gorde da Saved to Hemen gordea Saving Image Failed Irudiaren gordetzeak huts egin du Failed to save image to Huts egin du irudia hona gordetzean SaverSettings Automatically save new captures to default location Gorde automatikoki kaptura berriak lehenetsitako kokagunera Prompt to save before discarding unsaved changes Eskatu gordetzea gorde gabeko aldaketak baztertu aurretik Remember last Save Directory Gogoratu gordetzeko erabilitako azken direktorioa When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. Aktibatuta dagoenean ezarpenetan gordetako direktorioa gainidatziko du gordetzeko erabilitako karpetarekin, gordetzen den aldiro. Capture save location and filename Atzitu gordetzeko kokapena eta fitxategiaren izena Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. Onartzen diren formatuak dira JPG, PNG eta BMP. Formaturik zehazten ez bada, PNG erabiliko da lehenetsi gisa. Fitxategiaren izenak honako komodinak eduki ditzake: - $Y, $M, $D datarako, $h, $m, $s ordurako, edo $T denborarako hhmmss formatuan. - Hainbat # jarraian kontagailurako. #### bihurtuko da 0001 eta hurrengo argazkian 0002. Browse Arakatu Saver Settings Gordetze-ezarpenak Capture save location Gordetzeko kokapena Default Lehenetsia Factor Faktorea Save Quality Gordetze kalitatea Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. Jarri 0 konprimitutako fitxategi txikiak sortzeko, 100 konpresiorik gabeko fitxategiak sortzeko. Irudi formatu guztiek ez dute gama osoa onartzen, JPEG-ek bai. ScriptUploaderSettings Copy script output to clipboard Kopiatu irteerako scripta arbelera Script: Scripta: Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. Kargan eskatuko den scriptaren bidea. Kargan scripta erabiliko da behin behineko png fitxategi baten bidea argumentu sinplea duela. Browse Arakatu Script Uploader Kargarako scripta Select Upload Script Hautatu kargarako scripta Stop when upload script writes to StdErr Gelditu kargako scripta StdErr-ra gehitzean Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. Scriptak StdErr-ra gehitzeak huts egin duela markatzen du. Ezarpen hau gabe scripteko akatsak oharkabean geratuko dira. Filter: Iragazkia: RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. RegEx adierazpena. Kopiatu arbelera bakarrik RegEx adierazpenarekin bat datorrenarekin. Ez badago, dena kopiatzen da. SettingsDialog Settings Ezarpenak OK Ados Cancel Utzi Application Aplikazioa Image Grabber Irudi kapturatzailea Imgur Uploader Imgur-en kargatzailea Annotator Ohargilea HotKeys Laster-teklak Uploader Kargagailua Script Uploader Kargako scripta Saver Gordetzea Stickers Eranskailuak Snipping Area Argazki-area Tray Icon Erretiluko ikonoa Watermark Ur-marka Actions Ekintzak SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Hautatutako zuzenaren tamaina aldatu heldulekuak erabiliz edo mugitu hautapena arrastatuz. Use arrow keys to move the selection. Erabili gezi-teklak hautaketa mugitzeko. Use arrow keys while pressing CTRL to move top left handle. Erabili gezi-teklak CTRL sakatzen duzun bitartean goiko ezkerreko heldulekua mugitzeko. Use arrow keys while pressing ALT to move bottom right handle. Erabili gezi-teklak ALT sakatzen duzun bitartean beheko eskuineko heldulekua mugitzeko. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. Berretsi hautamena SARTU sakatuta edo utzi ESC sakatuta. This message can be disabled via settings. Mezu hau ezarpenen bidez desgaitu daiteke. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Egin klik eta arrastatu area laukizuzena hautatzeko edo ESC ateratzeko. Hold CTRL pressed to resize selection after selecting. Mantendu CTRL sakatuta hautaketaren tamaina aldatzeko. Hold CTRL pressed to prevent resizing after selecting. Mantendu CTRL sakatuta hautatu ondoren tamaina aldatzea ekiditeko. Operation will be canceled after 60 sec when no selection made. Eragiketa bertan behera geratuko da 60 segundoren buruan hautaketa egin ez denean. This message can be disabled via settings. Mezu hau ezarpenen bidez desgaitu daiteke. SnippingAreaSettings Freeze Image while snipping Izoztu irudia markatu bitartean When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. Aktibatuta dagoenean atzeko planoa izoztuko da area laukizuzena hautatu bitartean. Atzeratutako pantailen portaera ere aldatzen du, aukera hau aktibatuta atzerapena argazki-area erakutsi aurretik gertatzen da eta aukera desgaituta dagonean atzerapena argazki-area erakutsi ondoren gertatzen da. Ezaugarri hau beti desgaituta dago Wayland-entzat eta beti aktibatuta MacOs-entzat. Show magnifying glass on snipping area Erakutsi lupa argazki-arean Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. Erakutsi atzeko planoko irudia handitzen duen lupa. Aukera honek bakarrik funtzionatzen du "Izoztu irudia markatu bitartean" aktibatuta badago. Show Snipping Area rulers Erakutsi argazki-arearen erregelak Horizontal and vertical lines going from desktop edges to cursor on snipping area. Lerro horizontal eta bertikalak zabaltzen dira mahaigainaren izkinetatik kurtsorera argazki-zonan. Show Snipping Area position and size info Erakutsi argaki-arearen kokapena eta tamainaren informazioa When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. Saguaren ezkerreko botoia sakatu gabe kokapena ikusten da, sakatuta dagoenean, hautatutako arearen tamaina ikusten da haren goiko ezker aldean. Allow resizing rect area selection by default Onartu berez hautatutako area laukizuzenaren tamaina aldatzea When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. Gaituta badago onartzen da hautatutako arearen tamaina aldatzea. Tamaina aldatu ondoren hautaketa berretsi behar da Sartu sakatuta. Show Snipping Area info text Erakutsi argazki-arearen informazioa Snipping Area cursor color Argazki-arearen kurtsorearen kolorea Sets the color of the snipping area cursor. Argazki-arearen kurtsorearen kolorea ezartzen du. Snipping Area cursor thickness Argazki-arearen kurtsorearen zabalera Sets the thickness of the snipping area cursor. Argazki-arearen kurtsorearen lodiera ezartzen du. Snipping Area Argazki-area Snipping Area adorner color Argazki-arearen dekorazioaren kolorea Sets the color of all adorner elements on the snipping area. Argazki-arearen dekorazio elementuen kolorea ezartzen du. Snipping Area Transparency Argazki-arearen gardentasuna Alpha for not selected region on snipping area. Smaller number is more transparent. Argazki-areako hautatu gabeko zonaren Alpha. Zenbaki txikiagoak gardenagoa adierazten du. StickerSettings Up Gora Down Behera Use Default Stickers Erabili berezko eranskailuak Sticker Settings Eranskailuen ezarpenak Vector Image Files (*.svg) Irudi bektorialen fitxategiak (*.svg) Add Gehitu Remove Kendu Add Stickers Gehitu eranskailuak TrayIcon Show Editor Erakutsi editorea TrayIconSettings Use Tray Icon Erabili erretiluko ikonoa When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. Aktibatuta dagoenean, sistemaren erretiluan ikonoa gehituko du, sistemaren leiho kudeatzaileak onartzen badu. Aldaketak berrabiaraztea eskatzen du. Minimize to Tray Minimizatu erretilura Start Minimized to Tray Abiatu erretiluan minimizatua Close to Tray Itxi erretilura Show Editor Erakutsi editorea Capture Argazkia Default Tray Icon action Erretiluko ikonoaren eragiketa lehenetsia Default Action that is triggered by left clicking the tray icon. Erretiluaren ikonoan ezkerreko klik egitean aktibatzen den eragiketa lehenetsia. Tray Icon Settings Erretiluko ikonoaren ezarpenak Display Tray icon notifications Erakutsi erretiluko ikonoaren jakinarazpenak Use platform specific notification service Erabili plataformaren berariazko jakinarazpen zerbitzua When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. Aktibatuta dagoenean saiatuko da plataformaren berariazko jakinarazpen zerbitzua erabiltzen baldin badago. Aldaketak berrabiaraztea eskatzen du eragina izateko. UpdateWatermarkOperation Select Image Aukeratu irudia Images Irudiak All Files Fitxategi guztiak UploadOperation Upload Script Required Kargarako scripta behar da Please add an upload script via Options > Settings > Upload Script Gehitu kargarako script bat Aukerak » Ezarpenak » Kargarako scripta Capture Upload Argazkiaren karga You are about to upload the image to an external destination, do you want to proceed? Argazkia kanpoko kokapen batera igotzear zaude, ekin nahi diozu? UploaderSettings Ask for confirmation before uploading Eskatu berrespena kargatu aurretik Uploader Type: Karga mota: Imgur Imgur Script Scripta Uploader Kargagailua VersionTab Version Bertsioa Build Sorrera Using: Erabiltzen: WatermarkSettings Watermark Image Ur-markaren irudia Update Eguneratu Rotate Watermark Biratu ur-marka When enabled, Watermark will be added with a rotation of 45° Aktibatuta dagoenean, ur-marka 45ªko biraketarekin gehituko da Watermark Settings Ur-markaren ezarpenak ksnip-1.9.2/translations/ksnip_fa.ts000066400000000000000000001475371414701001100175400ustar00rootroot00000000000000 AboutDialog About درباره About درباره Version نسخه Author مولف Close بستن Donate حمایت Contact AboutTab License: مجوز: Screenshot and Annotation Tool ActionSettingTab Name Shortcut Clear Take Capture Include Cursor Delay s Capture Mode Show image in Pin Window Copy image to Clipboard Upload image Open image parent directory Save image Hide Main Window ActionsSettings Add Actions Settings Action AddWatermarkOperation Watermark Image Required تصویر واترمارک نیاز است Please add a Watermark Image via Options > Settings > Annotator > Update AnnotationSettings Smooth Painter Paths When enabled smooths out pen and marker paths after finished drawing. Smooth Factor Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. Annotator Settings Remember annotation tool selection and load on startup Switch to Select Tool after drawing Item Number Tool Seed change updates all Number Items Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. Canvas Color Default Canvas background color for annotation area. Changing color affects only new annotation areas. Select Item after drawing With this option enabled the item gets selected after being created, allowing changing settings. ApplicationSettings Capture screenshot at startup with default mode Application Style Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. Application Settings Automatically copy new captures to clipboard Use Tabs Change requires restart. Run ksnip as single instance Hide Tabbar when only one Tab is used. Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. Remember Main Window position on move and load on startup Auto hide Tabs Auto hide Docks On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. Auto resize to content Automatically resize Main Window to fit content image. AuthorTab Contributors: Spanish Translation Dutch Translation Russian Translation Norwegian Bokmål Translation French Translation Polish Translation Snap & Flatpak Support The Authors: CanDiscardOperation Warning - The capture %1%2%3 has been modified. Do you want to save it? CaptureModePicker New Draw a rectangular area with your mouse Capture full screen including all monitors Capture screen where the mouse is located Capture window that currently has focus Capture that is currently under the mouse cursor Capture a screenshot of the last selected rectangular area Uses the screenshot Portal for taking screenshot ContactTab Community If you have general questions, ideas or just want to talk about ksnip, please join our server. Bug Reports Please use خواهشمندیم استفاده کنید to report bugs. گزارش اشکالات. CopyAsDataUriOperation Failed to copy to clipboard Failed to copy to clipboard as base64 encoded image. Copied to clipboard Copied to clipboard as base64 encoded image. DeleteImageOperation Delete Image The item '%1' will be deleted. Do you want to continue? DonateTab here Also possible, Donations are always welcome Donation Become a GitHub Sponsor ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. EnumTranslator Rectangular Area Last Rectangular Area Full Screen (All Monitors) Current Screen Active Window Window Under Cursor Screenshot Portal HandleUploadResultOperation Upload Successful Upload script finished successfully. Uploaded to Unable to save temporary image for upload. Unable to start process, check path and permissions. Process crashed Process timed out. Process read error. Process write error. Web error, check console output. Unknown process error. Upload Failed Script wrote to StdErr. HotKeySettings Enable Global HotKeys Capture Rect Area Capture Full Screen Capture current Screen Capture active Window Capture Window under Cursor Global HotKeys Capture Last Rect Area Clear Capture using Portal HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. ImageGrabberSettings Capture mouse cursor on screenshot Should mouse cursor be visible on screenshots. Image Grabber Force Generic Wayland Screenshot Scale Generic Wayland Screenshots Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. Show Main Window after capturing screenshot Hide Main Window during screenshot Hide Main Window when capturing a new screenshot. Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. ImgurHistoryDialog Imgur History Close بستن Time Stamp Link Delete Link ImgurUploader Upload to imgur.com finished! Received new token, trying upload again… Imgur token has expired, requesting new token… ImgurUploaderSettings Force anonymous upload Always copy Imgur link to clipboard Client ID Client Secret PIN Enter imgur Pin which will be exchanged for a token. Get PIN Get Token Imgur History Imgur Uploader Username Waiting for imgur.com… Imgur.com token successfully updated. Imgur.com token update error. After uploading open Imgur link in default browser Link directly to image Base Url: Base url that will be used for communication with Imgur. Changing requires restart. Clear Token LoadImageFromFileOperation Unable to open image Unable to open image from path %1 MainToolBar New Delay in seconds between triggering and capturing screenshot. s Save Save Screen Capture to file system Copy Copy Screen Capture to clipboard Tools Undo Redo Crop Crop Screen Capture MainWindow Unsaved Upload Print Opens printer dialog and provide option to print image Print Preview Opens Print Preview dialog where the image orientation can be changed Scale Quit Settings &About Open &Edit &Options &Help Image Files (*.png *.jpg *.bmp) Add Watermark Add Watermark to captured image. Multiple watermarks can be added. &File Unable to show image Save As... Paste Paste Embedded Pin Pin screenshot to foreground in frameless window No image provided but one was expected. Copy Path Open Directory &View Delete Rename Open Images Show Docks Hide Docks Copy as data URI Open &Recent Modify Canvas Upload triggerCapture to external source Copy triggerCapture to system clipboard Scale Image Rotate Rotate Image MultiCaptureHandler Save Save As Open Directory Copy Copy Path Delete Rename NewCaptureNameProvider Capture PinWindow Close بستن Close Other Close All PinWindowHandler Pin Window %1 RenameOperation Image Renamed Successfully renamed image to Image Rename Failed Failed to rename image to Rename image New filename: SaveOperation Save As Images All Files Image Saved Saving Image Failed Saved to Failed to save image to SaverSettings Automatically save new captures to default location Prompt to save before discarding unsaved changes Remember last Save Directory When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. Capture save location and filename Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. Browse Saver Settings Capture save location Default Factor Save Quality Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. ScriptUploaderSettings Copy script output to clipboard Script: Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. Browse Script Uploader Select Upload Script Stop when upload script writes to StdErr Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. Filter: RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. SettingsDialog Settings OK Cancel Image Grabber Imgur Uploader Application Annotator HotKeys Uploader Script Uploader Saver Stickers Snipping Area Tray Icon Watermark Actions SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Use arrow keys to move the selection. Use arrow keys while pressing CTRL to move top left handle. Use arrow keys while pressing ALT to move bottom right handle. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. This message can be disabled via settings. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Hold CTRL pressed to resize selection after selecting. Hold CTRL pressed to prevent resizing after selecting. Operation will be canceled after 60 sec when no selection made. This message can be disabled via settings. SnippingAreaSettings Freeze Image while snipping When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. Show magnifying glass on snipping area Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. Show Snipping Area rulers Horizontal and vertical lines going from desktop edges to cursor on snipping area. Show Snipping Area position and size info When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. Allow resizing rect area selection by default When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. Show Snipping Area info text Snipping Area cursor color Sets the color of the snipping area cursor. Snipping Area cursor thickness Sets the thickness of the snipping area cursor. Snipping Area Snipping Area adorner color Sets the color of all adorner elements on the snipping area. Snipping Area Transparency Alpha for not selected region on snipping area. Smaller number is more transparent. StickerSettings Up Down Use Default Stickers Sticker Settings Vector Image Files (*.svg) Add Remove Add Stickers TrayIcon Show Editor TrayIconSettings Use Tray Icon When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. Minimize to Tray Start Minimized to Tray Close to Tray Show Editor Capture Default Tray Icon action Default Action that is triggered by left clicking the tray icon. Tray Icon Settings Display Tray icon notifications Use platform specific notification service When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. UpdateWatermarkOperation Select Image Images All Files UploadOperation Upload Script Required Please add an upload script via Options > Settings > Upload Script Capture Upload You are about to upload the image to an external destination, do you want to proceed? UploaderSettings Ask for confirmation before uploading Uploader Type: Imgur Script Uploader VersionTab Version نسخه Build Using: WatermarkSettings Watermark Image Update Rotate Watermark When enabled, Watermark will be added with a rotation of 45° Watermark Settings ksnip-1.9.2/translations/ksnip_fi.ts000066400000000000000000001640131414701001100175340ustar00rootroot00000000000000 AboutDialog About Tietoa About Tietoa Version Versio Author Tekijä Close Sulje Donate Lahjoita Contact Ota yhteyttä AboutTab License: Lisenssi: Screenshot and Annotation Tool Ruudunkaappaus ja merkintätyökalu ActionSettingTab Name Nimi Shortcut Pikanäppäin Clear Tyhjennä Take Capture Ota kaappaus Include Cursor Tallenna kursori Delay Viive s s Capture Mode Kaappaustila Show image in Pin Window Näytä kuva ikkunassa Copy image to Clipboard Kopioi kuva leikepöydälle Upload image Lataa kuva Open image parent directory Avaa kuvan hakemisto Save image Tallenna kuva Hide Main Window Piilota pääikkuna ActionsSettings Add Lisää Actions Settings Toimintojen asetukset Action Toiminta AddWatermarkOperation Watermark Image Required Vesileiman kuva vaaditaan Please add a Watermark Image via Options > Settings > Annotator > Update Lisää vesileiman kuva valitsemalla Vaih­to­eh­dot > Asetukset> Korostus > Päivitä AnnotationSettings Smooth Painter Paths Tasainen maalaus When enabled smooths out pen and marker paths after finished drawing. Kun käytössä, tasoittaa kynän ja korostuksen piirtämisen jälkeen. Smooth Factor Tasaisuus Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. Tasoituskertoimen kasvattaminen pienentää tarkkuutta kynän ja merkinnän osalta, mutta tekee tasaisempaa jälkeä. Annotator Settings Korostuksen asetukset Remember annotation tool selection and load on startup Muista korostustyökalun valinta ja lataa se käynnistyksen yhteydessä Switch to Select Tool after drawing Item Vaihda Valinta-työkaluun piirtämisen jälkeen Number Tool Seed change updates all Number Items Numerotyökalu päivittää kaikki numeroidut kohteet Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. Poistaminen käytöstä muuttaa numerointi-työkalua ja vaikuttaa vain uusiin kohteisiin, mutta sallii päällekkäisten numeroiden käytön. Canvas Color Piirtoalustan väri Default Canvas background color for annotation area. Changing color affects only new annotation areas. Korostusalueen oletusväri. Värin vaihtaminen vaikuttaa vain uusiin korostuksiin. Select Item after drawing Valitse väline piirtämisen jälkeen With this option enabled the item gets selected after being created, allowing changing settings. Kun käytössä, kohde valitaan luomisen jälkeen, jolloin asetuksia voidaan muuttaa. ApplicationSettings Capture screenshot at startup with default mode Ota ruudunkaappaus käynnistyksen yhteydessä oletustilassa Application Style Sovelluksen tyyli Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. Asettaa sovellusen tyylin ja graafisen käyttöliittymän ulkoasun. Muutos vaatii ksnipin uudelleen käynnistyksen tullakseen voimaan. Application Settings Sovelluksen asetukset Automatically copy new captures to clipboard Kopioi uudet kaappaukset automaattisesti leikepöydälle Use Tabs Käytä välilehtiä Change requires restart. Muutos vaatii käynnistyksen. Run ksnip as single instance Suorita ksnip yhtenä esiintymänä Hide Tabbar when only one Tab is used. Piilota välilehtipalkki, kun vain yhtä välilehteä käytetään. Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. Jos asetus käytössä, vain yksi ksnip voidaan suorittaa, kaikki muut tapaukset, jotka on aloitettu sen jälkeen läpäisevät argumentit ensimmäiselle ja sulkeutuu. Asetuksen muutos edellyttää käynnistyksen kaikille esiintymille. Remember Main Window position on move and load on startup Muista pääikkunan sijainti liikkuessa ja käynnistyksen yhteydessä Auto hide Tabs Piilota välilehdet automaattisesti Auto hide Docks Piilota paneelit automaattisesti On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. Käynnistyksessä piilota työkalupalkki ja korostuksen asetukset. Valikon näkyvyyttä voidaan vaihtaa sarkaimella. Auto resize to content Muuta kokoa automaattisesti Automatically resize Main Window to fit content image. Muuttaa pääikkunan kokoa automaattisesti kuvaan sopivaksi. AuthorTab Contributors: Kehittäjät: Spanish Translation Espanjan käännökset Dutch Translation Hollannin käännökset Russian Translation Venäjän käännökset Norwegian Bokmål Translation Norjan käännökset French Translation Ranskan käännökset Polish Translation Puolan käännökset Snap & Flatpak Support Tuettu Snap & Flatpak The Authors: Tekijät: CanDiscardOperation Warning - Varoitus - The capture %1%2%3 has been modified. Do you want to save it? Kaappausta %1%2%3 on muokattu. Haluatko tallentaa sen? CaptureModePicker New Uusi Draw a rectangular area with your mouse Piirrä hiirellä suorakaiteen muotoinen alue Capture full screen including all monitors Kaappaa koko näyttö, mukaan lukien kaikki näytöt Capture screen where the mouse is located Kaappaa näyttö, jossa hiiri sijaitsee Capture window that currently has focus Kaappaa ikkuna, joka on tällä hetkellä aktiivinen Capture that is currently under the mouse cursor Kaappaa se, joka on hiiren kursorin alla Capture a screenshot of the last selected rectangular area Ota ruudunkaappaus viimeksi valitusta suorakulmaisesta alueesta Uses the screenshot Portal for taking screenshot Käytä kuvalle portaalia otettuasi ruudunkaappauksen ContactTab Community Yhteisö If you have general questions, ideas or just want to talk about ksnip, Jos sinulla on kysymyksiä, ideoita tai haluat vain keskustella ksnipistä, please join our liity meidän server. palvelin. Bug Reports Virheraportit Please use Ole hyvä ja käytä to report bugs. raportoi virheistä. CopyAsDataUriOperation Failed to copy to clipboard Kopioiminen leikepöydälle epäonnistui Failed to copy to clipboard as base64 encoded image. Leikepöydälle kopioiminen epäonnistui base64-koodattulla kuvalla. Copied to clipboard Kopioitu leikepöydälle Copied to clipboard as base64 encoded image. Kopioitu leikepöydälle base64-koodattuna kuvana. DeleteImageOperation Delete Image Poista kuva The item '%1' will be deleted. Do you want to continue? Kohde "%1" poistetaan. Haluatko jatkaa? DonateTab here täällä Also possible, Mahdollista myös, Donations are always welcome Lahjoitukset ovat aina tervetulleita Donation Lahjoitus Become a GitHub Sponsor Ryhdy GitHub-sponsoriksi ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. ksnip on voittoa tavoittelematon ohjelmaisto projekti. <br/>Silti joitakin kustannuksia on katettava,<br/> kuten verkkotunnus ja laitteistokulu alustojen välisen tuen testaamisesi. If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that Jos haluat auttaa tai<br/>vain arvostaa tehtyä työtä,<br/>voit tehdä sen tarjoamalla kehittäjille oluen tai kahvin EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. Lisää uusia toimintoja painamalla "Lisää" välilehden painiketta. EnumTranslator Rectangular Area Suorakulmainen alue Last Rectangular Area Viimeisin suorakulmainen alue Full Screen (All Monitors) Koko näyttö (kaikki näytöt) Current Screen Nykyinen näyttö Active Window Aktiivinen ikkuna Window Under Cursor Ikkuna kohdistimen alla Screenshot Portal Ruudunkaappaus portaali HandleUploadResultOperation Upload Successful Lataaminen onnistui Upload script Lataamisen skripti finished successfully. valmistunut onnistuneesti. Uploaded to Ladattu kohteeseen Unable to save temporary image for upload. Väliaikaista kuvaa ei voi tallentaa lähetettäväksi. Unable to start process, check path and permissions. Prosessia ei voi aloittaa, tarkista polku ja käyttöoikeudet. Process crashed Prosessi kaatui Process timed out. Prosessi aikakatkaistiin. Process read error. Prosessin lukuvirhe. Process write error. Prosessin kirjoitusvirhe. Web error, check console output. Verkkovirhe, tarkista konsolin tulos. Unknown process error. Tuntematon prosessivirhe. Upload Failed Lataaminen epäonnistui Script wrote to StdErr. Skriptin kirjoitti StdErr. HotKeySettings Enable Global HotKeys Ota pikanäppäimet käyttöön Capture Rect Area Kaappaa valitsemasi alue Capture Full Screen Kaappaa koko näyttö Capture current Screen Kaappaa nykyinen näyttö Capture active Window Kaappaa aktiivinen ikkuna Capture Window under Cursor Kaappaa ikkuna kohdistimen alla Global HotKeys Pikanäppäimet Capture Last Rect Area Kaappaa valitsemasi alue uudelleen Clear Tyhjennä Capture using Portal Kaappaa portaaliin HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. Pikanäppäimiä tuetaan vain X11 ikkunassa tällä hetkellä. Poistamalla toiminnon käytöstä, pikanäppäimet ovat vain ksnipille. ImageGrabberSettings Capture mouse cursor on screenshot Kaappaa hiiren osoitin kuvaan Should mouse cursor be visible on screenshots. Pitäisikö hiiren osotin näkyä kaappauksissa. Image Grabber Kuvan kaappaaja Force Generic Wayland Screenshot Pakota Wayland ruudunkaappaus Scale Generic Wayland Screenshots Skaalaa Wayland ruudunkaappaukset Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. Yleiset Wayland-toteutukset, jotka käyttävät tapaa XDG-DESKTOP-PORTAL käsittelevät skaalautumista eri tavalla. Käyttöönotto määrittää näytön nykyisen skaalauksen ja soveltaa sitä ksnipin kaappaukseen. GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. GNOME ja KDE Plasma tukevat heidän omaa Waylandia. ja yleiset XDG-DESKTOP-PORTAL ruudunkaappausta. Tämän ottaminen käyttöön, pakottaa KDE Plasman ja GNOME:n käyttämään XDG-DESKTOP-PORTAL ruurun- kaappausta. Vaatii ksnipin käynnistyksen uudelleen. Show Main Window after capturing screenshot Näytä pääikkuna kaappauksen jälkeen Hide Main Window during screenshot Piilota pääikkuna kaappauksen aikana Hide Main Window when capturing a new screenshot. Piilota pääikkuna, kun otat uuden kaappauksen. Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. Näytä pääikkuna kaappauksen ottamisen jälkeen kun pääikkuna oli piilotettu tai minimoitu. ImgurHistoryDialog Imgur History Imgur-historia Close Sulje Time Stamp Aikaleima Link Linkki Delete Link Poista linkki ImgurUploader Upload to imgur.com finished! Lähetys osoitteeseen imgur.com valmis! Received new token, trying upload again… Uusi tunnus vastaanotettu, yritetään ladata uudelleen… Imgur token has expired, requesting new token… Imgur-tunnus on vanhentunut, pyydetään uutta tunnusta… ImgurUploaderSettings Force anonymous upload Pakota anonyymi lataus Always copy Imgur link to clipboard Kopioi aina Imgur-linkki leikepöydälle Client ID Asiakkaan tunnus Client Secret Asiakkaan salaus PIN PIN Enter imgur Pin which will be exchanged for a token. Anna imgur pin, joka vaihdetaan tunnukseksi. Get PIN Hanki PIN-koodi Get Token Hanki tunnus Imgur History Imgur-historia Imgur Uploader Imgur lataaja Username Käyttäjätunnus Waiting for imgur.com… Odotetaan sivustoa imgur.com… Imgur.com token successfully updated. Imgur.com-tunnuksen päivitys onnistui. Imgur.com token update error. Imgur.com-tunnuksen päivitysvirhe. After uploading open Imgur link in default browser Lataamisen jälkeen avaa Imgur-linkki oletus selaimessa Link directly to image Linkitä suoraan kuvaan Base Url: Verkko-osoite: Base url that will be used for communication with Imgur. Changing requires restart. Verkko-osoite, jota käytetään viestintään Imgurin kanssa. Muuttaminen vaatii ohjelman käynnistyksen uudelleen. Clear Token Tyhjennä tunnus LoadImageFromFileOperation Unable to open image Kuvaa ei voi avata Unable to open image from path %1 Kuvaa ei voi avata polusta %1 MainToolBar New Uusi Delay in seconds between triggering and capturing screenshot. Laukaisun viive sekunteina kaappauksen ottamisen välillä. s s Save Tallenna Save Screen Capture to file system Tallenna kaappaus kiintolevylle Copy Kopioi Copy Screen Capture to clipboard Kopioi kaappaus leikepöydälle Tools Työkalut Undo Kumoa Redo Toista Crop Rajaa Crop Screen Capture Rajaa ruudunkaappaus MainWindow Unsaved Tallentamaton Upload Lähetä Print Tulosta Opens printer dialog and provide option to print image Avaa tulostinikkunan ja antaa mahdollisuuden kuvan tulostamiseen Print Preview Tulostuksen esikatselu Opens Print Preview dialog where the image orientation can be changed Avaa tulostuksen esikatseluikkuna, jossa kuvan suuntaa voidaan muuttaa Scale Skaalaus Quit Sulje Settings Asetukset &About &Tietoja Open Avaa &Edit &Muokkaa &Options &Lisäasetukset &Help &Ohje Image Files (*.png *.jpg *.bmp) Kuvatiedostot (*.png *.jpg *.bmp) Add Watermark Lisää vesileima Add Watermark to captured image. Multiple watermarks can be added. Lisää vesileima kaapattuun kuvaan. Vesileimoja voi lisätä useita. &File &Tiedosto Unable to show image Kuvaa ei voi näyttää Save As... Tallenna nimellä... Paste Liitä Paste Embedded Liitä upotettuna Pin Kiinnitä Pin screenshot to foreground in frameless window Kiinnitä kaappaus etualalle kehyksettömässä ikkunassa No image provided but one was expected. Kuvaa ei toimitettu, mutta sellaista odotettiin. Copy Path Kopioi polku Open Directory Avaa kansio &View &Näytä Delete Poista Rename Nimeä uudelleen Open Images Avaa kuvat Show Docks Näytä paneeli Hide Docks Piilota paneeli Copy as data URI Kopioi datana URI Open &Recent Avaa &viimeisin Modify Canvas Muokkaa piirtoalustaa Upload triggerCapture to external source Lataa triggerCapture ulkoiseen lähteeseen Copy triggerCapture to system clipboard Kopioi triggerCapture leikepöydälle Scale Image Skaalaa kuva Rotate Pyöritä Rotate Image Pyöritä kuvaa MultiCaptureHandler Save Tallenna Save As Tallenna nimellä Open Directory Avaa kansio Copy Kopioi Copy Path Kopion polku Delete Poista Rename Nimeä uudelleen NewCaptureNameProvider Capture Kaappaa PinWindow Close Sulje Close Other Sulje muut Close All Sulje kaikki PinWindowHandler Pin Window %1 Kiinnitä ikkuna %1 RenameOperation Image Renamed Kuva nimetty Successfully renamed image to Kuvan nimeäminen uudelleen onnistui Image Rename Failed Kuvan nimeäminen epäonnistui Failed to rename image to Kuvan nimeäminen uudelleen epäonnistui Rename image Nimeä kuva uudelleen New filename: Uusi tiedostonimi: SaveOperation Save As Tallenna nimellä Images Kuvat All Files Kaikki tiedostot Image Saved Kuva tallennettu Saving Image Failed Kuvan tallentaminen epäonnistui Saved to Tallennettu kohteeseen Failed to save image to Kuvan tallennus epäonnistui kohteeseen SaverSettings Automatically save new captures to default location Tallenna uudet kaappaukset automaattisesti oletussijaintiin Prompt to save before discarding unsaved changes Pyydä tallentamista, ennen kuin hylkäät muutokset Remember last Save Directory Muista viimeisin tallennuskansio When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. Kun käytössä, se korvaa asetuksiin tallennetun kansion uusimman tallennuksen mukaan jokaisella tallennuskerralla. Capture save location and filename Kaappauksen tallennuspaikka ja tiedostonimi Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. Tuetut formaatit ovat JPG, PNG ja BMP. Jos mitään päätettä ei ole annettu, PNG on oletus. Tiedostonimi voi sisältää seuraavia merkkejä: - $Y, $M, $D päivämäärälle, $h, $m, $s ajalle tai $T ajalle hhmmss-muodossa. - Useita peräkkäisiä #-merkkejä laskurille. #### antaa tulokseksi 0001, seuraava kaappaus olisi 0002. Browse Selaa Saver Settings Säästäjän asetukset Capture save location Kaappauksen tallennussijainti Default Oletus Factor Kerroin Save Quality Tallenna laatu Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. Määritä 0, jos haluat hankkia pieniä pakattuja tiedostoja, 100 suurille pakkaamattomille tiedostoille. Kaikki kuvamuodot eivät tue täyttä aluetta, mutta JPEG tukee. ScriptUploaderSettings Copy script output to clipboard Kopioi skriptin tulos leikepöydälle Script: Skripti: Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. Polku skriptiin, jota kutsutaan latausta varten. Latauksen aikana skriptiä kutsutaan väliaikaisen png-tiedoston polun kanssa yhtenä argumenttina. Browse Selaa Script Uploader Skriptin lataaja Select Upload Script Valitse lähetävä skripti Stop when upload script writes to StdErr Lopeta, kun latausskripti kirjoittaa StdErr Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. Merkitsee lataus epäonnistuneeksi, kun skripti kirjoittaa StdErr-tiedostoon. Ilman tätä asetusta skriptin virheet jäävät huomaamatta. Filter: Suodatin: RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. RegEx-lauseke. Kopioi leikepöydälle vain, mikä vastaa RegEx-lauseketta. Kun kaikki jätetään pois, kaikki kopioidaan. SettingsDialog Settings Asetukset OK OK Cancel Peruuta Image Grabber Kuvan kaappaaja Imgur Uploader Imgur lataaja Application Sovellus Annotator Huomautus HotKeys Pikanäppäimet Uploader Lataaja Script Uploader Skriptin lataaja Saver Säästäjä Stickers Tarrat Snipping Area Leikkausalue Tray Icon Paneelin kuvake Watermark Vesileima Actions Toimet SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Muuta valitun suorakulman kokoa kahvoilla tai siirrä sitä vetämällä valintaa. Use arrow keys to move the selection. Siirrä valintaa nuolinäppäimillä. Use arrow keys while pressing CTRL to move top left handle. Siirrä vasenta yläkahvaa nuolinäppäimillä ja paina samalla CTRL-näppäintä. Use arrow keys while pressing ALT to move bottom right handle. Siirrä oikeaa alakahvaa nuolinäppäimillä ja paina samalla ALT-näppäintä. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. Vahvista valinta painamalla ENTER/RETURN tai keskeytä painamalla ESC. This message can be disabled via settings. Tämä viesti voidaan poistaa käytöstä asetuksissa. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Valitse suorakulmainen alue napsauttamalla ja vetämällä tai lopeta painamalla ESC. Hold CTRL pressed to resize selection after selecting. Pidä CTRL-näppäintä painettuna, kun haluat muuttaa valinnan kokoa jälkeenpäin. Hold CTRL pressed to prevent resizing after selecting. Pidä CTRL-näppäintä painettuna estääksesi koon muuttamisen valinnan jälkeen. Operation will be canceled after 60 sec when no selection made. Toiminto peruutetaan 60 sekunnin kuluttua, jos valintaa ei ole tehty. This message can be disabled via settings. Tämä viesti voidaan poistaa käytöstä asetuksissa. SnippingAreaSettings Freeze Image while snipping Pysäytä kuva leikkaamisen aikana When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. Kun asetus on käytössä, tausta pysähtyy ja valittaan suorakulmaista alue. Muuttaa myös viiveen käyttäytymistä, sillä viive tapahtuu ennen kuin leikkausalue näytetään. Kun asetus on pois käytöstä viive tapahtuu leikkausalueen näyttämisen jälkeen. Ominaisuus on aina pois käytöstä Waylandissa ja MacOS aina käytössä. Show magnifying glass on snipping area Näytä suurennuslasi leikkausalueella Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. Näytä suurennuslasi, joka zoomaa taustakuvaa. Tämä vaihtoehto toimii vain kun ominaisuus "Pysäytä kuva leikkauksen aikana" on käytössä. Show Snipping Area rulers Näytä leikkausalueen viivaimet Horizontal and vertical lines going from desktop edges to cursor on snipping area. Vaaka- ja pystyviivat, jotka kulkevat työpöydän reunoista kohdistimeen leikkausalueella. Show Snipping Area position and size info Näytä leikkausalueen sijainti ja koko When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. Kun hiiren vasenta painiketta ei paineta, sijainti näytetään, kun taas hiiren painiketta painetaan, valinta-alueen koko näkyy vasemmalla ja sen yläpuolelta kaapatulta alueelta. Allow resizing rect area selection by default Salli alueen valinnan muuttaminen oletuksena When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. Kun asetus on käytössä, suorakulmaisen alueen valitsemisen jälkeen, se sallii valinnan koon muuttamisen. Kun koon muuttaminen on tehty, valinta vahvistetaan askelpalautin-näppäimellä. Show Snipping Area info text Näytä leikkausalueen infoteksti Snipping Area cursor color Leikkausalueen kohdistimen väri Sets the color of the snipping area cursor. Asettaa leikkausalueen kohdistimen värin. Snipping Area cursor thickness Leikkausalueen kohdistimen paksuus Sets the thickness of the snipping area cursor. Asettaa leikkausalueen kohdistimen paksuuden. Snipping Area Leikkausalue Snipping Area adorner color Leikkausalueen merkintäväri Sets the color of all adorner elements on the snipping area. Asettaa kaikkien merkintä-elementtien värin leikkausalueella. Snipping Area Transparency Leikkausalueen läpinäkyvyys Alpha for not selected region on snipping area. Smaller number is more transparent. Alpha-arvo ei valittulla leikkausalueella. Pienempi numero on läpinäkyvämpi. StickerSettings Up Ylös Down Alas Use Default Stickers Käytä oletus tarroja Sticker Settings Tarran asetukset Vector Image Files (*.svg) Vektorikuva (* .svg) Add Lisää Remove Poista Add Stickers Lisää tarroja TrayIcon Show Editor Näytä muokkain TrayIconSettings Use Tray Icon Käytä paneelin kuvaketta When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. Kun asetus käytössä, se lisää alavalikon kuvakkeen, jos käyttöjärjestelmä sitä tukee. Muutos vaatii käynnistämisen uudelleen. Minimize to Tray Pienennä alavalikkoon Start Minimized to Tray Käynnistä pienennettynä alavalikkoon Close to Tray Sulje alavalikkoon Show Editor Näytä muokkain Capture Kaappaa Default Tray Icon action Kuvakkeen oletustoiminto alavalikossa Default Action that is triggered by left clicking the tray icon. Oletustoiminto, napsauttamalla hiiren vasen alavalikon kuvakeessa. Tray Icon Settings Alavalikon kuvakkeen asetukset Display Tray icon notifications Näytä alavalikon kuvakkeen ilmoitukset Use platform specific notification service Käytä alustakohtaista ilmoituspalvelua When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. Kun asetus on käytössä, se yrittää käyttää alustakohtaista ilmoitusta, palvelua, jos sellainen on olemassa. Vaatii käynnistyksen uudelleen. UpdateWatermarkOperation Select Image Valitse kuva Images Kuvat All Files Kaikki tiedostot UploadOperation Upload Script Required Latausskripti vaaditaan Please add an upload script via Options > Settings > Upload Script Lisää latausskripti valitsemalla Valinnat > Asetukset > Latausskripti Capture Upload Kaappauksen lataus You are about to upload the image to an external destination, do you want to proceed? Olet lataamassa kuvaa ulkoiseen kohteeseen, haluatko jatkaa? UploaderSettings Ask for confirmation before uploading Pyydä vahvistusta ennen lataamista Uploader Type: Lataajan tyyppi: Imgur Imgur palvelu Script Skripti Uploader Lataaja VersionTab Version Versio Build Käännös Using: Käyttäen: WatermarkSettings Watermark Image Vesileiman kuva Update Päivitys Rotate Watermark Pyöritä vesileimaa When enabled, Watermark will be added with a rotation of 45° Kun tämä on käytössä, vesileima lisätään kiertämällä 45° Watermark Settings Vesileiman asetukset ksnip-1.9.2/translations/ksnip_fr.ts000066400000000000000000001720151414701001100175460ustar00rootroot00000000000000 AboutDialog About À propos de About À propos Version Version Author Auteur Close Fermer Donate Faire un don Contact Contact AboutTab License: Licence : Screenshot and Annotation Tool Outil de capture d'écran et d'annotation ActionSettingTab Name Nom Shortcut Raccourci Clear Effacer Take Capture Capture d’écran Include Cursor Inclure le curseur Delay Retarder s s Capture Mode Mode de capture Show image in Pin Window Afficher l’image dans la fenêtre d’épinglage Copy image to Clipboard Copier l’image dans le presse-papier Upload image Téléverser l’image Open image parent directory Ouvrir le répertoire parent de l’image Save image Enregistrer l’image Hide Main Window Masquer la fenêtre principale ActionsSettings Add Ajouter Actions Settings Paramètres des actions Action Action AddWatermarkOperation Watermark Image Required Image en filigrane requise Please add a Watermark Image via Options > Settings > Annotator > Update Veuillez ajouter une image en filigrane via Options > Paramètres > Annotateur > Mettre à jour AnnotationSettings Smooth Painter Paths Lisser les tracés peints When enabled smooths out pen and marker paths after finished drawing. Lorsque cette option est activée, le stylo lisse les trajectoires des marqueurs après la fin du dessin. Smooth Factor Facteur de lissage Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. Augmenter le facteur de lissage diminuera la précision du stylo et du marqueur mais les rendra plus lisses. Annotator Settings Paramètres d’annotation Remember annotation tool selection and load on startup Se souvenir de la sélection de l’outil d’annotation et le charger au démarrage Switch to Select Tool after drawing Item Passer à l’outil de sélection après avoir dessiné l’élément Number Tool Seed change updates all Number Items Un changement du numéro de début met à jour tous les items numérotés Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. Lorsqu'on désactive cette option, les changements du numéro de début n'affectent que les nouveaux items et pas les items existants. La désactivation de cette option permet des numéros dupliqués. Canvas Color Couleur du canevas Default Canvas background color for annotation area. Changing color affects only new annotation areas. Couleur d'arrière-plan du canevas par défaut pour la zone d'annotation. Le changement de couleur n'affecte que les nouvelles zones d'annotation. Select Item after drawing Sélectionner l'élément après le dessin With this option enabled the item gets selected after being created, allowing changing settings. Si cette option est activée, l'élément est sélectionné après après avoir été créé, ce qui permet de modifier les paramètres. ApplicationSettings Capture screenshot at startup with default mode Faire une capture d'écran au lancement avec le mode par défaut Application Style Style de l'application Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. Définit le style d'interface et d’interactivité de l’application. Vous devrez redémarrer knsip pour le prendre en compte. Application Settings Paramètres de l’application Automatically copy new captures to clipboard Copier automatiquement les nouvelles captures dans le presse-papier Use Tabs Utiliser les onglets Change requires restart. Le changement nécessite un redémarrage. Run ksnip as single instance Exécuter Ksnip en tant qu'instance unique Hide Tabbar when only one Tab is used. Masquer la barre d'onglet lorsqu'un seul onglet est utilisé. Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. Cette option n'autorise à lancer qu'une seule instance ksnip. Si d'autres instances sont lancées, elles passeront leurs arguments à la première avant de s'arrêter. Il faut redémarrer toutes les instances pour activer ou désactiver cette option. Remember Main Window position on move and load on startup Mémoriser la position de la fenêtre principale lors du déplacement et la charger au démarrage Auto hide Tabs Cacher automatiquement les onglets Auto hide Docks Masquer les panneaux automatiquement On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. Masquer au démarrage la barre d’outils et les outils d’annotation. La visibilité du panneau d’outils peut être basculée avec la touche TAB. Auto resize to content Redimensionnement automatique en fonction du contenu Automatically resize Main Window to fit content image. Redimensionner automatiquement la fenêtre principale pour l'adapter à l'image du contenu. AuthorTab Contributors: Contributeurs : Spanish Translation Traduction en espagnol Dutch Translation Traduction en néérlandais Russian Translation Traduction en russe Norwegian Bokmål Translation Traduction en norvégien French Translation Traduction en français Polish Translation Traduction en polonais Snap & Flatpak Support Support Snap & Flatpak The Authors: Les auteurs : CanDiscardOperation Warning - Alerte - The capture %1%2%3 has been modified. Do you want to save it? La capture %1%2%3 a été modifiée. Voulez-vous l'enregistrer ? CaptureModePicker New Nouveau Draw a rectangular area with your mouse Tracer un rectangle avec la souris Capture full screen including all monitors Capture en plein écran, incluant tous les moniteurs Capture screen where the mouse is located Capture de l'écran où se trouve la souris Capture window that currently has focus Capturer la fenêtre active Capture that is currently under the mouse cursor Capturer ce qui est actuellement sous le curseur de la souris Capture a screenshot of the last selected rectangular area Fait une capture d'écran de la dernière zone sélectionnée Uses the screenshot Portal for taking screenshot Utilise le portail de capture d'écran pour les captures ContactTab Community Communauté If you have general questions, ideas or just want to talk about ksnip, Si vous avez des questions générales, des idées ou si vous voulez simplement parler de ksnip, please join our veuillez rejoindre notre server. serveur. Bug Reports Signalements d'erreurs Please use Veuillez utiliser to report bugs. pour signaler des erreurs. CopyAsDataUriOperation Failed to copy to clipboard Impossible de copier dans le presse-papier Failed to copy to clipboard as base64 encoded image. Échec de la copie dans le presse-papier en tant qu’image encodée en base64. Copied to clipboard Copié dans le presse-papier Copied to clipboard as base64 encoded image. Copié dans le presse-papier en tant qu’image encodée en base64. DeleteImageOperation Delete Image Supprimer l'image The item '%1' will be deleted. Do you want to continue? L'élément '%1' va être supprimer. Voulez-vous continuer ? DonateTab here ici Also possible, C'est par Donations are always welcome Les dons sont toujours les bienvenus Donation Dons Become a GitHub Sponsor Devenir un Sponsor sur GitHub ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. ksnip est un projet de logiciel libre, copyleft, sans but lucratif, <br/>et a quand même certains coûts, par exemple les coûts de domaine <br/>ou les coûts de matériel pour la prise en charge multiplateforme. If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that Si vous voulez aider, ou simplement <br/>être reconnaissant de ce travail<br/>, en payant aux développeurs une bière ou un café : c'est possible EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. Ajouter de nouvelles actions en cliquant sur le bouton de l'onglet « Ajouter ». EnumTranslator Rectangular Area Zone rectangulaire Last Rectangular Area Dernière zone rectangulaire Full Screen (All Monitors) Plein Écran (tous les moniteurs) Current Screen Écran actuel Active Window Fenêtre active Window Under Cursor Fenêtre sous le curseur Screenshot Portal Portail de capture d'écran HandleUploadResultOperation Upload Successful Téléversement réussi Upload script Téléverser un script finished successfully. terminé avec succès. Uploaded to Téléversé vers Unable to save temporary image for upload. Impossible de sauvegarder une image temporaire pour le téléversement. Unable to start process, check path and permissions. Impossible de démarrer le processus, vérifiez le chemin et les permissions. Process crashed L’application a planté Process timed out. L’application a mis trop de temps à répondre. Process read error. Erreur de lecture de l’application. Process write error. Erreur d’écriture de l’application. Web error, check console output. Erreur web, vérifier la sortie de la console. Unknown process error. Erreur de traitement inconnue. Upload Failed Échec de téléversement Script wrote to StdErr. Le script a écrit sur StdErr. HotKeySettings Enable Global HotKeys Activer les raccourcis globaux Capture Rect Area Capturer zone rectangulaire Capture Full Screen Capturer tout l'écran Capture current Screen Capturer l'écran actif Capture active Window Capturer la fenêtre active Capture Window under Cursor Capturer la fenêtre sous le curseur Global HotKeys Raccourcis globaux Capture Last Rect Area Capturer la dernière zone rectangulaire Clear Effacer Capture using Portal Capturer par le portail HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. Les HotKeys ne sont actuellement prises en charge que pour Windows et X11. La désactivation de cette option rend également les raccourcis d'action ksnip uniquement. ImageGrabberSettings Capture mouse cursor on screenshot Inclure le curseur de la souris lors d'une capture d'écran Should mouse cursor be visible on screenshots. Le curseur de la souris doit-il être visible les captures d’écran. Image Grabber Captureur d'image Force Generic Wayland Screenshot Captures Wayland Force Generic Scale Generic Wayland Screenshots Captures Wayland Scale Generic Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. L'implémentation de Generic Wayland qui utilise XDG-DESKTOP-PORTAL gère les changements d'échelle différemment. Cette option détermine le changement d'échelle en cours pour l'appliquer à la capture ksnip. GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. GNOME et KDE Plasma prennent en charge leur propre Wayland et les captures Generic XDG-DESKTOP-PORTAL. Cette option force KDE Plasma et GNOME à utiliser les captures XDG-DESKTOP-PORTAL. Redémarrage requis. Show Main Window after capturing screenshot Afficher la fenêtre principale après la capture d'écran Hide Main Window during screenshot Cacher la fenêtre principale pendant la capture Hide Main Window when capturing a new screenshot. Cacher la fenêtre principale pendant une nouvelle capture. Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. Afficher la fenêtre principale après avoir créé une nouvelle capture d'écran lorsque la fenêtre principale a été masquée ou réduite. ImgurHistoryDialog Imgur History Historique Imgur Close Fermer Time Stamp Horodatage Link Lien Delete Link Supprimer le lien ImgurUploader Upload to imgur.com finished! Téléversement sur imgur.com terminé ! Received new token, trying upload again… Nouveau jeton reçu, nouvelle tentative de téléversement… Imgur token has expired, requesting new token… Jeton Imgur expiré, demande de renouvellement… ImgurUploaderSettings Force anonymous upload Anonymiser le téléversement Always copy Imgur link to clipboard Toujours copier le lien Imgur dans le presse-papier Client ID ID Client Client Secret Client secret PIN NIP Enter imgur Pin which will be exchanged for a token. Entrez le NIP Imgur pour l'échanger contre un jeton. Get PIN Obtenir un NIP Get Token Obtenir un token Imgur History Historique Imgur Imgur Uploader Envoyer sur Imgur Username Nom d'utilisateur Waiting for imgur.com… En attente d'imgur.com… Imgur.com token successfully updated. Jeton imgur.com mis à jour avec succès. Imgur.com token update error. Erreur de mise à jour du token Imgur.com. After uploading open Imgur link in default browser Après téléversement, ouvrir le lien imgur avec le navigateur par défaut Link directly to image Relier directement l'image Base Url: URL de base : Base url that will be used for communication with Imgur. Changing requires restart. L’URL de base sera utilisée pour communiquer avec Imgur. La modifier nécessite un redémarrage. Clear Token Effacer les jetons LoadImageFromFileOperation Unable to open image Impossible d’ouvrir l’image Unable to open image from path %1 Impossible d’ouvrir l’image à partir du chemin %1 MainToolBar New Nouveau Delay in seconds between triggering and capturing screenshot. Délai en secondes entre le déclenchement et la capture de l'écran. s s Save Enregistrer Save Screen Capture to file system Enregistrer la capture d'écran sur le disque Copy Copier Copy Screen Capture to clipboard Copier la capture d'écran dans le presse-papier Tools Outils Undo Annuler Redo Rétablir Crop Découper Crop Screen Capture Découper la capture d'écran MainWindow Unsaved Non enregistré Upload Téléverser Print Imprimer Opens printer dialog and provide option to print image Ouvre l'interface de l'imprimante et affiche les options d'impression Print Preview Aperçu avant impression Opens Print Preview dialog where the image orientation can be changed Ouvre la boîte de dialogue Aperçu avant impression où l'orientation de l'image peut être modifiée Scale Redimensionner Quit Quitter Settings Préférences &About &À propos Open Ouvrir &Edit É&dition &Options &Options &Help &Aide Image Files (*.png *.jpg *.bmp) Fichier d'images (*.png *.jpg *.bmp) Add Watermark Ajouter un filigrane Add Watermark to captured image. Multiple watermarks can be added. Ajout d'un filigrane à l'image capturée. Plusieurs filigranes peuvent être ajoutés. &File &Fichier Unable to show image Impossible d'afficher l'image Save As... Enregistrer sous… Paste Coller Paste Embedded Coller l'intégration Pin Épingler Pin screenshot to foreground in frameless window Épingler la capture au premier plan dans une fenêtre sans bords No image provided but one was expected. Une image est attendue mais aucune fournie. Copy Path Chemin de copie Open Directory Ouvrir le dossier &View &Afficher Delete Supprimer Rename Renommer Open Images Ouvrir les images Show Docks Afficher le panneau d'outils Hide Docks Cacher le panneau d'outils Copy as data URI Copie en tant qu’URI de données Open &Recent Ouvrir &Récent Modify Canvas Modifier le canevas Upload triggerCapture to external source Téléverser la capture du déclencheur vers une source externe Copy triggerCapture to system clipboard Copier la capture du déclencheur dans le presse-papier du système Scale Image Image à l'échelle Rotate Pivoter Rotate Image Pivoter l'image MultiCaptureHandler Save Enregistrer Save As Enregistrer sous Open Directory Ouvrir le dossier Copy Copier Copy Path Copier le chemin Delete Supprimer Rename Renommer NewCaptureNameProvider Capture Capture PinWindow Close Fermer Close Other Fermer les autres Close All Tout fermer PinWindowHandler Pin Window %1 Épingler la fenêtre %1 RenameOperation Image Renamed Image renommée Successfully renamed image to Image renommée avec succès en Image Rename Failed Échec du renommage de l'image Failed to rename image to Échec du renommage de l'image en Rename image Renommer l'image New filename: Nouveau nom de fichier : SaveOperation Save As Enregistrer sous Images Images All Files Tous les fichiers Image Saved Image sauvegardée Saving Image Failed Échec de la sauvegarde de l'image Saved to Enregistré sous Failed to save image to Impossible de d’enregistrer l’image sous SaverSettings Automatically save new captures to default location Enregistrer automatiquement les nouvelles captures dans l'emplacement par défaut Prompt to save before discarding unsaved changes Proposer d'enregistrer en cas d'abandon de modifications non enregistrées Remember last Save Directory Se souvenir du dernier emplacement de sauvegarde When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. Proposer le dernier emplacement utilisé pour l'enregistrement plutôt que celui défini ci-dessous. Capture save location and filename Répertoire d'enregistrement et nom du fichier Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. Les formats supportés sont JPG, PNG et BMP. Si aucun format n’est spécifié, PNG sera utilisé par défaut. Le nom du fichier peut contenir les jokers suivants : - $Y : année, $M : mois, $D : jour, $h : heure, $m : minutes, $s : secondes, $T : temps au format « hhmmss ». - Plusieurs caractères # permettent de numéroter. Par exemple : #### donnera 0001 puis 0002 à la prochaine capture. Browse Parcourir Saver Settings Paramètres d'enregistrement Capture save location Répertoire d'enregistrement des captures Default Par défaut Factor Facteur Save Quality Qualité d'enregistrement Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. Préciser 0 pour des fichiers compressés légers, 100 pour des fichiers lourds non compressés. Certains format ne prennent pas en charge l'intervalle en entier comme c'est le cas pour le JPEG. ScriptUploaderSettings Copy script output to clipboard Copier la sortie du script vers le presse-papier Script: Script : Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. Chemin vers le script qui sera utilisé pour le téléversement. Le script sera appelé avec le chemin vers une image temporaire au format PNG comme unique argument. Browse Parcourir Script Uploader Script d'envoi Select Upload Script Sélectionner le script d'envoi Stop when upload script writes to StdErr Arrêter quand le script d'envoi écrit sur StdErr Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. L'envoi sera noté comme échoué si le script a écrit sur StdErr. Si cette case n'est pas cochée, les erreurs du script passeront inaperçues. Filter: Filtre : RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. Expression rationnelle (RegEx). Seules les lignes correspondant à la RegEx seront copiées dans le presse-papier. Si aucun filtre n'est défini, toutes les lignes seront copiées. SettingsDialog Settings Préférences OK OK Cancel Annuler Image Grabber Captureur d'image Imgur Uploader Envoyer sur Imgur Application Application Annotator Annotation HotKeys Raccourcis clavier Uploader Envoi sur un serveur Script Uploader Script d'envoi Saver Enregistrement Stickers Autocollants Snipping Area Zone de capture Tray Icon Icône de la barre des tâches Watermark Filigrane Actions Actions SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Ajuster la taille du rectangle sélectionné en utilisant les poignées ou déplacez-le en glissant la sélection. Use arrow keys to move the selection. Utilisez les touches fléchées pour déplacer la sélection. Use arrow keys while pressing CTRL to move top left handle. Utiliser les touches flèches en pressant CTRL pour déplacer la poignée en haut à gauche. Use arrow keys while pressing ALT to move bottom right handle. Utiliser les touches flèches en pressant ALT pour déplacer la poignée en bas à droite. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. Confirmer la sélection en pressant ENTRÉE/RETOUR ou avorter en pressant ESC. This message can be disabled via settings. Ce message peut être désactivé via les préférences. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Cliquez et faites glisser pour sélectionner une zone rectangulaire ou appuyez sur ÉCHAP pour quitter. Hold CTRL pressed to resize selection after selecting. Maintenez la touche CTRL enfoncée pour redimensionner la sélection après avoir fait une sélection. Hold CTRL pressed to prevent resizing after selecting. Maintenez la touche CTRL enfoncée pour empêcher le redimensionnement après avoir effectué une sélection. Operation will be canceled after 60 sec when no selection made. L’opération sera annulée après 60 secondes si aucune sélection n’est effectuée. This message can be disabled via settings. Ce message peut être désactivé via les préférences. SnippingAreaSettings Freeze Image while snipping Figer l’image lors de la capture When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. Pour figer l'arrière-plan lors de la sélection rectangulaire. Cela affecte aussi le comportement des captures avec délai. Activé, la durée est avant l'affichage de la zone de sélection. Désactivé, la durée est après. Cette fonctionnalité n'est jamais active sur Wayland mais toujours sur MacOS. Show magnifying glass on snipping area Afficher la loupe sur la zone de capture Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. Afficher une loupe qui grossit le fond d’écran. Cette option ne fonctionne que si « Figer l’image avant capture » est activé. Show Snipping Area rulers Afficher les règles de la zone de capture Horizontal and vertical lines going from desktop edges to cursor on snipping area. Afficher des lignes horizontales et verticales depuis les bords de l'écran jusqu'au pointeur pour aider au cadrage. Show Snipping Area position and size info Afficher les informations sur la position et la taille de la zone de capture When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. Lorsque le bouton gauche de la souris n'est pas enfoncé, la position s'affiche, lorsque le bouton de la souris est enfoncé, la taille de la zone sélectionnée est indiquée à gauche et au-dessus de la zone capturée. Allow resizing rect area selection by default Autoriser le redimensionnement de la sélection de la zone rectangulaire par défaut When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. Lorsque l'option est activée, après avoir sélectionné une zone rectangulaire, celle-ci peut être redimensionnée. Le redimensionnement de la sélection peut être confirmé en appuyant sur la touche retour. Show Snipping Area info text Afficher le texte d’informations sur la zone de capture Snipping Area cursor color Couleur du curseur de la zone de capture Sets the color of the snipping area cursor. Définit la couleur du curseur de la zone de capture. Snipping Area cursor thickness Épaisseur du curseur de la zone de capture Sets the thickness of the snipping area cursor. Règle l’épaisseur du curseur de la zone de capture. Snipping Area Zone de capture Snipping Area adorner color Couleur d'ornement de la zone de capture Sets the color of all adorner elements on the snipping area. Définit la couleur de tous les éléments d’ornement sur la zone de capture. Snipping Area Transparency Transparence de la zone de capture Alpha for not selected region on snipping area. Smaller number is more transparent. Alpha pour la région en dehors de la zone de capture. Une petite valeur est plus transparente. StickerSettings Up Monter Down Descendre Use Default Stickers Utiliser les stickers par défaut Sticker Settings Paramètres des stickers Vector Image Files (*.svg) Images vectorielles (*.svg) Add Ajouter Remove Supprimer Add Stickers Ajouter des Stickers TrayIcon Show Editor Montrer l'éditeur TrayIconSettings Use Tray Icon Utiliser l'icône de la barre de tâches When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. Si activé, ajoute une icône dans la barre des tâches si le système d’exploitation le permet. Le changement nécessite un redémarrage. Minimize to Tray Réduire vers la barre des tâches Start Minimized to Tray Démarrer en miniature dans la barre des tâches Close to Tray Fermer vers la barre des tâches Show Editor Afficher l’éditeur Capture Capture Default Tray Icon action Action par défaut de l’icône de la barre des tâches Default Action that is triggered by left clicking the tray icon. Action par défaut déclenchée par un clic gauche sur l’icône dans la barre des tâches. Tray Icon Settings Paramètres de l’icône de la barre des tâches Display Tray icon notifications Afficher les notifications de l’icône de la barre d’outils Use platform specific notification service Utiliser un service de notification spécifique à la plateforme When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. Lorsque cette option est activée, elle essaiera d'utiliser un service de notification spécifique à la plateforme lorsqu'il existe. spécifique à la plateforme lorsqu'il existe. Le changement nécessite un redémarrage pour prendre effet. UpdateWatermarkOperation Select Image Sélectionner l'image Images Images All Files Tous les fichiers UploadOperation Upload Script Required Un script d'envoi est nécessaire Please add an upload script via Options > Settings > Upload Script Veuillez ajouter un script d'envoi dans Options > Paramètres > Script d'envoi Capture Upload Envoi de la capture You are about to upload the image to an external destination, do you want to proceed? La capture va être téléversée sur un serveur externe. Souhaitez-vous continuer ? UploaderSettings Ask for confirmation before uploading Demander une confirmation avant de téléverser Uploader Type: Méthode d'envoi : Imgur Imgur Script Script Uploader Envoi sur un serveur VersionTab Version Version Build Compiler Using: Dépendances : WatermarkSettings Watermark Image Image en filigrane Update Mettre à jour Rotate Watermark Pivoter le filigrane When enabled, Watermark will be added with a rotation of 45° Si activé, le filigrane sera ajouté avec une rotation de 45° Watermark Settings Paramètres des filigranes ksnip-1.9.2/translations/ksnip_fr_CA.ts000066400000000000000000001717751414701001100201250ustar00rootroot00000000000000 AboutDialog About À propos de About À propos Version Version Author Auteur Close Fermer Donate Faire un don Contact Contact AboutTab License: Licence : Screenshot and Annotation Tool Outil de capture d'écran et d'annotation ActionSettingTab Name Nom Shortcut Raccourci Clear Effacer Take Capture Capture d’écran Include Cursor Inclure le curseur Delay Retarder s s Capture Mode Mode de capture Show image in Pin Window Afficher l’image dans la fenêtre d’épinglage Copy image to Clipboard Copier l’image dans le presse-papier Upload image Téléverser l’image Open image parent directory Ouvrir le répertoire parent de l’image Save image Enregistrer l’image Hide Main Window Masquer la fenêtre principale ActionsSettings Add Ajouter Actions Settings Paramètres des actions Action Action AddWatermarkOperation Watermark Image Required Image en filigrane requise Please add a Watermark Image via Options > Settings > Annotator > Update Veuillez ajouter une image en filigrane via Options > Paramètres > Annotateur > Mettre à jour AnnotationSettings Smooth Painter Paths Lisser les tracés peints When enabled smooths out pen and marker paths after finished drawing. Lorsque cette option est activée, le stylo lisse les trajectoires des marqueurs après la fin du dessin. Smooth Factor Facteur de lissage Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. Augmenter le facteur de lissage diminuera la précision du stylo et du marqueur mais les rendra plus lisses. Annotator Settings Paramètres d’annotation Remember annotation tool selection and load on startup Se souvenir de la sélection de l’outil d’annotation et le charger au démarrage Switch to Select Tool after drawing Item Passer à l’outil de sélection après avoir dessiné l’élément Number Tool Seed change updates all Number Items Un changement du numéro de début met à jour tous les items numérotés Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. Lorsqu'on désactive cette option, les changements du numéro de début n'affectent que les nouveaux items et pas les items existants. La désactivation de cette option permet des numéros dupliqués. Canvas Color Couleur du canevas Default Canvas background color for annotation area. Changing color affects only new annotation areas. Couleur d'arrière-plan du canevas par défaut pour la zone d'annotation. Le changement de couleur n'affecte que les nouvelles zones d'annotation. Select Item after drawing Sélectionner l'élément après le dessin With this option enabled the item gets selected after being created, allowing changing settings. Si cette option est activée, l'élément est sélectionné après après avoir été créé, ce qui permet de modifier les paramètres. ApplicationSettings Capture screenshot at startup with default mode Faire une capture d'écran au lancement avec le mode par défaut Application Style Style de l'application Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. Définit le style d'interface et d’interactivité de l’application. Vous devrez redémarrer knsip pour le prendre en compte. Application Settings Paramètres de l’application Automatically copy new captures to clipboard Copier automatiquement les nouvelles captures dans le presse-papier Use Tabs Utiliser les onglets Change requires restart. Le changement nécessite un redémarrage. Run ksnip as single instance Exécuter Ksnip en tant qu'instance unique Hide Tabbar when only one Tab is used. Masquer la barre d'onglet lorsqu'un seul onglet est utilisé. Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. Cette option n'autorise à lancer qu'une seule instance ksnip. Si d'autres instances sont lancées, elles passeront leurs arguments à la première avant de s'arrêter. Il faut redémarrer toutes les instances pour activer ou désactiver cette option. Remember Main Window position on move and load on startup Mémoriser la position de la fenêtre principale lors du déplacement et la charger au démarrage Auto hide Tabs Cacher automatiquement les onglets Auto hide Docks Masquer les panneaux automatiquement On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. Masquer au démarrage la barre d’outils et les outils d’annotation. La visibilité du panneau d’outils peut être basculée avec la touche TAB. Auto resize to content Redimensionnement automatique en fonction du contenu Automatically resize Main Window to fit content image. Redimensionner automatiquement la fenêtre principale pour l'adapter à l'image du contenu. AuthorTab Contributors: Contributeurs : Spanish Translation Traduction en espagnol Dutch Translation Traduction en néérlandais Russian Translation Traduction en russe Norwegian Bokmål Translation Traduction en norvégien French Translation Traduction en français Polish Translation Traduction en polonais Snap & Flatpak Support Support Snap & Flatpak The Authors: Les auteurs : CanDiscardOperation Warning - Alerte - The capture %1%2%3 has been modified. Do you want to save it? La capture %1%2%3 a été modifiée. Voulez-vous l'enregistrer? CaptureModePicker New Nouveau Draw a rectangular area with your mouse Tracer un rectangle avec la souris Capture full screen including all monitors Capture en plein écran, incluant tous les moniteurs Capture screen where the mouse is located Capture de l'écran où se trouve la souris Capture window that currently has focus Capturer la fenêtre active Capture that is currently under the mouse cursor Capturer ce qui est actuellement sous le curseur de la souris Capture a screenshot of the last selected rectangular area Fait une capture d'écran de la dernière zone sélectionnée Uses the screenshot Portal for taking screenshot Utilise le portail de capture d'écran pour les captures ContactTab Community Communauté If you have general questions, ideas or just want to talk about ksnip, Si vous avez des questions générales, des idées ou si vous voulez simplement parler de ksnip, please join our veuillez rejoindre notre server. serveur. Bug Reports Signalements d'erreurs Please use Veuillez utiliser to report bugs. pour signaler des erreurs. CopyAsDataUriOperation Failed to copy to clipboard Impossible de copier dans le presse-papier Failed to copy to clipboard as base64 encoded image. Échec de la copie dans le presse-papier en tant qu’image encodée en base64. Copied to clipboard Copié dans le presse-papier Copied to clipboard as base64 encoded image. Copié dans le presse-papier en tant qu’image encodée en base64. DeleteImageOperation Delete Image Supprimer l'image The item '%1' will be deleted. Do you want to continue? L'élément « %1 » va être supprimer. Voulez-vous continuer? DonateTab here ici Also possible, C'est par Donations are always welcome Les dons sont toujours les bienvenus Donation Dons Become a GitHub Sponsor Devenir un Sponsor sur GitHub ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. ksnip est un projet de logiciel libre, copyleft, sans but lucratif, <br/>et a quand même certains coûts, par exemple les coûts de domaine <br/>ou les coûts de matériel pour la prise en charge multiplateforme. If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that Si vous voulez aider, ou simplement <br/>être reconnaissant de ce travail<br/>, en payant aux développeurs une bière ou un café : c'est possible EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. Ajouter de nouvelles actions en cliquant sur le bouton de l'onglet « Ajouter ». EnumTranslator Rectangular Area Zone rectangulaire Last Rectangular Area Dernière zone rectangulaire Full Screen (All Monitors) Plein Écran (tous les moniteurs) Current Screen Écran actuel Active Window Fenêtre active Window Under Cursor Fenêtre sous le curseur Screenshot Portal Portail de capture d'écran HandleUploadResultOperation Upload Successful Téléversement réussi Upload script Téléverser un script finished successfully. terminé avec succès. Uploaded to Téléversé vers Unable to save temporary image for upload. Impossible de sauvegarder une image temporaire pour le téléversement. Unable to start process, check path and permissions. Impossible de démarrer le processus, vérifiez le chemin et les permissions. Process crashed L’application a planté Process timed out. L’application a mis trop de temps à répondre. Process read error. Erreur de lecture de l’application. Process write error. Erreur d’écriture de l’application. Web error, check console output. Erreur Web, vérifier la sortie de la console. Unknown process error. Erreur de traitement inconnue. Upload Failed Échec de téléversement Script wrote to StdErr. Le script a écrit sur StdErr. HotKeySettings Enable Global HotKeys Activer les raccourcis globaux Capture Rect Area Capturer zone rectangulaire Capture Full Screen Capturer tout l'écran Capture current Screen Capturer l'écran actif Capture active Window Capturer la fenêtre active Capture Window under Cursor Capturer la fenêtre sous le curseur Global HotKeys Raccourcis globaux Capture Last Rect Area Capturer la dernière zone rectangulaire Clear Effacer Capture using Portal Capturer par le portail HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. Les HotKeys ne sont actuellement prises en charge que pour Windows et X11. La désactivation de cette option rend également les raccourcis d'action ksnip uniquement. ImageGrabberSettings Capture mouse cursor on screenshot Inclure le curseur de la souris lors d'une capture d'écran Should mouse cursor be visible on screenshots. Le curseur de la souris doit-il être visible les captures d’écran. Image Grabber Captureur d'image Force Generic Wayland Screenshot Captures Wayland Force Generic Scale Generic Wayland Screenshots Captures Wayland Scale Generic Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. L'implémentation de Generic Wayland qui utilise XDG-DESKTOP-PORTAL gère les changements d'échelle différemment. Cette option détermine le changement d'échelle en cours pour l'appliquer à la capture ksnip. GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. GNOME et KDE Plasma prennent en charge leur propre Wayland et les captures Generic XDG-DESKTOP-PORTAL. Cette option force KDE Plasma et GNOME à utiliser les captures XDG-DESKTOP-PORTAL. Redémarrage requis. Show Main Window after capturing screenshot Afficher la fenêtre principale après la capture d'écran Hide Main Window during screenshot Cacher la fenêtre principale pendant la capture Hide Main Window when capturing a new screenshot. Cacher la fenêtre principale pendant une nouvelle capture. Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. Afficher la fenêtre principale après avoir créé une nouvelle capture d'écran lorsque la fenêtre principale a été masquée ou réduite. ImgurHistoryDialog Imgur History Historique Imgur Close Fermer Time Stamp Horodatage Link Lien Delete Link Supprimer le lien ImgurUploader Upload to imgur.com finished! Téléversement sur imgur.com terminé! Received new token, trying upload again… Nouveau jeton reçu, nouvelle tentative de téléversement… Imgur token has expired, requesting new token… Jeton Imgur expiré, demande de renouvellement… ImgurUploaderSettings Force anonymous upload Anonymiser le téléversement Always copy Imgur link to clipboard Toujours copier le lien Imgur dans le presse-papier Client ID ID Client Client Secret Client secret PIN NIP Enter imgur Pin which will be exchanged for a token. Entrez le NIP Imgur pour l'échanger contre un jeton. Get PIN Obtenir un NIP Get Token Obtenir un token Imgur History Historique Imgur Imgur Uploader Envoyer sur Imgur Username Nom d'utilisateur Waiting for imgur.com… En attente d'imgur.com… Imgur.com token successfully updated. Jeton imgur.com mis à jour avec succès. Imgur.com token update error. Erreur de mise à jour du token Imgur.com. After uploading open Imgur link in default browser Après téléversement, ouvrir le lien imgur avec le navigateur par défaut Link directly to image Relier directement l'image Base Url: URL de base : Base url that will be used for communication with Imgur. Changing requires restart. L’URL de base sera utilisée pour communiquer avec Imgur. La modifier nécessite un redémarrage. Clear Token Effacer les jetons LoadImageFromFileOperation Unable to open image Impossible d’ouvrir l’image Unable to open image from path %1 Impossible d’ouvrir l’image à partir du chemin %1 MainToolBar New Nouveau Delay in seconds between triggering and capturing screenshot. Délai en secondes entre le déclenchement et la capture de l'écran. s s Save Enregistrer Save Screen Capture to file system Enregistrer la capture d'écran sur le disque Copy Copier Copy Screen Capture to clipboard Copier la capture d'écran dans le presse-papier Tools Outils Undo Annuler Redo Rétablir Crop Découper Crop Screen Capture Découper la capture d'écran MainWindow Unsaved Non enregistré Upload Téléverser Print Imprimer Opens printer dialog and provide option to print image Ouvre l'interface de l'imprimante et affiche les options d'impression Print Preview Aperçu avant impression Opens Print Preview dialog where the image orientation can be changed Ouvre la boîte de dialogue Aperçu avant impression où l'orientation de l'image peut être modifiée Scale Redimensionner Quit Quitter Settings Préférences &About &À propos Open Ouvrir &Edit É&dition &Options &Options &Help &Aide Image Files (*.png *.jpg *.bmp) Fichier d'images (*.png *.jpg *.bmp) Add Watermark Ajouter un filigrane Add Watermark to captured image. Multiple watermarks can be added. Ajout d'un filigrane à l'image capturée. Plusieurs filigranes peuvent être ajoutés. &File &Fichier Unable to show image Impossible d'afficher l'image Save As... Enregistrer sous… Paste Coller Paste Embedded Coller l'intégration Pin Épingler Pin screenshot to foreground in frameless window Épingler la capture au premier plan dans une fenêtre sans bords No image provided but one was expected. Une image est attendue mais aucune fournie. Copy Path Chemin de copie Open Directory Ouvrir le dossier &View &Afficher Delete Supprimer Rename Renommer Open Images Ouvrir les images Show Docks Afficher le panneau d'outils Hide Docks Cacher le panneau d'outils Copy as data URI Copie en tant qu’URI de données Open &Recent Ouvrir &Récent Modify Canvas Modifier le canevas Upload triggerCapture to external source Téléverser la capture du déclencheur vers une source externe Copy triggerCapture to system clipboard Copier la capture du déclencheur dans le presse-papier du système Scale Image Image à l'échelle Rotate Pivoter Rotate Image Pivoter l'image MultiCaptureHandler Save Enregistrer Save As Enregistrer sous Open Directory Ouvrir le dossier Copy Copier Copy Path Copier le chemin Delete Supprimer Rename Renommer NewCaptureNameProvider Capture Capture PinWindow Close Fermer Close Other Fermer les autres Close All Tout fermer PinWindowHandler Pin Window %1 Épingler la fenêtre %1 RenameOperation Image Renamed Image renommée Successfully renamed image to Image renommée avec succès en Image Rename Failed Échec du renommage de l'image Failed to rename image to Échec du renommage de l'image en Rename image Renommer l'image New filename: Nouveau nom de fichier : SaveOperation Save As Enregistrer sous Images Images All Files Tous les fichiers Image Saved Image sauvegardée Saving Image Failed Échec de la sauvegarde de l'image Saved to Enregistré sous Failed to save image to Impossible de d’enregistrer l’image sous SaverSettings Automatically save new captures to default location Enregistrer automatiquement les nouvelles captures dans l'emplacement par défaut Prompt to save before discarding unsaved changes Proposer d'enregistrer en cas d'abandon de modifications non enregistrées Remember last Save Directory Se souvenir du dernier emplacement de sauvegarde When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. Proposer le dernier emplacement utilisé pour l'enregistrement plutôt que celui défini ci-dessous. Capture save location and filename Répertoire d'enregistrement et nom du fichier Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. Les formats supportés sont JPG, PNG et BMP. Si aucun format n’est spécifié, PNG sera utilisé par défaut. Le nom du fichier peut contenir les jokers suivants : - $Y : année, $M : mois, $D : jour, $h : heure, $m : minutes, $s : secondes, $T : temps au format « hhmmss ». - Plusieurs caractères # permettent de numéroter. Par exemple : #### donnera 0001 puis 0002 à la prochaine capture. Browse Parcourir Saver Settings Paramètres d'enregistrement Capture save location Répertoire d'enregistrement des captures Default Par défaut Factor Facteur Save Quality Qualité d'enregistrement Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. Préciser 0 pour des fichiers compressés légers, 100 pour des fichiers lourds non compressés. Certains format ne prennent pas en charge l'intervalle en entier comme c'est le cas pour le JPEG. ScriptUploaderSettings Copy script output to clipboard Copier la sortie du script vers le presse-papier Script: Script : Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. Chemin vers le script qui sera utilisé pour le téléversement. Le script sera appelé avec le chemin vers une image temporaire au format PNG comme unique argument. Browse Parcourir Script Uploader Script d'envoi Select Upload Script Sélectionner le script d'envoi Stop when upload script writes to StdErr Arrêter quand le script d'envoi écrit sur StdErr Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. L'envoi sera noté comme échoué si le script a écrit sur StdErr. Si cette case n'est pas cochée, les erreurs du script passeront inaperçues. Filter: Filtre : RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. Expression rationnelle (RegEx). Seules les lignes correspondant à la RegEx seront copiées dans le presse-papier. Si aucun filtre n'est défini, toutes les lignes seront copiées. SettingsDialog Settings Préférences OK OK Cancel Annuler Image Grabber Captureur d'image Imgur Uploader Envoyer sur Imgur Application Application Annotator Annotation HotKeys Raccourcis clavier Uploader Envoi sur un serveur Script Uploader Script d'envoi Saver Enregistrement Stickers Autocollants Snipping Area Zone de capture Tray Icon Icône de la barre des tâches Watermark Filigrane Actions Actions SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Ajuster la taille du rectangle sélectionné en utilisant les poignées ou déplacez-le en glissant la sélection. Use arrow keys to move the selection. Utilisez les touches fléchées pour déplacer la sélection. Use arrow keys while pressing CTRL to move top left handle. Utiliser les touches flèches en pressant CTRL pour déplacer la poignée en haut à gauche. Use arrow keys while pressing ALT to move bottom right handle. Utiliser les touches flèches en pressant ALT pour déplacer la poignée en bas à droite. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. Confirmer la sélection en pressant ENTRÉE/RETOUR ou avorter en pressant ESC. This message can be disabled via settings. Ce message peut être désactivé via les préférences. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Cliquez et faites glisser pour sélectionner une zone rectangulaire ou appuyez sur ÉCHAP pour quitter. Hold CTRL pressed to resize selection after selecting. Maintenez la touche CTRL enfoncée pour redimensionner la sélection après avoir fait une sélection. Hold CTRL pressed to prevent resizing after selecting. Maintenez la touche CTRL enfoncée pour empêcher le redimensionnement après avoir effectué une sélection. Operation will be canceled after 60 sec when no selection made. L’opération sera annulée après 60 secondes si aucune sélection n’est effectuée. This message can be disabled via settings. Ce message peut être désactivé via les préférences. SnippingAreaSettings Freeze Image while snipping Figer l’image lors de la capture When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. Pour figer l'arrière-plan lors de la sélection rectangulaire. Cela affecte aussi le comportement des captures avec délai. Activé, la durée est avant l'affichage de la zone de sélection. Désactivé, la durée est après. Cette fonctionnalité n'est jamais active sur Wayland mais toujours sur MacOS. Show magnifying glass on snipping area Afficher la loupe sur la zone de capture Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. Afficher une loupe qui grossit le fond d’écran. Cette option ne fonctionne que si « Figer l’image avant capture » est activé. Show Snipping Area rulers Afficher les règles de la zone de capture Horizontal and vertical lines going from desktop edges to cursor on snipping area. Afficher des lignes horizontales et verticales depuis les bords de l'écran jusqu'au pointeur pour aider au cadrage. Show Snipping Area position and size info Afficher les informations sur la position et la taille de la zone de capture When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. Lorsque le bouton gauche de la souris n'est pas enfoncé, la position s'affiche, lorsque le bouton de la souris est enfoncé, la taille de la zone sélectionnée est indiquée à gauche et au-dessus de la zone capturée. Allow resizing rect area selection by default Autoriser le redimensionnement de la sélection de la zone rectangulaire par défaut When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. Lorsque l'option est activée, après avoir sélectionné une zone rectangulaire, celle-ci peut être redimensionnée. Le redimensionnement de la sélection peut être confirmé en appuyant sur la touche retour. Show Snipping Area info text Afficher le texte d’informations sur la zone de capture Snipping Area cursor color Couleur du curseur de la zone de capture Sets the color of the snipping area cursor. Définit la couleur du curseur de la zone de capture. Snipping Area cursor thickness Épaisseur du curseur de la zone de capture Sets the thickness of the snipping area cursor. Règle l’épaisseur du curseur de la zone de capture. Snipping Area Zone de capture Snipping Area adorner color Couleur d'ornement de la zone de capture Sets the color of all adorner elements on the snipping area. Définit la couleur de tous les éléments d’ornement sur la zone de capture. Snipping Area Transparency Transparence de la zone de capture Alpha for not selected region on snipping area. Smaller number is more transparent. Alpha pour la région en dehors de la zone de capture. Une petite valeur est plus transparente. StickerSettings Up Monter Down Descendre Use Default Stickers Utiliser les stickers par défaut Sticker Settings Paramètres des stickers Vector Image Files (*.svg) Images vectorielles (*.svg) Add Ajouter Remove Supprimer Add Stickers Ajouter des Stickers TrayIcon Show Editor Montrer l'éditeur TrayIconSettings Use Tray Icon Utiliser l'icône de la barre de tâches When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. Si activé, ajoute une icône dans la barre des tâches si le système d’exploitation le permet. Le changement nécessite un redémarrage. Minimize to Tray Réduire vers la barre des tâches Start Minimized to Tray Démarrer en miniature dans la barre des tâches Close to Tray Fermer vers la barre des tâches Show Editor Afficher l’éditeur Capture Capture Default Tray Icon action Action par défaut de l’icône de la barre des tâches Default Action that is triggered by left clicking the tray icon. Action par défaut déclenchée par un clic gauche sur l’icône dans la barre des tâches. Tray Icon Settings Paramètres de l’icône de la barre des tâches Display Tray icon notifications Afficher les notifications de l’icône de la barre d’outils Use platform specific notification service Utiliser un service de notification spécifique à la plateforme When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. Lorsque cette option est activée, elle essaiera d'utiliser un service de notification spécifique à la plateforme lorsqu'il existe. spécifique à la plateforme lorsqu'il existe. Le changement nécessite un redémarrage pour prendre effet. UpdateWatermarkOperation Select Image Sélectionner l'image Images Images All Files Tous les fichiers UploadOperation Upload Script Required Un script d'envoi est nécessaire Please add an upload script via Options > Settings > Upload Script Veuillez ajouter un script d'envoi dans Options > Paramètres > Script d'envoi Capture Upload Envoi de la capture You are about to upload the image to an external destination, do you want to proceed? La capture va être téléversée sur un serveur externe. Souhaitez-vous continuer? UploaderSettings Ask for confirmation before uploading Demander une confirmation avant de téléverser Uploader Type: Méthode d'envoi : Imgur Imgur Script Script Uploader Envoi sur un serveur VersionTab Version Version Build Compiler Using: Dépendances : WatermarkSettings Watermark Image Image en filigrane Update Mettre à jour Rotate Watermark Pivoter le filigrane When enabled, Watermark will be added with a rotation of 45° Si activé, le filigrane sera ajouté avec une rotation de 45° Watermark Settings Paramètres des filigranes ksnip-1.9.2/translations/ksnip_gl.ts000066400000000000000000001524041414701001100175410ustar00rootroot00000000000000 AboutDialog About Sobre About Sobre Version Versión Author Autor Close Pechar Donate Contact AboutTab License: Licenza: Screenshot and Annotation Tool ActionSettingTab Name Shortcut Clear Take Capture Include Cursor Delay s seg. Capture Mode Show image in Pin Window Copy image to Clipboard Upload image Open image parent directory Save image Hide Main Window ActionsSettings Add Actions Settings Action AddWatermarkOperation Watermark Image Required Please add a Watermark Image via Options > Settings > Annotator > Update AnnotationSettings Smooth Painter Paths When enabled smooths out pen and marker paths after finished drawing. Smooth Factor Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. Annotator Settings Remember annotation tool selection and load on startup Switch to Select Tool after drawing Item Number Tool Seed change updates all Number Items Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. Canvas Color Default Canvas background color for annotation area. Changing color affects only new annotation areas. Select Item after drawing With this option enabled the item gets selected after being created, allowing changing settings. ApplicationSettings Capture screenshot at startup with default mode Captura de pantalla no inicio co modo predeterminado Application Style Estilo do aplicativo Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. Estabelece o estilo do aplicativo que define a aparencia da interface O cambio require do reinicio do ksnip para que teña efecto. Application Settings Automatically copy new captures to clipboard Use Tabs Change requires restart. Run ksnip as single instance Hide Tabbar when only one Tab is used. Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. Remember Main Window position on move and load on startup Auto hide Tabs Auto hide Docks On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. Auto resize to content Automatically resize Main Window to fit content image. AuthorTab Contributors: Colaboradores: Spanish Translation Tradución ao español Dutch Translation Tradución ao holandés Russian Translation Tradución ao ruso Norwegian Bokmål Translation Tradución ao noruegués Bokmål French Translation Tradución ao francés Polish Translation Tradución ao polaco Snap & Flatpak Support The Authors: CanDiscardOperation Warning - Aviso - The capture %1%2%3 has been modified. Do you want to save it? CaptureModePicker New Novo Draw a rectangular area with your mouse Debuxe unha área rectangular co rato Capture full screen including all monitors Capturar a pantalla completa incluíndo todos os monitores Capture screen where the mouse is located Capturar a pantalla na que se atopa o rato Capture window that currently has focus Capturar a pantalla que está en foco agora Capture that is currently under the mouse cursor Captura a xanela que se atopa agora baixo o cursor do rato Capture a screenshot of the last selected rectangular area Uses the screenshot Portal for taking screenshot ContactTab Community If you have general questions, ideas or just want to talk about ksnip, please join our server. Bug Reports Please use Empregue to report bugs. para informar de fallos. CopyAsDataUriOperation Failed to copy to clipboard Failed to copy to clipboard as base64 encoded image. Copied to clipboard Copied to clipboard as base64 encoded image. DeleteImageOperation Delete Image The item '%1' will be deleted. Do you want to continue? DonateTab here Also possible, Donations are always welcome Donation Become a GitHub Sponsor ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. EnumTranslator Rectangular Area Área rectangular Last Rectangular Area Full Screen (All Monitors) Pantalla completa (todos os monitores) Current Screen Pantalla actual Active Window Xanela activa Window Under Cursor Xanela baixo o cursor Screenshot Portal HandleUploadResultOperation Upload Successful Upload script finished successfully. Uploaded to Unable to save temporary image for upload. Unable to start process, check path and permissions. Process crashed Process timed out. Process read error. Process write error. Web error, check console output. Unknown process error. Upload Failed Script wrote to StdErr. HotKeySettings Enable Global HotKeys Capture Rect Area Capture Full Screen Capture current Screen Capture active Window Capture Window under Cursor Global HotKeys Capture Last Rect Area Clear Capture using Portal HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. ImageGrabberSettings Capture mouse cursor on screenshot Capturar o cursor do rato na captura de pantalla Should mouse cursor be visible on screenshots. Se o cursor do rato está visíbel nas capturas de pantalla. Image Grabber Force Generic Wayland Screenshot Scale Generic Wayland Screenshots Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. Show Main Window after capturing screenshot Hide Main Window during screenshot Hide Main Window when capturing a new screenshot. Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. ImgurHistoryDialog Imgur History Historial do Imgur Close Pechar Time Stamp Marca temporal Link Ligazón Delete Link Eliminar a ligazón ImgurUploader Upload to imgur.com finished! Rematou o envío a imgur.com. Received new token, trying upload again… Imgur token has expired, requesting new token… ImgurUploaderSettings Force anonymous upload Always copy Imgur link to clipboard Client ID Client Secret PIN Enter imgur Pin which will be exchanged for a token. Get PIN Get Token Imgur History Historial do Imgur Imgur Uploader Username Nome do usuario Waiting for imgur.com… Imgur.com token successfully updated. Imgur.com token update error. After uploading open Imgur link in default browser Link directly to image Base Url: Base url that will be used for communication with Imgur. Changing requires restart. Clear Token LoadImageFromFileOperation Unable to open image Unable to open image from path %1 MainToolBar New Novo Delay in seconds between triggering and capturing screenshot. Atraso en segundos entre a activación e a captura de pantalla. s seg. Save Gardar Save Screen Capture to file system Gardar a captura de pantalla no sistema de ficheiros Copy Copiar Copy Screen Capture to clipboard Copiar as capturas de pantalla no portapapeis Tools Ferramentas Undo Redo Crop Cortar Crop Screen Capture Cortar a captura de pantalla MainWindow Unsaved Sen gardar Upload Envío Print Imprimir Opens printer dialog and provide option to print image Abre o cadro de dialogo da impresora e fornece a opción para imprimir a imaxe Print Preview Vista previa da impresión Opens Print Preview dialog where the image orientation can be changed Abre o cadro de diálogo da vista previa de impresión onde se pode cambiar a orientación da imaxe Scale Escalar Quit Saír Settings Axustes &About &Sobre Open Abrir &Edit &Editar &Options &Opcións &Help &Axuda Image Files (*.png *.jpg *.bmp) Ficheiros de imaxe (*.png *.jpg *.bmp) Add Watermark Add Watermark to captured image. Multiple watermarks can be added. &File Unable to show image Save As... Paste Paste Embedded Pin Pin screenshot to foreground in frameless window No image provided but one was expected. Copy Path Open Directory &View Delete Rename Open Images Show Docks Hide Docks Copy as data URI Open &Recent Modify Canvas Upload triggerCapture to external source Copy triggerCapture to system clipboard Scale Image Rotate Rotate Image MultiCaptureHandler Save Gardar Save As Gardar como Open Directory Copy Copiar Copy Path Delete Rename NewCaptureNameProvider Capture PinWindow Close Pechar Close Other Close All PinWindowHandler Pin Window %1 RenameOperation Image Renamed Successfully renamed image to Image Rename Failed Failed to rename image to Rename image New filename: SaveOperation Save As Gardar como Images Imaxes All Files Todos os ficheiros Image Saved Saving Image Failed Saved to Failed to save image to SaverSettings Automatically save new captures to default location Prompt to save before discarding unsaved changes Preguntar para gardar antes de desbotar cambios sen gardar Remember last Save Directory When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. Capture save location and filename Localización e nome do ficheiro da captura Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. Browse Navegar Saver Settings Capture save location Default Factor Save Quality Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. ScriptUploaderSettings Copy script output to clipboard Script: Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. Browse Navegar Script Uploader Select Upload Script Stop when upload script writes to StdErr Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. Filter: RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. SettingsDialog Settings Axustes OK Cancel Image Grabber Imgur Uploader Application Annotator HotKeys Uploader Script Uploader Saver Stickers Snipping Area Tray Icon Watermark Actions SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Use arrow keys to move the selection. Use arrow keys while pressing CTRL to move top left handle. Use arrow keys while pressing ALT to move bottom right handle. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. This message can be disabled via settings. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Hold CTRL pressed to resize selection after selecting. Hold CTRL pressed to prevent resizing after selecting. Operation will be canceled after 60 sec when no selection made. This message can be disabled via settings. SnippingAreaSettings Freeze Image while snipping Conxelar a imaxe mentres se recorta When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. Show magnifying glass on snipping area Amosar a lupa na área de recorte Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. Amosar unha lupa para facer zoom na imaxe de fondo. Esta opción só funciona coa opción «Conxelar a imaxe mentres se recorta» activada. Show Snipping Area rulers Amosar as regras na área de recorte Horizontal and vertical lines going from desktop edges to cursor on snipping area. Liñas horizontais e verticais que van dende os bordos do escritorio ata o cursor na área de recorte. Show Snipping Area position and size info Amosar la posición da área de recorte e a información do tamaño When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. Allow resizing rect area selection by default When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. Show Snipping Area info text Snipping Area cursor color Sets the color of the snipping area cursor. Snipping Area cursor thickness Sets the thickness of the snipping area cursor. Snipping Area Snipping Area adorner color Sets the color of all adorner elements on the snipping area. Snipping Area Transparency Alpha for not selected region on snipping area. Smaller number is more transparent. StickerSettings Up Down Use Default Stickers Sticker Settings Vector Image Files (*.svg) Add Remove Add Stickers TrayIcon Show Editor TrayIconSettings Use Tray Icon When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. Minimize to Tray Start Minimized to Tray Close to Tray Show Editor Capture Default Tray Icon action Default Action that is triggered by left clicking the tray icon. Tray Icon Settings Display Tray icon notifications Use platform specific notification service When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. UpdateWatermarkOperation Select Image Images Imaxes All Files Todos os ficheiros UploadOperation Upload Script Required Please add an upload script via Options > Settings > Upload Script Capture Upload You are about to upload the image to an external destination, do you want to proceed? UploaderSettings Ask for confirmation before uploading Uploader Type: Imgur Script Uploader VersionTab Version Versión Build Construción Using: Usando: WatermarkSettings Watermark Image Update Rotate Watermark When enabled, Watermark will be added with a rotation of 45° Watermark Settings ksnip-1.9.2/translations/ksnip_hr.ts000066400000000000000000001650211414701001100175470ustar00rootroot00000000000000 AboutDialog About Informacije About Informacije Version Verzija Author Autor Close Zatvori Donate Doniraj Contact Kontakt AboutTab License: Licenca: Screenshot and Annotation Tool Alat za snimanje ekrana i komentiranje ActionSettingTab Name Ime Shortcut Prečac Clear Isprazni Take Capture Snimi sliku Include Cursor Uključi kursor Delay Odgodi s s Capture Mode Način snimanja Show image in Pin Window Prikaži sliku u prikvačenom prozoru Copy image to Clipboard Kopiraj sliku u međuspremnik Upload image Prenesi sliku Open image parent directory Otvori nadređenu mapu slike Save image Spremi sliku Hide Main Window Sakrij glavni prozor ActionsSettings Add Dodaj Actions Settings Postavke radnje Action Radnja AddWatermarkOperation Watermark Image Required Potrebna je slika vodenog žiga Please add a Watermark Image via Options > Settings > Annotator > Update Dodaj sliku vodenog žiga putem Opcije > Postavke > Komentari > Aktualiziraj AnnotationSettings Smooth Painter Paths Zaglađivanje crtanih staza When enabled smooths out pen and marker paths after finished drawing. Kad je aktivirano, zaglađuje staze olovke i markera nakon crtanja. Smooth Factor Faktor zaglađivanja Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. Povećanjem faktora zaglađivanja smanjit će se točnost olovke i markera, ali će povećati zaglađivanje. Annotator Settings Postavke komentara Remember annotation tool selection and load on startup Zapamti odabir alata za komentare i učitaj ga tijekom pokretanja programa Switch to Select Tool after drawing Item Prebaci na alat za biranje elemenata nakon crtanja elementa Number Tool Seed change updates all Number Items Mijenjanjem vrijednosti brojača, aktualiziraju se svi brojevni elementi Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. Deaktiviranjem ove opcije brojač utječe samo na nove elemente, ne i na postojeće. Na taj je način moguće koristiti iste brojeve višestruko. Canvas Color Boja platna Default Canvas background color for annotation area. Changing color affects only new annotation areas. Standardna boja pozadine platna za područje komentara. Promjena boje utječe samo na nova područja komentara. Select Item after drawing Odabir element nakon crtanja With this option enabled the item gets selected after being created, allowing changing settings. Kad je ova opcija aktivirana, element se odabire nakon što se stvori i omogućuje mijenjanje postavki. ApplicationSettings Capture screenshot at startup with default mode Snimi sliku ekrana prilikom pokretanja programa sa standardnim modusom Application Style Stil programa Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. Postavlja stil programa koji određuje izgled sučelja. Promjene stupaju na snagu nakon ponovnog pokretanja ksnipa. Application Settings Postavke programa Automatically copy new captures to clipboard Automatski kopiraj nove snimke u međuspremnik Use Tabs Koristi kartice Change requires restart. Promjena zahtijeva ponovno pokretanje programa. Run ksnip as single instance Pokrenite samo jedan primjerak ksnipa Hide Tabbar when only one Tab is used. Sakrij traku kartica kad postoji samo jedna kartica. Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. Aktiviranjem ove opcije omogućuje se pokretanje samo jednog primjerka programa ksnip, a sva naknadna pokretanja programa proslijedit će svoje argumente prvom pokrenutom i zatim će se zatvoriti. Mijenjanje ove opcije zahtijeva ponovno pokretanje svih primjeraka. Remember Main Window position on move and load on startup Zapamti položaj glavnog prozora prilikom premještanja i učitaj ga prilikom pokretanja programa Auto hide Tabs Automatski sakrij kartice Auto hide Docks Automatski sakrij ploče On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. Prilikom pokretanja sakrij alatnu traku i postavke komentara. Vidljivost ploča može se promijeniti pomoću tipke tabulatora. Auto resize to content Automatski prilagodi veličinu sadržaju Automatically resize Main Window to fit content image. Automatski prilagodi veličinu glavnog prozora veličini slike sadržaja. AuthorTab Contributors: Doprinositelji: Spanish Translation Prijevod na španjolski Dutch Translation Prijevod na nizozemski Russian Translation Prijevod na ruski Norwegian Bokmål Translation Prijevod na norveški bokmål French Translation Prijevod na francuski Polish Translation Prijevod na poljski Snap & Flatpak Support Snap i Flatpak podrška The Authors: Autori: CanDiscardOperation Warning - Upozorenje – The capture %1%2%3 has been modified. Do you want to save it? Snimka %1%2%3 je promijenjena. Želiš li je spremiti? CaptureModePicker New Novo Draw a rectangular area with your mouse Nacrtaj pravokutno područje pomoću miša Capture full screen including all monitors Snimi cijeli ekran uključujući sve monitore Capture screen where the mouse is located Snimi ekran na mjestu gdje se nalazi miš Capture window that currently has focus Snimi trenutačno aktivni prozor Capture that is currently under the mouse cursor Snimi ono što se nalazi ispod pokazivača miša Capture a screenshot of the last selected rectangular area Snimi sliku ekrana zadnjeg odabranog pravokutnog područja Uses the screenshot Portal for taking screenshot Koristi portal slika ekrana za snimanje slike ekrana ContactTab Community Zajednica If you have general questions, ideas or just want to talk about ksnip, Ako imaš opća pitanja, ideje ili ako samo želiš razgovarati o ksnipu, please join our pridruži se našem server. serveru. Bug Reports Prijave grešaka Please use Koristi to report bugs. za prijavljivanje grešaka. CopyAsDataUriOperation Failed to copy to clipboard Neuspjelo kopiranje u međuspremnik Failed to copy to clipboard as base64 encoded image. Neuspjelo kopiranje u međuspremnik kao base64-kodiranu sliku. Copied to clipboard Kopirano u međuspremnik Copied to clipboard as base64 encoded image. Kopirano u međuspremnik kao base64-kodirana slika. DeleteImageOperation Delete Image Izbriši sliku The item '%1' will be deleted. Do you want to continue? Izbrisat će se element „%1”. Želiš li nastaviti? DonateTab here ovdje Also possible, Također moguće, Donations are always welcome Donacije su uvijek dobrodošle Donation Donacija Become a GitHub Sponsor Postani GitHub sponzor ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. ksnip je neprofitni projekt softvera otvorenog koda,<br/>ima troškove koje treba pokriti,<br/>poput troškova za domenu ili hardverskih troškova za podršku raznih platformi. If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that Ako želiš pomoći ili ako se samo<br/>želiš zahvaliti<br/>, počasti programere pivom ili kavom. To možeš učiniti EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. Dodaj nove radnje pritiskom gumba „Dodaj”. EnumTranslator Rectangular Area Pravokutno područje Last Rectangular Area Zadnje pravokutno područje Full Screen (All Monitors) Cijeli ekran (svi monitori) Current Screen Trenutačni ekran Active Window Aktivni prozor Window Under Cursor Prozor ispod pokazivača Screenshot Portal Portal slika ekrana HandleUploadResultOperation Upload Successful Prijenos je uspio Upload script Prenesi skripta finished successfully. uspješno završeno. Uploaded to Preneseno u Unable to save temporary image for upload. Nije moguće spremiti privremenu sliku za prijenos. Unable to start process, check path and permissions. Nije moguće pokrenuti postupak. Provjeri stazu i dozvole. Process crashed Postupak prekinut zbog greške Process timed out. Postupak je prekoračio vrijeme. Process read error. Greška u postupku čitanja. Process write error. Greška u postupku pisanja. Web error, check console output. Web-greška. Pregledaj rezultat u konzoli. Unknown process error. Nepoznata greška u postupku. Upload Failed Prijenos nije uspio Script wrote to StdErr. Skripta je zapisala u standardnu grešku (StdErr). HotKeySettings Enable Global HotKeys Aktiviraj globalne tipkovničke prečace Capture Rect Area Snimi pravokutno područje Capture Full Screen Snimi cijeli ekran Capture current Screen Snimi trenutačni ekran Capture active Window Snimi aktivni prozor Capture Window under Cursor Snimi prozor ispod pokazivača Global HotKeys Globalni tipkovnički prečaci Capture Last Rect Area Snimi zadnje pravokutno područje Clear Isprazni Capture using Portal Snimi koristeći portal HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. Tipkovnički prečaci su trenutačno dostupni samo za Windows i X11. Deaktiviranjem ove opcije također omogućuje prečace radnji samo za ksnip. ImageGrabberSettings Capture mouse cursor on screenshot Snimi pokazivač miša u sliku ekrana Should mouse cursor be visible on screenshots. Da li prikazati pokazivač miša u slikama ekrana. Image Grabber Snimanje slika Force Generic Wayland Screenshot Prisili generičku Wayland sliku ekrana Scale Generic Wayland Screenshots Skaliraj generičke Wayland slike ekrana Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. Generičke implementacije Waylanda koji koriste XDG-DESKTOP-PORTAL različito upravljaju skaliranjem ekrana. Aktiviranjem ove opcije odredit će se trenutačno skaliranje ekrana i primijeniti na sliku ekrana u ksnipu. GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. GNOME i KDE Plasma podržavaju vlastiti Wayland i generičke XDG-DESKTOP-PORTAL slike ekrana. Aktiviranjem ove opcije prisilit će KDE Plasma i GNOME da koriste XDG-DESKTOP-PORTAL slike ekrana. Mijenjanje ove opcije zahtijeva ponovno pokretanje ksnip-a. Show Main Window after capturing screenshot Pokaži glavni prozor nakon snimanja slike ekrana Hide Main Window during screenshot Sakrij glavni prozor tijekom snimanja slike ekrana Hide Main Window when capturing a new screenshot. Sakrij glavni prozor pri snimanju nove slike ekrana. Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. Prikaži glavni prozor nakon snimanja nove snimke ekrana kad je glavni prozor bio skriven ili smanjen. ImgurHistoryDialog Imgur History Imgur povijest Close Zatvori Time Stamp Vremenska oznaka Link Poveznica Delete Link Izbriši poveznicu ImgurUploader Upload to imgur.com finished! Prijenos na imgur.com je završen! Received new token, trying upload again… Primljen je novi token, pokušaj ponovnog prijenosa … Imgur token has expired, requesting new token… Imgur token je istekao, šalje se zahtijev se novim tokenom … ImgurUploaderSettings Force anonymous upload Prisili anonimni prijenos Always copy Imgur link to clipboard Uvijek kopiraj Imgur-poveznicu u međuspremnik Client ID ID klijenta Client Secret Tajna klijenta PIN PIN Enter imgur Pin which will be exchanged for a token. Upiši imgur pin koji će se zamijeniti za token. Get PIN Nabavi PIN Get Token Nabavi token Imgur History Imgur povijest Imgur Uploader Prijenos za Imgur Username Korisničko ime Waiting for imgur.com… Čekanje na imgur.com … Imgur.com token successfully updated. Imgur.com token uspješno aktualiziran. Imgur.com token update error. Greška aktualiziranja Imgur.com tokena. After uploading open Imgur link in default browser Nakon prijenosa otvori poveznicu na Imgur u standardnom pregledniku Link directly to image Poveži izravno na sliku Base Url: Osnovni URL: Base url that will be used for communication with Imgur. Changing requires restart. Osnovni URL koji će se koristiti za komunikaciju s Imgurom. Promjena zahtijeva ponovno pokretanje programa. Clear Token Poništi token LoadImageFromFileOperation Unable to open image Neuspjelo otvaranje slike Unable to open image from path %1 Neuspjelo otvaranje slike iz %1 MainToolBar New Novo Delay in seconds between triggering and capturing screenshot. Zadrška u sekundama između okidanja i snimanja slike ekrana. s s Save Spremi Save Screen Capture to file system Spremi snimku ekrana u datotečni sustav Copy Kopiraj Copy Screen Capture to clipboard Kopiraj snimku ekrana u međuspremnik Tools Alati Undo Poništi Redo Ponovi Crop Obreži Crop Screen Capture Obreži snimku ekrana MainWindow Unsaved Nespremljeno Upload Prenesi Print Ispiši Opens printer dialog and provide option to print image Otvara dijaloški okvir pisača i omogućuje ispisivanje slike Print Preview Pretprikaz ispisa Opens Print Preview dialog where the image orientation can be changed Otvara dijalog za pregled ispisa u kojem se može promijeniti orijentacija slike Scale Skaliraj Quit Zatvori program Settings Postavke &About &Informacije Open Otvori &Edit &Uredi &Options &Opcije &Help &Pomoć Image Files (*.png *.jpg *.bmp) Slikovne datoteke (*.png *.jpg *.bmp) Add Watermark Dodaj vodeni žig Add Watermark to captured image. Multiple watermarks can be added. Dodaj vodeni žig snimljenoj slici. Moguće je dodati više vodenih žigova. &File &Datoteka Unable to show image Nije moguće prikazati sliku Save As... Spremi kao … Paste Umetni Paste Embedded Umetni ugrađeno Pin Prikvači Pin screenshot to foreground in frameless window Prikvači sliku ekrana naprijed u bezrubnom prozoru No image provided but one was expected. Nijedna slika nije zadana, ali očekuje se jedna. Copy Path Kopiraj stazu Open Directory Otvori direktorij &View &Prikaz Delete Izbriši Rename Preimenuj Open Images Otvori slike Show Docks Prikaži ploče Hide Docks Sakrij ploče Copy as data URI Kopiraj kao URI podatke Open &Recent Otvori &nedavne Modify Canvas Promijeni platno Upload triggerCapture to external source Prenesi snimku ekrana u vanjski izvor Copy triggerCapture to system clipboard Kopiraj snimku ekrana u međuspremnik sustava Scale Image Promijeni veličinu slike Rotate Okreni Rotate Image Okreni sliku MultiCaptureHandler Save Spremi Save As Spremi kao Open Directory Otvori direktorij Copy Kopiraj Copy Path Kopiraj stazu Delete Izbriši Rename Preimenuj NewCaptureNameProvider Capture Snimi PinWindow Close Zatvori Close Other Zatvori ostale Close All Zatvori sve PinWindowHandler Pin Window %1 Prikvači prozor %1 RenameOperation Image Renamed Slika je preimenovana Successfully renamed image to Slika je uspješno preimenovana u Image Rename Failed Neuspjelo preimenovanje slike Failed to rename image to Neuspjelo preimenovanje slike u Rename image Preimenuj sliku New filename: Novo ime datoteke: SaveOperation Save As Spremi kao Images Slike All Files Sve datoteke Image Saved Slika je spremljena Saving Image Failed Spremanje slike neuspjelo Saved to Spremljeno u Failed to save image to Neuspjelo spremanje slike u SaverSettings Automatically save new captures to default location Automatski spremi nove snimke u standardno mjesto Prompt to save before discarding unsaved changes Zatraži spremanje prije odbacivanja nespremljenih promjena Remember last Save Directory Zapamti zadnji direktorij spremanja When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. Kad je aktivirano, prepisat će mapu za spremanje u postavkama s najnovijom mapom za spremanje, za svako spremanje. Capture save location and filename Mjesto spremanja snimke i ime datoteke Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. Podržani formati su JPG, PNG i BMP. Ako nije naveden nijedan format, standardno će se koristiti PNG. Ime datoteke može sadržavati sljedeće zamjenske znakove: - $Y, $M, $D za datum, $h, $m, $s za vrijeme ili $T za vrijeme u formatu „ hhmmss”. - Više uzastopnih znakova „#” za brojač. „####” vraća 0001, slijedeće snimanje bit će 0002. Browse Pretraži Saver Settings Postavke spremanja Capture save location Mjesto spremanja snimke Default Standardno Factor Faktor Save Quality Kvaliteta spremanja Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. Zadaj 0 za dobivanje male komprimirane datoteke, 100 za velike nekomprimirane datoteke. Neki formati slika ne podržavaju cijeli raspon, JPEG ga podržava. ScriptUploaderSettings Copy script output to clipboard Kopiraj rezultat skripta u međuspremnik Script: Skripta: Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. Staza do skripta koji se poziva za prijenos. Tijekom prijenosa pozvat će se skripta sa stazom do privremene png datoteke kao jedan argument. Browse Pretraži Script Uploader Prijenos skriptom Select Upload Script Odaberi skripta za prenošenje Stop when upload script writes to StdErr Prekini kad skripta prijenosa piše u standardnu grešku (StdErr) Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. Označava prijenos kao neuspio, kad skripta piše u standardnu grešku (StdErr). Bez ove postavke greške u skriptu neće se primijetiti. Filter: Filtar: RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. RegEx (regularni) izraz. Kopiraj u međuspremnik samo ono što se poklapa s RegEx izrazom. Ako se izostavi, kopira se sve. SettingsDialog Settings Postavke OK U redu Cancel Prekini Image Grabber Snimanje slika Imgur Uploader Prijenos za Imgur Application Program Annotator Komentari HotKeys Tipkovnički prečaci Uploader Prijenos Script Uploader Skripta za prijenos Saver Spremanje Stickers Naljepnice Snipping Area Područje izrezivanja Tray Icon Ikona u programskoj traci Watermark Vodeni žig Actions Radnje SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Promijeni veličinu pravokutnog odabira pomoću ručki ili ga premjesti povlačenjem odabira. Use arrow keys to move the selection. Za premještanje odabira koristi tipke sa strelicama. Use arrow keys while pressing CTRL to move top left handle. Za micanje gornje lijeve ručke pritisni tipku CTRL i koristi tipke sa strelicama. Use arrow keys while pressing ALT to move bottom right handle. Za micanje donje desne ručke pritisni tipku ALT i koristi tipke sa strelicama. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. Potvrdi odabir pomoću tipke ENTER/RETURN ili prekini pomoću tipke ESC. This message can be disabled via settings. Ova se poruka može deaktivirati u postavkama. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Za biranje pravokutnog područja pritisni-i-povuci miša ili pritisni ESC za prekid. Hold CTRL pressed to resize selection after selecting. Za mijenjanje veličine odabira pritisni tipku CTRL i drži je pritisnutom. Hold CTRL pressed to prevent resizing after selecting. Za sprečavanje mijenjanja veličine odabira pritisni tipku CTRL i drži je pritisnutom. Operation will be canceled after 60 sec when no selection made. Operacija će se prekinuti nakon 60 sekundi, ako se ništa ne odabere. This message can be disabled via settings. Ova se poruka može deaktivirati u postavkama. SnippingAreaSettings Freeze Image while snipping Zamrzni sliku tijekom izrezivanja When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. Kad je aktivirano, zamrznut će pozadinu tijekom biranja pravokutnog područja. Također mijenja trajanje zadrške prilikom snimanja ekrana. Kad je aktivirano, zadrška se događa prije prikazivanja područja izrezivanja. Kad deaktivirano, zadrška se događa nakon prikazivanja područja izrezivanja. Ova je funkcija uvijek deaktivirana za Wayland, a uvijek aktivirana za MacOS. Show magnifying glass on snipping area Pokaži povećalo u području izrezivanja Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. Pokaži povećalo koje povećava prikaz slike pozadine. Ova opcija radi samo, kad je „Zamrzni sliku tijekom izrezivanja” aktivirano. Show Snipping Area rulers Pokaži ravnala za područje izrezivanja Horizontal and vertical lines going from desktop edges to cursor on snipping area. Vodoravne i okomite crte, koje se protežu od rubova radne površine do pokazivača u području izrezivanja. Show Snipping Area position and size info Pokaži podatke ploložaja i veličine područja izrezivanja When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. Kad se lijeva tipka miša ne pritisne, prikazuje se položaj. Kad se pritisne, veličina odabranog područja prikazuje se lijevo iznad snimljenog područja. Allow resizing rect area selection by default Standardno dozvoli mijenjanje veličine pravokutnog područja When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. Kad je aktivirano, nakon biranja pravokutnog područja dozvoli mijenjanje veličine odabira. Promjena veličine odabira može se potvrditi pritiskom tipke return. Show Snipping Area info text Pokaži tekst informacija područja izrezivanja Snipping Area cursor color Boja pokazivača za označivanje područja izrezivanja Sets the color of the snipping area cursor. Postavlja boju pokazivača za označivanje područja izrezivanja. Snipping Area cursor thickness Debljina pokazivača za označavanje područja izrezivanja Sets the thickness of the snipping area cursor. Postavlja debljinu pokazivača za označivanje područja izrezivanja. Snipping Area Područje izrezivanja Snipping Area adorner color Ukrasna boja područja izrezivanja Sets the color of all adorner elements on the snipping area. Postavlja boju svih ukrasnih elemenata u području izrezivanja. Snipping Area Transparency Prozirnost područja izrezivanja Alpha for not selected region on snipping area. Smaller number is more transparent. Prozirnost za neodabrano područje u području izrezivanja. Manji broj znači veću prozirnost. StickerSettings Up Gore Down Dolje Use Default Stickers Koristi standardne naljepnice Sticker Settings Postavke naljepnica Vector Image Files (*.svg) Datoteke vektorskih slika (*.svg) Add Dodaj Remove Ukloni Add Stickers Dodaj naljepnice TrayIcon Show Editor Prikaži uređivač TrayIconSettings Use Tray Icon Koristi ikonu u programskoj traci When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. Kad je aktivirano, dodaje ikonu za programsku traku u traku zadataka, ako OS Windows Manager to podržava. Promjena zahtijeva ponovno pokretanje programa. Minimize to Tray Smanji u programsku traku Start Minimized to Tray Pokreni smanjeno u programskoj traci Close to Tray Zatvori u programskoj traci Show Editor Prikaži uređivač Capture Snimi Default Tray Icon action Standardna radnja ikone u programskoj traci Default Action that is triggered by left clicking the tray icon. Standardna radnja koja se izvršava pri pritiskanju ikone u programskoj traci. Tray Icon Settings Postavke ikone u programskoj traci Display Tray icon notifications Prikaži obavijesti u programskoj traci Use platform specific notification service Koristi uslugu obavještavanja platforme When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. Kad je aktivirano, pokušat će koristiti uslugu obavještavanja platforme kad postoji. Zahtijeva ponovno pokretanje kako bi se promjena primijenila. UpdateWatermarkOperation Select Image Odaberi sliku Images Slike All Files Sve datoteke UploadOperation Upload Script Required Potrebna je skripta za prijenos Please add an upload script via Options > Settings > Upload Script Dodaj skripta za prijenos putem Opcije > Postavke > Skripta za prijenos Capture Upload Prijenos snimke You are about to upload the image to an external destination, do you want to proceed? Prenijet ćeš sliku na vanjsko odredište. Želiš li nastaviti? UploaderSettings Ask for confirmation before uploading Zatraži potvrdu prije prenošenja Uploader Type: Vrsta prijenosa: Imgur Imgur Script Skripta Uploader Prijenos VersionTab Version Verzija Build Izgradnja Using: Koristi: WatermarkSettings Watermark Image Slika vodenog žiga Update Aktualiziraj Rotate Watermark Okreni vodeni žig When enabled, Watermark will be added with a rotation of 45° Kad je aktivirano, dodat će se vodeni žig okrenut za 45 stupnjeva Watermark Settings Postavke vodenog žiga ksnip-1.9.2/translations/ksnip_hu.ts000066400000000000000000001545321414701001100175570ustar00rootroot00000000000000 AboutDialog About Névjegy About Névjegy Version Verzió Author Szerző Close Bezár Donate Támogatás Contact AboutTab License: Licenc Screenshot and Annotation Tool ActionSettingTab Name Név Shortcut Parancsikon Clear Töröl Take Capture Kép készítése Include Cursor Kurzort is Delay Késleltetés s mp Capture Mode Képkészítési mód Show image in Pin Window Kép mutatása a rögzített ablakban Copy image to Clipboard kép másolása vágólapra Upload image Kép feltöltése Open image parent directory Kép megnyitása szülőkönyvtárban Save image Kép mentése Hide Main Window ActionsSettings Add Hozzáad Actions Settings Műveletek beállításai Action Művelet AddWatermarkOperation Watermark Image Required Vízjel-kép szükséges Please add a Watermark Image via Options > Settings > Annotator > Update Addj vízjelet-képet az Opciók> Beállítások> Kiemelés> Frissítés menüponttal AnnotationSettings Smooth Painter Paths Sima festő útvonal When enabled smooths out pen and marker paths after finished drawing. Ha engedélyezve van, kiüríti a tollat és a jelölő útvonalakat a rajz befejezése után. Smooth Factor Simasági faktor Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. A simasági tényező növekedésével csökken a toll és a jelölő pontossága, de simábbá teszi. Annotator Settings Kiemelés beállításai Remember annotation tool selection and load on startup Switch to Select Tool after drawing Item Number Tool Seed change updates all Number Items Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. Canvas Color Default Canvas background color for annotation area. Changing color affects only new annotation areas. Select Item after drawing With this option enabled the item gets selected after being created, allowing changing settings. ApplicationSettings Capture screenshot at startup with default mode Képernyő mentése program indításkor az alapértelmezett módon Application Style Alkalmazás stílusa Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. Beállítja az alkalmazás stílusát, amely meghatározza a grafikus felhasználói felület megjelenését és hangulatát. A módosításhoz érvényesítéséhez a program újraindítása szükséges. Application Settings Alkalmazás beállítások Automatically copy new captures to clipboard Az új képernyőmentéseket automatikusan másolja a vágólapra Use Tabs Change requires restart. Run ksnip as single instance Hide Tabbar when only one Tab is used. Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. Remember Main Window position on move and load on startup Auto hide Tabs Auto hide Docks On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. Auto resize to content Automatically resize Main Window to fit content image. AuthorTab Contributors: Közreműködők: Spanish Translation Spanyol fordítás Dutch Translation Holland fordítás Russian Translation Orosz fordítás Norwegian Bokmål Translation Norvég fordítás French Translation Francia fordítás Polish Translation Lengyel fordítás Snap & Flatpak Support The Authors: CanDiscardOperation Warning - Figyelem - The capture %1%2%3 has been modified. Do you want to save it? CaptureModePicker New Új Draw a rectangular area with your mouse Rajzolj (kijelölő) területet az egérrel Capture full screen including all monitors A teljes képernyő rögzítése, beleértve az összes monitort Capture screen where the mouse is located Aktuális képernyő rögzítése, ahol az egér található Capture window that currently has focus Aktív ablak rögzítése, ahol a fókusz van Capture that is currently under the mouse cursor Az egérmutató alatt lévő ablak rögzítése Capture a screenshot of the last selected rectangular area Képernyőkép rögzítése a legutoljára használt kijelölés szerint Uses the screenshot Portal for taking screenshot ContactTab Community If you have general questions, ideas or just want to talk about ksnip, please join our server. Bug Reports Please use Kérlek használd to report bugs. a hiba jelentéséhez. CopyAsDataUriOperation Failed to copy to clipboard Failed to copy to clipboard as base64 encoded image. Copied to clipboard Copied to clipboard as base64 encoded image. DeleteImageOperation Delete Image The item '%1' will be deleted. Do you want to continue? DonateTab here ide Also possible, Lehetséges Donations are always welcome Az adományokat mindig szívesen fogadjuk Donation Become a GitHub Sponsor ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. EnumTranslator Rectangular Area Terület Last Rectangular Area Legutoljára használt kijelölés Full Screen (All Monitors) Teljes képernyő (minden monitor) Current Screen Aktuális képernyő Active Window Aktív ablak Window Under Cursor Kurzor alatti ablak Screenshot Portal HandleUploadResultOperation Upload Successful Sikeres feltöltés Upload script finished successfully. Uploaded to Feltöltés ide Unable to save temporary image for upload. Unable to start process, check path and permissions. Process crashed Process timed out. Process read error. Process write error. Web error, check console output. Unknown process error. Upload Failed Script wrote to StdErr. HotKeySettings Enable Global HotKeys Globális gyorsbillentyűk bekapcsolása Capture Rect Area Kijelölt terület rögzítése Capture Full Screen Teljes képernyő rögzítése Capture current Screen Aktuális képernyő rögzítése Capture active Window Aktív ablak rögzítése Capture Window under Cursor Kurzor alatti ablak rögzítése Global HotKeys Globális gyorsbillentyűk Capture Last Rect Area Legutoljára használt kijelölés szerinti rögzítés Clear Töröl Capture using Portal HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. ImageGrabberSettings Capture mouse cursor on screenshot Egérkurzor rögzítése a képernyőképen Should mouse cursor be visible on screenshots. Az egérkurzor látszódni fog a képernyőképen. Image Grabber Képlopás Force Generic Wayland Screenshot Scale Generic Wayland Screenshots Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. Show Main Window after capturing screenshot Hide Main Window during screenshot Hide Main Window when capturing a new screenshot. Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. ImgurHistoryDialog Imgur History Imgur előznény Close Bezár Time Stamp Idő bélyegző Link Link Delete Link Link törlése ImgurUploader Upload to imgur.com finished! Az imgur.com-ra való feltöltés befejeződött! Received new token, trying upload again… Új azonosító, próbáld meg újra feltölteni… Imgur token has expired, requesting new token… Az Imgur azonosító lejárt, igényelj egy újat… ImgurUploaderSettings Force anonymous upload Névtelen feltöltés kényszerítése Always copy Imgur link to clipboard Mindig másolja az Imgur linket a vágólapra Client ID Ügyfél ID Client Secret Ügyfél titkosító PIN PIN Enter imgur Pin which will be exchanged for a token. Írd be az imgur Pin kódot, ami egy azonosítóra lesz cserélve. Get PIN PIN beszerzése Get Token Azonosító beszerzése Imgur History Imgur előzmény Imgur Uploader Imgur feltöltő Username Felhasználónév Waiting for imgur.com… Várakozás az imgur.com-ra… Imgur.com token successfully updated. imgur.com azonosító sikeresen feltöltve. Imgur.com token update error. imgur.com azonosító feltöltésekor hiba. After uploading open Imgur link in default browser imgur link megnyitása a böngészőben, feltöltés után Link directly to image Közvetlen link a képhez Base Url: Base url that will be used for communication with Imgur. Changing requires restart. Clear Token LoadImageFromFileOperation Unable to open image Unable to open image from path %1 MainToolBar New Új Delay in seconds between triggering and capturing screenshot. Késleltés a képernyőkép rögzítése előtt másodpercben megadva. s mp Save Mentés Save Screen Capture to file system Képernyőkép mentés a rendszerre Copy Másolás Copy Screen Capture to clipboard Képernyőkép másolása a vágólapra Tools Eszközök Undo Visszavonás Redo Megismételés Crop körbevágás Crop Screen Capture Képernyőkép körbevágása MainWindow Unsaved Mentetlen Upload Feltöltés Print Nyomtatás Opens printer dialog and provide option to print image Megnyitja a nyomtató párbeszédpanelt, és lehetőséget biztosít a kép kinyomtatására Print Preview Nyomtatási előnézet Opens Print Preview dialog where the image orientation can be changed Megnyitja a Nyomtatási előnézet párbeszédpanelt, ahol a kép tájolása megváltoztatható Scale Lépték Quit Kilépés Settings Beállítások &About Névjegy Open Megnyitás &Edit Szerkesztés &Options Opciók &Help Súgó Image Files (*.png *.jpg *.bmp) Képfájlok (*.png *.jpg *.bmp) Add Watermark Vízjel hozzáadása Add Watermark to captured image. Multiple watermarks can be added. Vízjel hozzáadása a rögzített képhez. Töbszörös vízjelezés is lehetséges. &File Fájl Unable to show image Nem lehet a képet megjeleníteni Save As... Mentés mint... Paste Beillesztés Paste Embedded Beágyazott beillesztés Pin Pin screenshot to foreground in frameless window No image provided but one was expected. Copy Path Open Directory &View Delete Rename Open Images Show Docks Hide Docks Copy as data URI Open &Recent Modify Canvas Upload triggerCapture to external source Copy triggerCapture to system clipboard Scale Image Rotate Rotate Image MultiCaptureHandler Save Mentés Save As Mentés másként Open Directory Copy Másolás Copy Path Delete Rename NewCaptureNameProvider Capture Képlopás PinWindow Close Bezár Close Other Close All PinWindowHandler Pin Window %1 RenameOperation Image Renamed Successfully renamed image to Image Rename Failed Failed to rename image to Rename image New filename: SaveOperation Save As Mentés másként Images Képek All Files Minden fájl Image Saved Kép mentve Saving Image Failed Kép mentése nem sikerült Saved to Mentés helye Failed to save image to Kép mentése nem sikerült ide SaverSettings Automatically save new captures to default location Az új képernyőmentéseket automatikusan mentse az alapértelmezett helyre Prompt to save before discarding unsaved changes A mentettlen módosítások elvetése előtt kérdezzen rá a mentésre Remember last Save Directory When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. Capture save location and filename Mentés helye és fájlneve Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. Browse Tallózás Saver Settings Capture save location Rögzített kép mentésének helye Default Factor Save Quality Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. ScriptUploaderSettings Copy script output to clipboard Script: Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. Browse Tallózás Script Uploader Select Upload Script Stop when upload script writes to StdErr Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. Filter: RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. SettingsDialog Settings Beállítások OK OK Cancel Mégse Image Grabber Képfogó Imgur Uploader Imgur feltöltő Application Alkalmazás Annotator Kiemelő HotKeys Gyorsbillentyűk Uploader Script Uploader Saver Stickers Snipping Area Tray Icon Watermark Actions SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Use arrow keys to move the selection. Use arrow keys while pressing CTRL to move top left handle. Use arrow keys while pressing ALT to move bottom right handle. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. This message can be disabled via settings. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Hold CTRL pressed to resize selection after selecting. Hold CTRL pressed to prevent resizing after selecting. Operation will be canceled after 60 sec when no selection made. This message can be disabled via settings. SnippingAreaSettings Freeze Image while snipping Kép fagyasztása rögzítéskor When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. Show magnifying glass on snipping area Mutassa a nagyítót rögzítéskor Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. Mutasson a nagyítót, ami nagyítja a háttérképet. Ez az opció csak akkor működik, ha a 'Kép fagyasztása rögzítéskor' engedélyezve van. Show Snipping Area rulers Mutassa a vonalzót a rögzítés területén Horizontal and vertical lines going from desktop edges to cursor on snipping area. Vízszintes és függőleges vonalak az asztal széleitől a rögzítési területen lévő kurzorig. Show Snipping Area position and size info Mutassa a rögzítési terület helyét és méretét When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. Allow resizing rect area selection by default When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. Show Snipping Area info text Snipping Area cursor color Kurzor színe a rögzítés területén Sets the color of the snipping area cursor. Snipping Area cursor thickness Kurzor vastagsága a rögzítési területen Sets the thickness of the snipping area cursor. Snipping Area Snipping Area adorner color Sets the color of all adorner elements on the snipping area. Snipping Area Transparency Alpha for not selected region on snipping area. Smaller number is more transparent. StickerSettings Up Down Use Default Stickers Sticker Settings Vector Image Files (*.svg) Add Hozzáad Remove Add Stickers TrayIcon Show Editor Szerkesztő mutatása TrayIconSettings Use Tray Icon Tálcaikon használata When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. Ha engedélyezve van, a tálcaikon rákerül a tálcára, ha az oprenszer ablakkezelője támogatja ezt a funkciót. A változtatás érvenyesítéséhez újra kell indítani a programot. Minimize to Tray Kicsinyítés a tálcára Start Minimized to Tray Close to Tray Bezáráskor lehelyezés a tálcára Show Editor Szerkesztő mutatása Capture Képlopás Default Tray Icon action Default Action that is triggered by left clicking the tray icon. Tray Icon Settings Display Tray icon notifications Use platform specific notification service When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. UpdateWatermarkOperation Select Image Kép kiválasztása Images Képek All Files Minden fájl UploadOperation Upload Script Required Please add an upload script via Options > Settings > Upload Script Capture Upload You are about to upload the image to an external destination, do you want to proceed? UploaderSettings Ask for confirmation before uploading Megerősítés kérése feltöltés előtt Uploader Type: Imgur Script Uploader VersionTab Version Verzió Build build Using: Felhasználó: WatermarkSettings Watermark Image Vízjel-kép Update Frissítés Rotate Watermark Vízjel forgatása When enabled, Watermark will be added with a rotation of 45° Ha engedélyezve van, a vízjel 45°-kal elforgatva lesz hozzáadva a képhez Watermark Settings Vízjel beállítások ksnip-1.9.2/translations/ksnip_id.ts000066400000000000000000001522411414701001100175320ustar00rootroot00000000000000 AboutDialog About Tentang About Tentang Version Versi Author Penulis Close Tutup Donate Donasi Contact Kontak AboutTab License: Lisensi: Screenshot and Annotation Tool Alat Tangkapan layar dan Anotasi ActionSettingTab Name Nama Shortcut Pintasan Clear Bersihkan Take Capture Ambil Gambar Include Cursor Sertakan Kursor Delay Jeda s dtk Capture Mode Mode Tangkapan Show image in Pin Window Tampilkan gambar di Jendela Sematkan Copy image to Clipboard Salin gambar ke Papan klip Upload image Unggah gambar Open image parent directory Buka direktori induk gambar Save image Simpan gambar Hide Main Window Sembunyikan Jendela Utama ActionsSettings Add Tambah Actions Settings Pengaturan Tindakan Action Tindakan AddWatermarkOperation Watermark Image Required Gambar Watermark Diperlukan Please add a Watermark Image via Options > Settings > Annotator > Update Mohon tambahkan sebuah Gambar Watermark melalui Pilihan > Pengaturan > Annotator > Perbarui AnnotationSettings Smooth Painter Paths Haluskan Path Painter When enabled smooths out pen and marker paths after finished drawing. Jika diaktifkan, akan membuat halus path pena dan penanda setelah selesai menggambar. Smooth Factor Faktor Penghalusan Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. Menambah faktor penghalusan akan mengurangi akurasi untuk pena dan penanda, tetapi akan membuatnya lebih halus. Annotator Settings Pengaturan Annotator Remember annotation tool selection and load on startup Ingat pilihan alat anotasi dan muat pada saat mulai Switch to Select Tool after drawing Item Ubah ke Alat Seleksi setelah selesai menggambar Number Tool Seed change updates all Number Items Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. Canvas Color Warna Kanvas Default Canvas background color for annotation area. Changing color affects only new annotation areas. Warna latar belakang kanvas untuk area anotasi. Mengganti warna hanya memengaruhi area anotasi baru. Select Item after drawing Seleksi objek setelah selesai menggambar With this option enabled the item gets selected after being created, allowing changing settings. ApplicationSettings Capture screenshot at startup with default mode Tangkap layar pada startup dengan moda bawaan Application Style Gaya Aplikasi Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. Setelan gaya aplikasi yang menentukan tampilan GUI-nya. Perubahan ini membutuhkan ksnip ditutup dan buka lagi. Application Settings Pengaturan Aplikasi Automatically copy new captures to clipboard Use Tabs Change requires restart. Run ksnip as single instance Hide Tabbar when only one Tab is used. Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. Remember Main Window position on move and load on startup Auto hide Tabs Auto hide Docks On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. Auto resize to content Automatically resize Main Window to fit content image. AuthorTab Contributors: Kontributor: Spanish Translation Terjemahan Bahasa Spanyol Dutch Translation Terjemahan Bahasa Belanda Russian Translation Terjemahan Bahasa Rusia Norwegian Bokmål Translation Terjemahan Bahasa Bokmål Norwegia French Translation Terjemahan Bahasa Perancis Polish Translation Terjemahan Bahasa Polandia Snap & Flatpak Support The Authors: CanDiscardOperation Warning - Peringatan The capture %1%2%3 has been modified. Do you want to save it? CaptureModePicker New Buat Baru Draw a rectangular area with your mouse Buat area persegi dengan mouse anda Capture full screen including all monitors Tangkap layar penuh dalam semua monitor Capture screen where the mouse is located Tangkap layar dimana mouse sekarang berada Capture window that currently has focus Tangkap jendela yang sekarang sedang fokus Capture that is currently under the mouse cursor Tangkap jendela dimana kursor sedang berada Capture a screenshot of the last selected rectangular area Uses the screenshot Portal for taking screenshot ContactTab Community If you have general questions, ideas or just want to talk about ksnip, please join our server. Bug Reports Please use Mohon gunakan to report bugs. untuk melaporkan masalah. CopyAsDataUriOperation Failed to copy to clipboard Failed to copy to clipboard as base64 encoded image. Copied to clipboard Copied to clipboard as base64 encoded image. DeleteImageOperation Delete Image The item '%1' will be deleted. Do you want to continue? DonateTab here Also possible, Donations are always welcome Donation Become a GitHub Sponsor ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. EnumTranslator Rectangular Area Area Persegi Last Rectangular Area Full Screen (All Monitors) Layar Penuh (Seluruh Monitor) Current Screen Layar Sekarang Active Window Jendela Aktif Window Under Cursor Jendela Pada Kursor Screenshot Portal HandleUploadResultOperation Upload Successful Upload script finished successfully. Uploaded to Unable to save temporary image for upload. Unable to start process, check path and permissions. Process crashed Process timed out. Process read error. Process write error. Web error, check console output. Unknown process error. Upload Failed Script wrote to StdErr. HotKeySettings Enable Global HotKeys Capture Rect Area Capture Full Screen Capture current Screen Capture active Window Capture Window under Cursor Global HotKeys Capture Last Rect Area Clear Capture using Portal HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. ImageGrabberSettings Capture mouse cursor on screenshot Rekam juga kursor mouse pada hasil tangkapan Should mouse cursor be visible on screenshots. Apakah kursor mouse perlu ditampilkan pada hasil tangkapan. Image Grabber Penangkap Gambar Force Generic Wayland Screenshot Scale Generic Wayland Screenshots Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. Show Main Window after capturing screenshot Hide Main Window during screenshot Hide Main Window when capturing a new screenshot. Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. ImgurHistoryDialog Imgur History Riwayat imgur Close Tutup Time Stamp Cap Waktu Link Tautan Delete Link Hapus Tautan ImgurUploader Upload to imgur.com finished! Pengunggahan ke imgur,com sudah selesai! Received new token, trying upload again… Imgur token has expired, requesting new token… ImgurUploaderSettings Force anonymous upload Paksa unggah anonim Always copy Imgur link to clipboard Selalu salin alamat imgur ke clipboard Client ID ID Klien Client Secret Secret Klien PIN PIN Enter imgur Pin which will be exchanged for a token. Masukkan Pin imgur yang akan diubah menjadi token. Get PIN Dapatkan PIN Get Token Dapatkan Token Imgur History Riwayat imgur Imgur Uploader Pengunggah Imgur Username Nama user Waiting for imgur.com… Imgur.com token successfully updated. Token Imgur.com berhasil diperbarui. Imgur.com token update error. Ada kesalahan dalam pemutakhiran token imgur.com. After uploading open Imgur link in default browser Link directly to image Base Url: Base url that will be used for communication with Imgur. Changing requires restart. Clear Token LoadImageFromFileOperation Unable to open image Tidak dapat membuka gambar Unable to open image from path %1 Tidak dapat membuka gambar dari %1 MainToolBar New Baru Delay in seconds between triggering and capturing screenshot. Jeda antara pemicu dan perekaman gambar, dalam detik. s dtk Save Simpan Save Screen Capture to file system Simpan Hasil Tangkapan ke sistem file Copy Salin Copy Screen Capture to clipboard Salin Hasil Tangkapan ke clipboard Tools Alat-alat Undo Redo Crop Crop Crop Screen Capture Crop Tangkapan Layar MainWindow Unsaved Belum Disimpan Upload Unggah Print Cetak Opens printer dialog and provide option to print image Buat dialog pencetakan dan opsi untuk mencetak gambar Print Preview Tampilan Cetak Opens Print Preview dialog where the image orientation can be changed Buka dialog Tampilan Cetak dimana orientasi gambar bisa diubah Scale Skala Quit Tutup Program Settings Setelan &About Tent&ang Open Buka &Edit &Edit &Options &Opsi &Help Bantuan Image Files (*.png *.jpg *.bmp) File Gambar (*.png *.jpg *.bmp) Add Watermark Add Watermark to captured image. Multiple watermarks can be added. &File Unable to show image Save As... Paste Paste Embedded Pin Pin screenshot to foreground in frameless window No image provided but one was expected. Copy Path Open Directory &View Delete Rename Open Images Show Docks Hide Docks Copy as data URI Open &Recent Modify Canvas Upload triggerCapture to external source Copy triggerCapture to system clipboard Scale Image Rotate Putar Rotate Image Putar Gambar MultiCaptureHandler Save Simpan Save As Simpan Sebagai Open Directory Buka Direktori Copy Salin Copy Path Delete Hapus Rename Ubah nama NewCaptureNameProvider Capture PinWindow Close Tutup Close Other Tutup Lainnya Close All Tutup Semua PinWindowHandler Pin Window %1 RenameOperation Image Renamed Successfully renamed image to Image Rename Failed Failed to rename image to Rename image Ubah nama gambar New filename: Nama file baru: SaveOperation Save As Simpan Sebagai Images Gambar All Files Semua file Image Saved Gambar Disimpan Saving Image Failed Gagal Menyimpan Gambar Saved to Menyimpan ke Failed to save image to Gagal menyimpan gambar ke SaverSettings Automatically save new captures to default location Prompt to save before discarding unsaved changes Konfirmasi dulu sebelum mengabaikan perubahan yang belum disimpan Remember last Save Directory When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. Capture save location and filename Lokasi penyimpanan dan nama file hasil tangkapan Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. Browse Telusuri Saver Settings Capture save location Lokasi penyimpanan tangkapan Default Factor Faktor Save Quality Simpan Kualitas Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. ScriptUploaderSettings Copy script output to clipboard Script: Skrip: Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. Browse Telusuri Script Uploader Select Upload Script Stop when upload script writes to StdErr Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. Filter: RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. SettingsDialog Settings Setelan OK OK Cancel Batalkan Image Grabber Penangkap Gambar Imgur Uploader Pengunggah Imgur Application Aplikasi Annotator HotKeys Uploader Pengunggah Script Uploader Pengunggah Skrip Saver Stickers Snipping Area Tray Icon Watermark Actions Tindakan SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Use arrow keys to move the selection. Use arrow keys while pressing CTRL to move top left handle. Use arrow keys while pressing ALT to move bottom right handle. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. This message can be disabled via settings. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Hold CTRL pressed to resize selection after selecting. Hold CTRL pressed to prevent resizing after selecting. Operation will be canceled after 60 sec when no selection made. This message can be disabled via settings. SnippingAreaSettings Freeze Image while snipping Bekukan gambar saat memotong When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. Show magnifying glass on snipping area Tampilkan kaca pembesar pada area snipping Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. Menampilkan kaca pembesar yang akan membesarkan gambar latar belakang. Opsi ini hanya berlaku jika Bekukan Gambar saat snipping diaktifkan. Show Snipping Area rulers Tampilkan penggaris Area Snipping Horizontal and vertical lines going from desktop edges to cursor on snipping area. Garis vertikal dan horizontal dari pinggir desktop ke kursor pada area snipping. Show Snipping Area position and size info Tampilkan info posisi dan ukuran Area Snipping When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. Allow resizing rect area selection by default When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. Show Snipping Area info text Snipping Area cursor color Warna kursor Area Snipping Sets the color of the snipping area cursor. Snipping Area cursor thickness Tebal kursor Area Snipping Sets the thickness of the snipping area cursor. Snipping Area Area Pemotong Snipping Area adorner color Sets the color of all adorner elements on the snipping area. Snipping Area Transparency Alpha for not selected region on snipping area. Smaller number is more transparent. StickerSettings Up Atas Down Bawah Use Default Stickers Gunakan Stiker Default Sticker Settings Pengaturan Stiker Vector Image Files (*.svg) Add Tambah Remove Hapus Add Stickers Tambah Stiker TrayIcon Show Editor Tampilkan Editor TrayIconSettings Use Tray Icon Gunakan Ikon Baki When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. Minimize to Tray Start Minimized to Tray Close to Tray Show Editor Tampilkan Editor Capture Default Tray Icon action Default Action that is triggered by left clicking the tray icon. Tray Icon Settings Display Tray icon notifications Use platform specific notification service When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. UpdateWatermarkOperation Select Image Images Gambar All Files Semua file UploadOperation Upload Script Required Please add an upload script via Options > Settings > Upload Script Capture Upload You are about to upload the image to an external destination, do you want to proceed? UploaderSettings Ask for confirmation before uploading Tanya dulu sebelum mengunggah Uploader Type: Tipe Pengunggah: Imgur Imgur Script Skrip Uploader Pengunggah VersionTab Version Versi Build Build Using: Menggunakan: WatermarkSettings Watermark Image Update Rotate Watermark When enabled, Watermark will be added with a rotation of 45° Watermark Settings ksnip-1.9.2/translations/ksnip_it.ts000066400000000000000000001703211414701001100175510ustar00rootroot00000000000000 AboutDialog About Informazioni About Informazioni Version Versione Author Autore Close Chiudi Donate Dona Contact Contatto AboutTab License: Licenza: Screenshot and Annotation Tool Screenshot e Strumento di Annotazione ActionSettingTab Name Nome Shortcut Scorciatoia Clear Pulisci Take Capture Cattura Include Cursor Includi cursore Delay Ritardo s s Capture Mode Modalità di cattura Show image in Pin Window Mostra immagine nella finestra bloccata Copy image to Clipboard Copia l'immagine negli appunti Upload image Carica immagine Open image parent directory Apri la directory principale dell'immagine Save image Salva immagine Hide Main Window Nascondi finestra principale ActionsSettings Add Aggiungi Actions Settings Impostazioni delle azioni Action Azione AddWatermarkOperation Watermark Image Required Immagine filigrana necessaria Please add a Watermark Image via Options > Settings > Annotator > Update È necessario aggiungere un'immagine Filigrana tramite il menù Opzioni > Impostazioni > Annotatore > Aggiorna AnnotationSettings Smooth Painter Paths Smussa i tratti di pennello When enabled smooths out pen and marker paths after finished drawing. Se abilitato, smussa i tratti di penna e pennarello dopo che sono stati tracciati. Smooth Factor Fattore di smussamento Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. Aumentando il fattore di morbidezza diminuirà precisione per penna e pennarello ma li renderà più lisci. Annotator Settings Impostazioni Annotatore Remember annotation tool selection and load on startup Ricorda la selezione dello strumento di annotazione e carica all'avvio Switch to Select Tool after drawing Item Passa allo strumento Seleziona dopo aver disegnato l'oggetto Number Tool Seed change updates all Number Items Una modifica al numero di partenza aggiorna tutti gli elementi numerati Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. La disabilitazione di questa opzione provoca modifiche allo strumento del numero ed influenza solo i nuovi elementi ma non gli elementi esistenti. La disabilitazione di questa opzione consente di avere numeri duplicati. Canvas Color Colore della tela Default Canvas background color for annotation area. Changing color affects only new annotation areas. Colore di sfondo predefinito della tela per l'area di annotazione. La modifica del colore ha effetto solo sulle nuove aree di annotazione. Select Item after drawing Seleziona l'oggetto dopo il disegno With this option enabled the item gets selected after being created, allowing changing settings. Con questa opzione abilitata l'elemento viene selezionato dopo essere stato creato, consentendo la modifica delle impostazioni. ApplicationSettings Capture screenshot at startup with default mode Salva una schermata all'avvio usando la modalità di default Application Style Stile applicazione Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. Imposta lo stile dell'applicazione: ciò definisce l'aspetto estetico dell'interfaccia. Questa impostazione richiede il riavvio. Application Settings Impostazioni Applicazione Automatically copy new captures to clipboard Copia automaticamente le nuove catture negli appunti Use Tabs Usa l'interfaccia con le schede Change requires restart. La modifica richiede il riavvio. Run ksnip as single instance Usa ksnip in una sola finestra Hide Tabbar when only one Tab is used. Nascondi la barra delle schede quando viene utilizzata una sola scheda. Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. Questa opzione consente solo l'avvio di una singola istanza di ksnip. Se vengono lanciate altre istanze, passeranno il loro argomenti al primo prima di fermarsi. Devi ricominciare tutte le istanze per abilitare o disabilitare questa opzione. Remember Main Window position on move and load on startup Ricorda la posizione della finestra principale durante lo spostamento e il caricamento all'avvio Auto hide Tabs Nascondi automaticamente le schede Auto hide Docks Nascondi automaticamente i dock On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. All'avvio nascondi la barra degli strumenti e le impostazioni delle annotazioni. La visibilità dei dock può essere attivata o disattivata con il tasto Tab. Auto resize to content Ridimensiona automaticamente al contenuto Automatically resize Main Window to fit content image. Ridimensiona automaticamente la finestra principale per adattarla all'immagine del contenuto. AuthorTab Contributors: Collaboratori: Spanish Translation Traduzione in Spagnolo Dutch Translation Traduzione in Olandese Russian Translation Traduzione in Russo Norwegian Bokmål Translation Traduzione in Bokmål Norvegese French Translation Traduzione in Francese Polish Translation Traduzione in Polacco Snap & Flatpak Support Versione Snap & Flatpack The Authors: Gli autori: CanDiscardOperation Warning - Attenzione - The capture %1%2%3 has been modified. Do you want to save it? La cattura %1%2%3 è stata modificata Vuoi salvarla? CaptureModePicker New Nuovo Draw a rectangular area with your mouse Traccia un'area rettangolare con il mouse Capture a screenshot of the last selected rectangular area Cattura usando la ultima area rettangolare usata Capture full screen including all monitors Cattura di tutti gli schermi collegati Capture screen where the mouse is located Acquisisci lo schermo nella posizione del mouse Capture window that currently has focus Acquisisci la finestra attualmente in primo piano Capture that is currently under the mouse cursor Cattura ciò che si trova attualmente sotto il cursore del mouse Uses the screenshot Portal for taking screenshot Utilizza il portale screenshot per acquisire screenshot ContactTab Community Comunità If you have general questions, ideas or just want to talk about ksnip, Se hai domande generali, idee o vuoi semplicemente parlare di ksnip, please join our per favore unisciti al nostro server. server. Bug Reports Segnalazioni di bug Please use Si prega di utilizzare to report bugs. per segnalare bug. CopyAsDataUriOperation Failed to copy to clipboard Impossibile copiare negli appunti Failed to copy to clipboard as base64 encoded image. Impossibile copiare negli appunti come immagine codificata base64. Copied to clipboard Copiato negli appunti Copied to clipboard as base64 encoded image. Copiato negli appunti come immagine codificata base64. DeleteImageOperation Delete Image Elimina immagine The item '%1' will be deleted. Do you want to continue? L'elemento '%1' verrà eliminato. Vuoi continuare? DonateTab here qui Also possible, Anche possibile, Donations are always welcome Le donazioni sono sempre ben accette Donation Donazione Become a GitHub Sponsor Diventa uno sponsor GitHub ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. ksnip è un progetto software libero con copyleft no-profit e<br/>ha ancora alcuni costi che devono essere coperti,<br/>come i costi del dominio o i costi hardware per il supporto multipiattaforma. If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that Se vuoi aiutare o semplicemente<br/>apprezzi il lavoro svolto<br/>offri agli sviluppatori una birra o un caffè, puoi farlo EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. Aggiungi nuove azioni premendo il pulsante della scheda "Aggiungi". EnumTranslator Rectangular Area Area rettangolare Last Rectangular Area Ultima area rettangolare Full Screen (All Monitors) Schermo intero (tutti i monitor) Current Screen Schermo corrente Active Window Finestra attiva Window Under Cursor Finestra sotto il cursore Screenshot Portal Portale schermate HandleUploadResultOperation Upload Successful Il caricamento è andato a buon fine Upload script Carica script finished successfully. terminato con successo. Uploaded to Caricato su Unable to save temporary image for upload. Impossibile salvare l'immagine temporanea per il caricamento. Unable to start process, check path and permissions. Impossibile avviare il processo, controllare il percorso e le autorizzazioni. Process crashed Il processo si è interrotto Process timed out. Processo scaduto. Process read error. Errore in lettura del processo. Process write error. Errore in scrittura del processo. Web error, check console output. Errore Web, controlla l'output della console. Unknown process error. Errore di processo sconosciuto. Upload Failed Caricamento fallito Script wrote to StdErr. Lo script ha scritto su StdErr. HotKeySettings Enable Global HotKeys Abilita scorciatoie globali Capture Rect Area Acquisisci area rettangolare Capture Last Rect Area Acquisisci l'ultima area rettangolare Capture Full Screen Acquisisci l'intero schermo Capture current Screen Acquisisci lo Schermo attuale Capture active Window Acquisisci la finestra attiva Capture Window under Cursor Acquisisci la finestra sotto il Cursore Global HotKeys Scorciatoie Globali Clear Pulisci Capture using Portal Cattura usando il portale HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. I tasti di scelta rapida sono attualmente supportati solo per Windows e X11. La disabilitazione di questa opzione rende anche le scorciatoie di azione solo ksnip. ImageGrabberSettings Capture mouse cursor on screenshot Includi il cursore del mouse nell'acquisizione schermo Should mouse cursor be visible on screenshots. Il cursore del mouse dovrebbe essere visibile su screenshot. Image Grabber Acquisizione di immagini Force Generic Wayland Screenshot Forza screenshot Wayland generico Scale Generic Wayland Screenshots Ridimensiona gli screenshot generici di Wayland Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. Implementazioni generiche di Wayland che utilizzano XDG-DESKTOP-PORTAL gestiscono diversamente il ridimensionamento dello schermo. L'attivazione di questa opzione sarà determinare il ridimensionamento dello schermo corrente e applicarlo allo screenshot in ksnip. GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. GNOME e KDE Plasma supportano il proprio Wayland e gli screenshot generici di XDG-DESKTOP-PORTAL. Abilitare questa opzione forzerà KDE Plasma e GNOME per utilizzare gli screenshot di XDG-DESKTOP-PORTAL. La modifica di questa opzione richiede un riavvio di ksnip. Show Main Window after capturing screenshot Mostra la finestra principale dopo aver catturato lo screenshot Hide Main Window during screenshot Nascondi la finestra principale durante lo screenshot Hide Main Window when capturing a new screenshot. Nascondi la finestra principale durante l'acquisizione di un nuovo screenshot. Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. Mostra la finestra principale dopo aver catturato un nuovo screenshot quando la finestra principale era nascosta o ridotta a icona. ImgurHistoryDialog Imgur History Cronologia di Imgur Close Chiudi Time Stamp Data e ora Link Link Delete Link Cancella Link ImgurUploader Upload to imgur.com finished! Il caricamento su imgur.com è stato completato! Received new token, trying upload again… Ricevuto nuovo token,nuova prova di upload in corso… Imgur token has expired, requesting new token… Il token Imgur è scaduto, richiesta nuovo token in corso… ImgurUploaderSettings Force anonymous upload Forza caricamento anonimo After uploading open Imgur link in default browser Dopo aver caricato, apri il link Imgur nel browser predefinito Always copy Imgur link to clipboard Copia sempre il link Imgur negli Appunti Client ID ID Client Client Secret Client Secreto PIN PIN Enter imgur Pin which will be exchanged for a token. Inserisci il Pin imgur che verrà scambiato con un token. Get PIN Ottieni PIN Get Token Ottieni Token Imgur History Cronologia Imgur Imgur Uploader Carica Imgur Username Nome Utente Waiting for imgur.com… In attesa di imgur.com… Imgur.com token successfully updated. Token Imgur.com aggiornato correttamente. Imgur.com token update error. Errore di aggiornamento del token imgur.com. Link directly to image Link direttamente all'immagine Base Url: URL di base: Base url that will be used for communication with Imgur. Changing requires restart. URL di base che verrà utilizzato per la comunicazione con Imgur. La modifica richiede il riavvio. Clear Token Cancella token LoadImageFromFileOperation Unable to open image Impossibile aprire l'immagine Unable to open image from path %1 Impossibile aprire l'immagine dal percorso %1 MainToolBar New Nuovo Delay in seconds between triggering and capturing screenshot. Ritardo in secondi tra l'attivazione e cattura screenshot. s s Save Salva Save Screen Capture to file system Salva Cattura Schermo nel file system Copy Copia Copy Screen Capture to clipboard Copia Cattura Schermo negli Appunti Undo Annulla Redo Rifai Crop Ritaglia Crop Screen Capture Ritaglia Cattura Schermo Tools Strumenti MainWindow Unable to show image Impossibile mostrare l'immagine Unsaved Non Salvato Upload Carica Print Stampa Opens printer dialog and provide option to print image Apre la finestra di dialogo della stampante e fornisci l'opzione per stampare l'immagine Print Preview Anteprima di Stampa Opens Print Preview dialog where the image orientation can be changed Apre la finestra di dialogo Anteprima di stampa in cui è possibile modificare l'orientamento dell'immagine Scale Scala Add Watermark Aggiungi Filigrana Add Watermark to captured image. Multiple watermarks can be added. Aggiungi filigrana all'immagine acquisita. È possibile aggiungere più filigrane. Quit Esci Settings Impostazioni &About Informazioni Open Apri &File FIle &Edit Modifica &Options Opzioni &Help Aiuto Image Files (*.png *.jpg *.bmp) File immagine (*.png *.jpg *.bmp) Save As... Salva Come... Paste Incolla Paste Embedded Incollaggio Incorporato Pin Blocca Pin screenshot to foreground in frameless window Blocca lo screenshot in primo piano nella finestra senza cornice No image provided but one was expected. Nessuna immagine fornita ma ne era prevista una. Copy Path Copia percorso Open Directory Apri directory &View &Vista Delete Cancella Rename Rinomina Open Images Apri immagini Show Docks Mostra Dock Hide Docks Nascondi Dock Copy as data URI Copia come dati URI Open &Recent Apri &Recenti Modify Canvas Modifica tela Upload triggerCapture to external source Carica l'acquisizione del trigger su una fonte esterna Copy triggerCapture to system clipboard Copia la cattura del trigger negli appunti di sistema Scale Image Scala immagine Rotate Ruota Rotate Image Ruota immagine MultiCaptureHandler Save Salva Save As Salva Come Open Directory Apri directory Copy Copia Copy Path Copia percorso Delete Cancella Rename Rinomina NewCaptureNameProvider Capture Cattura PinWindow Close Chiudi Close Other Chiudi Altro Close All Chiudi Tutto PinWindowHandler Pin Window %1 Blocca Finestra %1 RenameOperation Image Renamed Immagine rinominata Successfully renamed image to Immagine rinominata con successo in Image Rename Failed Rinomina immagine non riuscita Failed to rename image to Impossibile rinominare l'immagine in Rename image Rinomina immagine New filename: Nuovo nome file: SaveOperation Save As Salva Come Images Immagini All Files Tutti i FIle Image Saved Immagine Salvata Saved to Salvato in Saving Image Failed Salvataggio Immagine Fallito Failed to save image to Salvataggio Immagine fallito in SaverSettings Automatically save new captures to default location Salva automaticamente le nuove acquisizioni nella posizione predefinita Prompt to save before discarding unsaved changes Richiedi di salvare prima di eliminare le modifiche non salvate Remember last Save Directory Ricorda l'ultima directory di salvataggio When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. Se abilitato, sovrascriverà la directory di salvataggio memorizzata nelle impostazioni con l'ultima directory di salvataggio, per ogni salvataggio. Capture save location and filename Directory di registrazione e nome del file Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. I formati supportati sono JPG, PNG e BMP. Se non viene fornito alcun formato, come impostazione predefinita verrà utilizzato PNG. Il nome del file può contenere i seguenti caratteri jolly: - $Y, $M, $D per la data, $h, $m, $s per l'ora o $T per l'ora in formato hhmmss. - Più # consecutivi per contatore. #### risulterà in 0001, la prossima acquisizione sarà 0002. Browse Sfoglia Saver Settings Impostazioni di risparmio Capture save location Cattura directory di registrazione Default Predefinito Factor Fattore Save Quality Qualità di registrazione Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. Specificare 0 per ottenere file compressi di piccole dimensioni, 100 per file non compressi di grandi dimensioni. Non tutti i formati di immagine supportano l'intera gamma, JPEG lo fa. ScriptUploaderSettings Copy script output to clipboard Copia l'output dello script negli appunti Script: Script: Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. Percorso per lo script che verrà chiamato per il caricamento. Durante il caricamento verrà chiamato lo script con il percorso di un file png temporaneo come singolo argomento. Browse Sfoglia Script Uploader Caricatore di script Select Upload Script Seleziona carica script Stop when upload script writes to StdErr Interrompi quando lo script di invio scrive su StdErr Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. Il caricamento verrà annotato come non riuscito se lo script ha scritto su StdErr. Se questa casella non è selezionata, gli errori di script passeranno inosservati. Filter: Filtro: RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. Espressione regolare (RegEx). Saranno solo le righe corrispondenti alla RegEx copiato negli appunti. Se non è definito alcun filtro, verranno copiate tutte le righe. SettingsDialog Settings Impostazioni OK OK Cancel Cancella Application Applicazione Image Grabber Acquisizione di immagini Imgur Uploader Carica su Imgur Annotator Annotatore HotKeys Tasti di scelta rapida Uploader Caricatore Script Uploader Caricatore di script Saver Registrazione Stickers Adesivi Snipping Area Area di taglio Tray Icon Icona della barra delle applicazioni Watermark Filigrana Actions Azioni SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Ridimensiona il rettangolo selezionato utilizzando le maniglie o spostalo trascinando la selezione. Use arrow keys to move the selection. Utilizzare i tasti freccia per spostare la selezione. Use arrow keys while pressing CTRL to move top left handle. Usa i tasti freccia mentre premi CTRL per spostare la maniglia in alto a sinistra. Use arrow keys while pressing ALT to move bottom right handle. Utilizzare i tasti freccia mentre si preme ALT per spostare la maniglia in basso a destra. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. Confermare la selezione premendo ENTER/RETURN o interrompere premendo ESC. This message can be disabled via settings. Questo messaggio può essere disabilitato tramite le impostazioni. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Fare clic e trascinare per selezionare un'area rettangolare o premere ESC per uscire. Hold CTRL pressed to resize selection after selecting. Tenere premuto CTRL per ridimensionare dopo la selezione. Hold CTRL pressed to prevent resizing after selecting. Tenere premuto CTRL per impedire il ridimensionamento dopo la selezione. Operation will be canceled after 60 sec when no selection made. L'operazione verrà annullata dopo 60 secondi in assenza di selezione. This message can be disabled via settings. Questo messaggio può essere disabilitato tramite le impostazioni. SnippingAreaSettings Freeze Image while snipping Blocca l'immagine durante l'acquisizione When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. Quando abilitato bloccherà lo sfondo mentre si seleziona una regione rettangolare. Cambia anche il comportamento degli screenshot ritardati, con questo opzione abilitata il ritardo si verifica prima che venga mostrata l'area di cattura e con l'opzione disabilitata il ritardo si verifica dopo la visualizzazione dell'area di cattura. Questa funzione è sempre disabilitata per Wayland e sempre abilitata per MacOs. Show magnifying glass on snipping area Mostra la lente d'ingrandimento sull'area di cattura Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. Mostra una lente d'ingrandimento che ingrandisce l'immagine di sfondo. Questa opzione funziona solo con 'Blocca immagine durante la cattura' abilitato. Show Snipping Area rulers Mostra righelli su area di cattura Horizontal and vertical lines going from desktop edges to cursor on snipping area. Mostra linee orizzontali e verticali dai bordi dello schermo al puntatore per facilitare l'inquadratura. Show Snipping Area position and size info Mostra le informazioni sulla posizione e sulla dimensione dell'area di cattura When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. Quando il tasto sinistro del mouse non viene premuto la posizione viene mostrato, quando si preme il pulsante del mouse, la dimensione dell'area selezionata è mostrata a sinistra e sopra dalla zona catturata. Allow resizing rect area selection by default Consenti il ridimensionamento della selezione dell'area retta per impostazione predefinita When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. Quando abilitato, dopo aver selezionato un area retta, consente di ridimensionare la selezione. Quando fatto il ridimensionamento la selezione può essere confermata premendo Invio. Show Snipping Area info text Mostra il testo delle informazioni sull'area di cattura Snipping Area cursor color Colore del cursore dell'area di cattura Sets the color of the snipping area cursor. Imposta il colore del cursore dell'area di cattura. Snipping Area cursor thickness Spessore cursore area di cattura Sets the thickness of the snipping area cursor. Imposta lo spessore del cursore dell'area di cattura. Snipping Area Area di cattura Snipping Area adorner color Colore ornamentale dell'area di cattura Sets the color of all adorner elements on the snipping area. Imposta il colore di tutti gli elementi ornamento sull'area di cattura. Snipping Area Transparency Trasparenza dell'area di cattura Alpha for not selected region on snipping area. Smaller number is more transparent. Alfa per la regione non selezionata nell'area di cattura. Il numero più piccolo è più trasparente. StickerSettings Up Su Down Giù Use Default Stickers Usa adesivi predefiniti Sticker Settings Impostazioni adesivo Vector Image Files (*.svg) File di immagini vettoriali (*.svg) Add Aggiungi Remove Rimuovi Add Stickers Aggiungi adesivi TrayIcon Show Editor Mostra editor TrayIconSettings Use Tray Icon Usa l'icona della barra delle applicazioni When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. Quando abilitato aggiungerà un'icona della barra delle applicazioni alla barra delle applicazioni se il gestore di finestre del sistema operativo lo supporta. La modifica richiede il riavvio. Minimize to Tray Riduci a icona nella barra delle applicazioni Start Minimized to Tray Inizia in miniatura nella barra delle applicazioni Close to Tray Vicino alla barra delle applicazioni Show Editor Mostra editor Capture Cattura Default Tray Icon action Azione predefinita dell'icona della barra delle applicazioni Default Action that is triggered by left clicking the tray icon. Azione predefinita che viene attivata facendo clic con il tasto sinistro sull'icona della barra delle applicazioni. Tray Icon Settings Impostazioni dell'icona della barra delle applicazioni Display Tray icon notifications Mostra notifiche dall'icona della barra degli strumenti Use platform specific notification service Utilizza il servizio di notifica specifico della piattaforma When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. Quando abilitato, proverà ad utilizzare la notifica specifica del servizio della piattaforma quando questa esiste. La modifica richiede il riavvio per avere effetto. UpdateWatermarkOperation Select Image Seleziona immagine Images Immagini All Files Tutti i FIle UploadOperation Upload Script Required È richiesto uno script di invio Please add an upload script via Options > Settings > Upload Script Aggiungi uno script di caricamento tramite Opzioni > Impostazioni > Carica script Capture Upload Cattura caricamento You are about to upload the image to an external destination, do you want to proceed? Stai per caricare l'immagine su una destinazione esterna, vuoi procedere? UploaderSettings Ask for confirmation before uploading Chiedi conferma prima di caricare Uploader Type: Tipo di caricamento: Imgur Imgur Script Script Uploader Caricamento VersionTab Version Versione Build Compilato Using: Utilizzando: WatermarkSettings Watermark Image Filigrana Immagine Update Aggiorna Rotate Watermark Ruota Filigrana When enabled, Watermark will be added with a rotation of 45° Se abilitato, la Filigrana verrà aggiunta con una rotazione di 45° Watermark Settings Impostazioni filigrana ksnip-1.9.2/translations/ksnip_ja.ts000066400000000000000000001660371414701001100175400ustar00rootroot00000000000000 AboutDialog About 情報: About 情報 Version バージョン Author 作者 Close 閉じる Donate 寄付 Contact AboutTab License: ライセンス: Screenshot and Annotation Tool ActionSettingTab Name Shortcut Clear 消去 Take Capture Include Cursor Delay s Capture Mode Show image in Pin Window Copy image to Clipboard Upload image Open image parent directory Save image Hide Main Window ActionsSettings Add 追加 Actions Settings Action AddWatermarkOperation Watermark Image Required ウォーターマーク画像が必要です Please add a Watermark Image via Options > Settings > Annotator > Update 「オプション」 > 「設定」 > 「注釈」 > 「更新」でウォーターマーク画像を追加してください AnnotationSettings Smooth Painter Paths パスの描画を滑らかにする When enabled smooths out pen and marker paths after finished drawing. 有効にすると、ペンツールやマーカーツールで 線を引き終わった時に、線を滑らかにします。 Smooth Factor 滑らか係数 Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. 滑らか係数を大きくするとペンツールやマーカー ツールの精度が落ち、より一層滑らかになります。 Annotator Settings 注釈設定 Remember annotation tool selection and load on startup 注釈ツールの選択を記憶して起動時に読み込みます Switch to Select Tool after drawing Item アイテムを描画したら選択ツールに切り替える Number Tool Seed change updates all Number Items Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. Canvas Color Default Canvas background color for annotation area. Changing color affects only new annotation areas. Select Item after drawing With this option enabled the item gets selected after being created, allowing changing settings. ApplicationSettings Capture screenshot at startup with default mode 起動時に既定のモードでスクリーンショットを撮る Application Style アプリケーションスタイル Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. GUI のルックアンドフィールを定義するアプリケーションスタイルを設定します。 この変更は ksnip を再起動すると有効になります。 Application Settings アプリケーション設定 Automatically copy new captures to clipboard 自動的に新しいキャプチャーをクリップボードにコピーする Use Tabs タブを使用する Change requires restart. 変更には再起動が必要です。 Run ksnip as single instance ksnip をシングルインスタンスとして実行する Hide Tabbar when only one Tab is used. タブが一つの時はタブバーを隠します。 Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. このオプションを有効にすると、実行できる ksnip のインスタンス は一つだけになり、他のインスタンスを起動すると起動済みのイン スタンスに引数を渡して終了するようになります。このオプション の変更には、すべてのインスタンスを終了する必要があります。 Remember Main Window position on move and load on startup メインウィンドウの位置を記憶して起動時に読み込む Auto hide Tabs Auto hide Docks On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. Auto resize to content Automatically resize Main Window to fit content image. AuthorTab Contributors: 貢献者: Spanish Translation スペイン語訳 Dutch Translation オランダ語訳 Russian Translation ロシア語訳 Norwegian Bokmål Translation ノルウェー語 (ブークモール) 訳 French Translation フランス語訳 Polish Translation ポーランド語訳 Snap & Flatpak Support Snap と Flatpak のサポート The Authors: CanDiscardOperation Warning - 警告 - The capture %1%2%3 has been modified. Do you want to save it? キャプチャー %1%2%3 は変更されています。 保存しますか? CaptureModePicker New 新規 Draw a rectangular area with your mouse マウスで四角く選択します Capture a screenshot of the last selected rectangular area 最近選択した範囲のスクリーンショットをキャプチャーします Capture full screen including all monitors すべてのモニターの全画面をキャプチャーします Capture screen where the mouse is located マウスカーソルがある画面をキャプチャーします Capture window that currently has focus 現在フォーカスがあるウィンドウをキャプチャーします Capture that is currently under the mouse cursor 現在マウスカーソルがあるウィンドウをキャプチャーします Uses the screenshot Portal for taking screenshot スクリーンショットの取得に Screenshot Portal を使用します ContactTab Community If you have general questions, ideas or just want to talk about ksnip, please join our server. Bug Reports Please use バグ報告は to report bugs. で受け付けています。 CopyAsDataUriOperation Failed to copy to clipboard Failed to copy to clipboard as base64 encoded image. Copied to clipboard Copied to clipboard as base64 encoded image. DeleteImageOperation Delete Image 画像を削除 The item '%1' will be deleted. Do you want to continue? '%1' を削除します。 続行しますか? DonateTab here こちらからお願いします Also possible, スポンサーになっていただける場合は Donations are always welcome 寄付はいつでも大歓迎です Donation 寄付 Become a GitHub Sponsor GitHub スポンサーになる ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. ksnip は非営利でコピーレフトの自由なソフトウェアプロジェクトですが、<br/>ドメインやクロスプラットフォームのサポートのためのハードウェアなどに<br/>費用がかかっています。 If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that 開発者をビールやコーヒーで支援していただける場合は EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. EnumTranslator Rectangular Area 選択範囲 Last Rectangular Area 最近の選択範囲 Full Screen (All Monitors) 全画面 (すべてのモニター) Current Screen 現在の画面 Active Window アクティブウィンドウ Window Under Cursor カーソルがあるウィンドウ Screenshot Portal Screenshot Portal HandleUploadResultOperation Upload Successful アップロードに成功しました Upload script アップロードスクリプト finished successfully. が正常に終了しました。 Uploaded to アップロード先: Unable to save temporary image for upload. アップロードするための一時画像を保存できません。 Unable to start process, check path and permissions. プロセスを起動できません。パスとパーミッションを確認してください。 Process crashed プロセスがクラッシュしました Process timed out. プロセスがタイムアウトしました。 Process read error. プロセスの読み取りエラーです。 Process write error. プロセスの書き込みエラーです。 Web error, check console output. ウェブのエラーです。コンソールの出力を確認してください。 Unknown process error. プロセスの不明なエラーです。 Upload Failed アップロードに失敗しました Script wrote to StdErr. スクリプトが StdErr に書き込みました。 HotKeySettings Enable Global HotKeys グローバルホットキーを有効にする Capture Rect Area 選択範囲をキャプチャー Capture Last Rect Area 最近選択した範囲をキャプチャー Capture Full Screen 全画面をキャプチャー Capture current Screen 現在の画面をキャプチャー Capture active Window アクティブウィンドウをキャプチャー Capture Window under Cursor カーソルがあるウィンドウをキャプチャー Global HotKeys グローバルホットキー Clear 消去 Capture using Portal Portal を使用してキャプチャー HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. ImageGrabberSettings Capture mouse cursor on screenshot マウスカーソルもキャプチャーする Should mouse cursor be visible on screenshots. スクリーンショットにマウスカーソルを 表示させたい場合は有効にしてください。 Image Grabber 画像取得 Force Generic Wayland Screenshot Scale Generic Wayland Screenshots Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. Show Main Window after capturing screenshot スクリーンショット撮影後にメインウィンドウを表示する Hide Main Window during screenshot スクリーンショット撮影中はメインウィンドウを隠す Hide Main Window when capturing a new screenshot. 新しいスクリーンショットを撮る時にメインウィンドウを非表示にします。 Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. ImgurHistoryDialog Imgur History Imgur の履歴 Close 閉じる Time Stamp タイムスタンプ Link リンク Delete Link 削除リンク ImgurUploader Upload to imgur.com finished! imgur.com へのアップロードが完了しました! Received new token, trying upload again… 新しいトークンを受け取りました。アップロードを再試行しています… Imgur token has expired, requesting new token… Imgur トークンの期限切れです。新しいトークンを要求しています… ImgurUploaderSettings Force anonymous upload 匿名アップロードを強制する After uploading open Imgur link in default browser アップロード後 Imgur のリンクを既定のブラウザーで開く Always copy Imgur link to clipboard 常に Imgur のリンクをクリップボードにコピーする Client ID Client ID Client Secret Client Secret PIN PIN Enter imgur Pin which will be exchanged for a token. トークン変換用の Imgur PIN を入力してください。 Get PIN PIN を取得 Get Token トークンを取得 Imgur History Imgur の履歴 Imgur Uploader Imgur アップローダー Username ユーザー名 Waiting for imgur.com… imgur.com を待っています… Imgur.com token successfully updated. Imgur.com トークンの更新に成功しました。 Imgur.com token update error. Imgur.com トークンの更新エラーです。 Link directly to image 画像に直接リンクする Base Url: ベース URL: Base url that will be used for communication with Imgur. Changing requires restart. Imgur との通信時に使用するベース URL です。 変更には再起動が必要です。 Clear Token LoadImageFromFileOperation Unable to open image Unable to open image from path %1 MainToolBar New 新規 Delay in seconds between triggering and capturing screenshot. スクリーンショット撮影までの 遅延秒数です。 s Save 保存 Save Screen Capture to file system スクリーンキャプチャーをファイルシステムに保存します Copy コピー Copy Screen Capture to clipboard スクリーンキャプチャーをクリップボードにコピーします Undo 元に戻す Redo やり直す Crop 切り抜く Crop Screen Capture スクリーンキャプチャーを切り抜きます Tools ツール MainWindow Unable to show image 画像を表示できません Unsaved 未保存 Upload アップロード Print 印刷 Opens printer dialog and provide option to print image 印刷ダイアログを開き画像印刷オプションを提供します Print Preview 印刷プレビュー Opens Print Preview dialog where the image orientation can be changed 画像の向きを変更できる印刷プレビューダイアログを開きます Scale 拡大縮小 Add Watermark ウォーターマークを追加 Add Watermark to captured image. Multiple watermarks can be added. キャプチャーした画像にウォーターマークを追加します。ウォーターマークは複数追加できます。 Quit 終了 Settings 設定 &About 情報(&A) Open 開く &File ファイル(&F) &Edit 編集(&E) &Options オプション(&O) &Help ヘルプ(&H) Image Files (*.png *.jpg *.bmp) 画像ファイル (*.png *.jpg *.bmp) Save As... 名前を付けて保存... Paste 貼り付け Paste Embedded 貼り付け (埋め込み) Pin ピン留め Pin screenshot to foreground in frameless window スクリーンショットを枠のないウィンドウ内に前景としてピン留めします No image provided but one was expected. Copy Path パスをコピー Open Directory ディレクトリを開く &View 表示(&V) Delete 削除 Rename 名前を変更 Open Images 画像を開く Show Docks Hide Docks Copy as data URI Open &Recent Modify Canvas Upload triggerCapture to external source Copy triggerCapture to system clipboard Scale Image Rotate Rotate Image MultiCaptureHandler Save 保存 Save As 名前を付けて保存 Open Directory ディレクトリを開く Copy コピー Copy Path パスをコピー Delete 削除 Rename 名前を変更 NewCaptureNameProvider Capture キャプチャー PinWindow Close 閉じる Close Other 他のを閉じる Close All すべて閉じる PinWindowHandler Pin Window %1 ピン留めウィンドウ %1 RenameOperation Image Renamed 画像の名前を変更しました Successfully renamed image to 次の名前に変更しました: Image Rename Failed 画像の名前を変更できませんでした Failed to rename image to 次の名前に変更できませんでした: Rename image 画像の名前を変更 New filename: 新しいファイル名: SaveOperation Save As 名前を付けて保存 Images 画像 All Files すべてのファイル Image Saved 画像を保存しました Saved to 保存先: Saving Image Failed 画像の保存に失敗しました Failed to save image to 失敗した保存先: SaverSettings Automatically save new captures to default location 自動的に新しいキャプチャーを既定の場所に保存する Prompt to save before discarding unsaved changes 未保存の変更を破棄する前に保存するか確認する Remember last Save Directory 最後に保存したディレクトリを記憶する When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. 有効にすると、保存するたびに 保存先の設定が上書きされます。 Capture save location and filename キャプチャーの保存場所とファイル名 Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. JPG、PNG、BMP をサポートしています。ファイル形式を指定しない場合は PNG になります。 ファイル名には次のワイルドカードを含めることができます: - 日付: $Y, $M, $D, 時刻: $h, $m, $s, hhmmss 形式の時刻: $T - 番号を表す連続した #。#### は 0001 に置換され、0002 のように増加します。 Browse 参照 Saver Settings 保存設定 Capture save location キャプチャーの保存場所 Default 既定 Factor 係数 Save Quality 保存品質 Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. ファイルを圧縮して小さくしたい場合は 0 を、大きくても非圧縮にしたい場合は 100 を指定してください。 JPEG 以外の画像形式は 0 から 100 までの範囲をサポートしていない場合があります。 ScriptUploaderSettings Copy script output to clipboard スクリプトの出力をクリップボードにコピーする Script: スクリプト: Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. アップロード用のスクリプトのパス。スクリプトは、アップロード中に 単一の一時ファイル (PNG) を引数として呼び出されます。 Browse 参照 Script Uploader スクリプトアップローダー Select Upload Script アップロードスクリプトを選択 Stop when upload script writes to StdErr アップロードスクリプトが StdErr に書き込む時に停止する Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. スクリプトが StdErr に書き込む時に、アップロードに失敗したとしてマークします。 この設定がないとスクリプト内のエラーに気付けません。 Filter: 絞り込み: RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. 正規表現の式です。この正規表現に一致するもののみクリップボードにコピーします。 省略した場合、すべてコピーします。 SettingsDialog Settings 設定 OK OK Cancel キャンセル Application アプリケーション Image Grabber 画像取得 Imgur Uploader Imgur アップローダー Annotator 注釈 HotKeys ホットキー Uploader アップローダー Script Uploader スクリプトアップローダー Saver 保存 Stickers ステッカー Snipping Area Tray Icon Watermark Actions SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Use arrow keys to move the selection. Use arrow keys while pressing CTRL to move top left handle. Use arrow keys while pressing ALT to move bottom right handle. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. This message can be disabled via settings. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Hold CTRL pressed to resize selection after selecting. Hold CTRL pressed to prevent resizing after selecting. Operation will be canceled after 60 sec when no selection made. This message can be disabled via settings. SnippingAreaSettings Freeze Image while snipping 範囲選択画面で画像を固定する When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. Show magnifying glass on snipping area 範囲選択画面で拡大鏡を表示する Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. 背景画像を拡大する拡大鏡を表示します。 このオプションは「範囲選択画面で画像を 固定する」が有効な場合のみ動作します。 Show Snipping Area rulers 範囲選択画面でルーラーを表示する Horizontal and vertical lines going from desktop edges to cursor on snipping area. マウスカーソルから画面端まで 横線と縦線を表示します。 Show Snipping Area position and size info 範囲選択画面でカーソル位置情報や選択サイズ情報を表示する When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. マウスの左ボタンを押していない場合は カーソルの位置情報が表示され、押して いる場合は選択範囲の長さが表示されま す。 Allow resizing rect area selection by default When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. 有効にすると、範囲選択後にそのサイズを変更 できるようになります。 サイズ変更後に Return キーを押すと確定します。 Show Snipping Area info text Snipping Area cursor color 範囲選択カーソルの色 Sets the color of the snipping area cursor. 範囲選択カーソルの色を設定します。 Snipping Area cursor thickness 範囲選択カーソルの太さ Sets the thickness of the snipping area cursor. 範囲選択カーソルの太さを設定します。 Snipping Area Snipping Area adorner color Sets the color of all adorner elements on the snipping area. Snipping Area Transparency Alpha for not selected region on snipping area. Smaller number is more transparent. StickerSettings Up 上へ Down 下へ Use Default Stickers 既定のステッカーを使用する Sticker Settings ステッカー設定 Vector Image Files (*.svg) ベクター画像ファイル (*.svg) Add 追加 Remove 削除 Add Stickers ステッカーを追加 TrayIcon Show Editor エディターを表示 TrayIconSettings Use Tray Icon トレイアイコンを使用する When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. 有効にすると、タスクバーにトレイアイコンを追加します (OS のウィンドウマネージャーがサポートしている場合)。 変更には再起動が必要です。 Minimize to Tray 最小化したらトレイに格納する Start Minimized to Tray トレイに最小化して起動する Close to Tray ウィンドウを閉じたらトレイに格納する Show Editor エディターを表示 Capture キャプチャー Default Tray Icon action Default Action that is triggered by left clicking the tray icon. Tray Icon Settings Display Tray icon notifications Use platform specific notification service When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. UpdateWatermarkOperation Select Image 画像を選択 Images 画像 All Files すべてのファイル UploadOperation Upload Script Required アップロードスクリプトが必要です Please add an upload script via Options > Settings > Upload Script 「オプション」 > 「設定」 > 「アップロードスクリプト」でアップロードスクリプトを追加してください Capture Upload キャプチャーをアップロード You are about to upload the image to an external destination, do you want to proceed? 外部の場所に画像をアップロードしようとしています。続行しますか? UploaderSettings Ask for confirmation before uploading アップロード前に確認する Uploader Type: アップローダーの種類: Imgur Imgur Script スクリプト Uploader アップローダー VersionTab Version バージョン Build ビルド Using: 使用: WatermarkSettings Watermark Image ウォーターマーク画像 Update 更新 Rotate Watermark ウォーターマークを傾ける When enabled, Watermark will be added with a rotation of 45° 有効にするとウォーターマークが 45° 傾いた状態になります Watermark Settings ksnip-1.9.2/translations/ksnip_ko.ts000066400000000000000000001475301414701001100175540ustar00rootroot00000000000000 AboutDialog About About Version Author 저자 Close 닫기 Donate 기부 Contact AboutTab License: 라이센스 Screenshot and Annotation Tool ActionSettingTab Name 이름 Shortcut 단축키 Clear Take Capture 캡처하기 Include Cursor 커서 포함 Delay s Capture Mode 캡처 모드 Show image in Pin Window 핀에 이미지 표시 Copy image to Clipboard 클립보드로 이미지 복사 Upload image 이미지 업로드 Open image parent directory Save image 이미지 저장 Hide Main Window ActionsSettings Add 추가 Actions Settings Action AddWatermarkOperation Watermark Image Required 워터마크 이미지 필요 Please add a Watermark Image via Options > Settings > Annotator > Update 옵션> 설정> 주석> 업데이트를 통해 워터 마크 이미지를 추가하십시오 AnnotationSettings Smooth Painter Paths When enabled smooths out pen and marker paths after finished drawing. Smooth Factor Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. Annotator Settings Remember annotation tool selection and load on startup Switch to Select Tool after drawing Item Number Tool Seed change updates all Number Items Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. Canvas Color Default Canvas background color for annotation area. Changing color affects only new annotation areas. Select Item after drawing With this option enabled the item gets selected after being created, allowing changing settings. ApplicationSettings Capture screenshot at startup with default mode Application Style Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. Application Settings Automatically copy new captures to clipboard Use Tabs Change requires restart. Run ksnip as single instance Hide Tabbar when only one Tab is used. Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. Remember Main Window position on move and load on startup Auto hide Tabs Auto hide Docks On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. Auto resize to content Automatically resize Main Window to fit content image. AuthorTab Contributors: Spanish Translation Dutch Translation Russian Translation Norwegian Bokmål Translation French Translation Polish Translation Snap & Flatpak Support The Authors: CanDiscardOperation Warning - The capture %1%2%3 has been modified. Do you want to save it? CaptureModePicker New Draw a rectangular area with your mouse Capture full screen including all monitors Capture screen where the mouse is located Capture window that currently has focus Capture that is currently under the mouse cursor Capture a screenshot of the last selected rectangular area Uses the screenshot Portal for taking screenshot ContactTab Community If you have general questions, ideas or just want to talk about ksnip, please join our server. Bug Reports Please use to report bugs. 버그리포트. CopyAsDataUriOperation Failed to copy to clipboard Failed to copy to clipboard as base64 encoded image. Copied to clipboard Copied to clipboard as base64 encoded image. DeleteImageOperation Delete Image The item '%1' will be deleted. Do you want to continue? DonateTab here Also possible, Donations are always welcome Donation Become a GitHub Sponsor ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. EnumTranslator Rectangular Area Last Rectangular Area Full Screen (All Monitors) Current Screen Active Window Window Under Cursor Screenshot Portal HandleUploadResultOperation Upload Successful Upload script finished successfully. Uploaded to Unable to save temporary image for upload. Unable to start process, check path and permissions. Process crashed Process timed out. Process read error. Process write error. Web error, check console output. Unknown process error. Upload Failed Script wrote to StdErr. HotKeySettings Enable Global HotKeys Capture Rect Area Capture Full Screen Capture current Screen Capture active Window Capture Window under Cursor Global HotKeys Capture Last Rect Area Clear Capture using Portal HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. ImageGrabberSettings Capture mouse cursor on screenshot Should mouse cursor be visible on screenshots. Image Grabber Force Generic Wayland Screenshot Scale Generic Wayland Screenshots Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. Show Main Window after capturing screenshot Hide Main Window during screenshot Hide Main Window when capturing a new screenshot. Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. ImgurHistoryDialog Imgur History Close 닫기 Time Stamp Link Delete Link ImgurUploader Upload to imgur.com finished! Received new token, trying upload again… Imgur token has expired, requesting new token… ImgurUploaderSettings Force anonymous upload Always copy Imgur link to clipboard Client ID Client Secret PIN Enter imgur Pin which will be exchanged for a token. Get PIN Get Token Imgur History Imgur Uploader Username Waiting for imgur.com… Imgur.com token successfully updated. Imgur.com token update error. After uploading open Imgur link in default browser Link directly to image Base Url: Base url that will be used for communication with Imgur. Changing requires restart. Clear Token LoadImageFromFileOperation Unable to open image Unable to open image from path %1 MainToolBar New Delay in seconds between triggering and capturing screenshot. s Save Save Screen Capture to file system Copy Copy Screen Capture to clipboard Tools Undo Redo Crop Crop Screen Capture MainWindow Unsaved Upload Print Opens printer dialog and provide option to print image Print Preview Opens Print Preview dialog where the image orientation can be changed Scale Quit Settings &About Open &Edit &Options &Help Image Files (*.png *.jpg *.bmp) Add Watermark Add Watermark to captured image. Multiple watermarks can be added. &File Unable to show image Save As... Paste Paste Embedded Pin Pin screenshot to foreground in frameless window No image provided but one was expected. Copy Path Open Directory &View Delete Rename Open Images Show Docks Hide Docks Copy as data URI Open &Recent Modify Canvas Upload triggerCapture to external source Copy triggerCapture to system clipboard Scale Image Rotate Rotate Image MultiCaptureHandler Save Save As Open Directory Copy Copy Path Delete Rename NewCaptureNameProvider Capture PinWindow Close 닫기 Close Other Close All PinWindowHandler Pin Window %1 RenameOperation Image Renamed Successfully renamed image to Image Rename Failed Failed to rename image to Rename image New filename: SaveOperation Save As Images All Files Image Saved Saving Image Failed Saved to Failed to save image to SaverSettings Automatically save new captures to default location Prompt to save before discarding unsaved changes Remember last Save Directory When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. Capture save location and filename Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. Browse Saver Settings Capture save location Default Factor Save Quality Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. ScriptUploaderSettings Copy script output to clipboard Script: Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. Browse Script Uploader Select Upload Script Stop when upload script writes to StdErr Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. Filter: RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. SettingsDialog Settings OK Cancel Image Grabber Imgur Uploader Application Annotator HotKeys Uploader Script Uploader Saver Stickers Snipping Area Tray Icon Watermark Actions SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Use arrow keys to move the selection. Use arrow keys while pressing CTRL to move top left handle. Use arrow keys while pressing ALT to move bottom right handle. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. This message can be disabled via settings. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Hold CTRL pressed to resize selection after selecting. Hold CTRL pressed to prevent resizing after selecting. Operation will be canceled after 60 sec when no selection made. This message can be disabled via settings. SnippingAreaSettings Freeze Image while snipping When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. Show magnifying glass on snipping area Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. Show Snipping Area rulers Horizontal and vertical lines going from desktop edges to cursor on snipping area. Show Snipping Area position and size info When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. Allow resizing rect area selection by default When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. Show Snipping Area info text Snipping Area cursor color Sets the color of the snipping area cursor. Snipping Area cursor thickness Sets the thickness of the snipping area cursor. Snipping Area Snipping Area adorner color Sets the color of all adorner elements on the snipping area. Snipping Area Transparency Alpha for not selected region on snipping area. Smaller number is more transparent. StickerSettings Up Down Use Default Stickers Sticker Settings Vector Image Files (*.svg) Add 추가 Remove Add Stickers TrayIcon Show Editor TrayIconSettings Use Tray Icon When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. Minimize to Tray Start Minimized to Tray Close to Tray Show Editor Capture Default Tray Icon action Default Action that is triggered by left clicking the tray icon. Tray Icon Settings Display Tray icon notifications Use platform specific notification service When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. UpdateWatermarkOperation Select Image Images All Files UploadOperation Upload Script Required Please add an upload script via Options > Settings > Upload Script Capture Upload You are about to upload the image to an external destination, do you want to proceed? UploaderSettings Ask for confirmation before uploading Uploader Type: Imgur Script Uploader VersionTab Version Build Using: WatermarkSettings Watermark Image Update Rotate Watermark When enabled, Watermark will be added with a rotation of 45° Watermark Settings ksnip-1.9.2/translations/ksnip_nl.ts000066400000000000000000001644101414701001100175500ustar00rootroot00000000000000 AboutDialog About Over About Over Version Versie Author Auteur Close Sluiten Donate Doneren Contact Contact opnemen AboutTab License: Licentie: Screenshot and Annotation Tool Schermfoto- en aantekeningsprogramma ActionSettingTab Name Naam Shortcut Sneltoets Clear Wissen Take Capture Schermfoto maken Include Cursor Cursor tonen op schermfoto Delay Wachttijd s s Capture Mode Modus Show image in Pin Window Schermfoto tonen op overzichtsvenster Copy image to Clipboard Schermfoto kopiëren naar klembord Upload image Schermfoto uploaden Open image parent directory Bijbehorende map openen Save image Schermfoto opslaan Hide Main Window Hoofdvenster verbergen ActionsSettings Add Toevoegen Actions Settings Actie-instellingen Action Actie AddWatermarkOperation Watermark Image Required Watermerkafbeelding vereist Please add a Watermark Image via Options > Settings > Annotator > Update Voeg een watermerkafbeelding toe via Opties --> Instellingen --> Aantekeningen --> Bijwerken AnnotationSettings Smooth Painter Paths Gladvegen When enabled smooths out pen and marker paths after finished drawing. Schakel dit in om pen- en markeerstrepen na afloop glad te vegen. Smooth Factor Gladveegfactor Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. Het verhogen van de factor vermindert de precisie, maar maakt pen- en markeerstrepen gladder. Annotator Settings Aantekeningsinstellingen Remember annotation tool selection and load on startup Aantekeningsgereedschap onthouden en laden na opstarten Switch to Select Tool after drawing Item Overschakelen naar selectiegereedschap na tekenen Number Tool Seed change updates all Number Items Getalwijziging werkt alle items met getallen bij Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. Schakel deze optie uit om alleen nieuwe items en niet ook bestaande items te wijzigen. Hierdoor zijn duplicaten mogelijk. Canvas Color Canvaskleur Default Canvas background color for annotation area. Changing color affects only new annotation areas. De standaard achtergrondkleur van het aantekeningsgebied. Dit is alleen van toepassing op nieuwe aantekeningsgebieden. Select Item after drawing Item selecteren na tekenen With this option enabled the item gets selected after being created, allowing changing settings. Schakel in om een item te selecteren nadat het getekend is, zodat de instellingen ervan kunnen worden aangepast. ApplicationSettings Capture screenshot at startup with default mode Schermfoto vastleggen met standaardmodus bij opstarten Application Style Programmastijl Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. Hiermee bepaal je het uiterlijk van het programma. Herstart ksnip om de wijzigingen toe te passen. Application Settings Programma-instellingen Automatically copy new captures to clipboard Nieuwe schermfoto's automatisch kopiëren naar klembord Use Tabs Tabbladen gebruiken Change requires restart. Herstart om de wijzigingen toe te passen. Run ksnip as single instance Slechts één ksnip-proces toestaan Hide Tabbar when only one Tab is used. Verberg de tabbladbalk als er één tabblad geopend is. Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. Schakel deze optie in om slechts één ksnip-proces toe te staan. Alle hierna gestarte processen geven opdrachten door aan het eerste en worden daarna afgesloten. Herstart alle ksnip-processen om deze wijziging toe te passen. Remember Main Window position on move and load on startup Automatisch opstarten met vorige schermpositie van hoofdvenster Auto hide Tabs Tabbladen automatisch verbergen Auto hide Docks Panelen automatisch verbergen On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. Verberg bij het opstarten de werkbalk- en aantekeningsinstellingen. Ze kunnen dan worden getoond/verborgen met de Tab-toets. Auto resize to content Automatisch aanpassen aan inhoud Automatically resize Main Window to fit content image. Pas de afmetingen van het hoofdvenster automatisch aan aan de schermfoto. AuthorTab Contributors: Bijdragers: Spanish Translation Spaanse vertaling Dutch Translation Nederlandse vertaling Russian Translation Russische vertaling Norwegian Bokmål Translation Noorse (Bokmål) vertaling French Translation Franse vertaling Polish Translation Poolse vertaling Snap & Flatpak Support Snap- en Flatpak-ondersteuning The Authors: De makers: CanDiscardOperation Warning - Waarschuwing - The capture %1%2%3 has been modified. Do you want to save it? De schermfoto, %1%2%3, is bewerkt. Wil je deze opslaan? CaptureModePicker New Nieuw Draw a rectangular area with your mouse Teken een rechthoekig gebied met je cursor Capture full screen including all monitors Leg het volledige scherm vast op alle beeldschermen Capture screen where the mouse is located Maak een schermfoto van het scherm waarop de cursor is Capture window that currently has focus Maak een schermfoto van het momenteel gefocuste venster Capture that is currently under the mouse cursor Maak een schermfoto van het venster onder de cursor Capture a screenshot of the last selected rectangular area Maak een schermfoto van het laatst geselecteerde rechthoekige gebied Uses the screenshot Portal for taking screenshot Gebruik het schermfotoportaal om een schermfoto te maken ContactTab Community Gemeenschap If you have general questions, ideas or just want to talk about ksnip, Als je algemene vragen of ideeën hebt of gewoon even wilt praten over ksnip, please join our breng dan eens een bezoekje aan onze server. server. Bug Reports Bugmeldingen Please use Gebruik to report bugs. om bugs te melden. CopyAsDataUriOperation Failed to copy to clipboard Kopiëren naar klembord mislukt Failed to copy to clipboard as base64 encoded image. Het kopiëren naar het klembord als base64-versleutelde schermfoto is mislukt. Copied to clipboard Gekopieerd naar klembord Copied to clipboard as base64 encoded image. Gekopieerd naar het klembord als base64-versleutelde schermfoto. DeleteImageOperation Delete Image Schermfoto verwijderen The item '%1' will be deleted. Do you want to continue? '%1' wordt verwijderd. Weet je zeker dat je wilt doorgaan? DonateTab here hier Also possible, Je kunt ook Donations are always welcome Donaties zijn altijd welkom Donation Doneren Become a GitHub Sponsor GitHub-sponsor worden ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. ksnip is een vrijesoftwareproject zonder winstoogmerk, maar<br/>maakt desondanks kosten,<br/>zoals domeinnaam- en hardwarekosten (voor platform-onafhankelijke ondersteuning). If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that Als je wilt helpen of gewoon<br/>je waardering voor ons harde werk wilt tonen,<br/>dan kun je ons trakteren op een biertje of kopje koffie EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. Voeg nieuwe acties toe door de knop 'Toevoegen' aan te klikken. EnumTranslator Rectangular Area Rechthoekig gebied Last Rectangular Area Vorig rechthoekig gebied Full Screen (All Monitors) Volledig scherm (alle beeldschermen) Current Screen Huidig scherm Active Window Actief venster Window Under Cursor Venster onder cursor Screenshot Portal Schermfotoportaal HandleUploadResultOperation Upload Successful Schermfoto geüpload Upload script Het uploadscript finished successfully. is uitgevoerd. Uploaded to Geüpload naar Unable to save temporary image for upload. De tijdelijke schermfoto, nodig voor het uploaden, kan niet worden opgeslagen. Unable to start process, check path and permissions. Het proces kan niet worden gestart. Controleer het pad en de toegangsrechten. Process crashed Het proces is gecrasht Process timed out. Het proces is verlopen. Process read error. Leesfout. Process write error. Schrijffout. Web error, check console output. Netwerkfout. Controleer de opdrachtvensteruitvoer. Unknown process error. Onbekende procesfout. Upload Failed Uploaden mislukt Script wrote to StdErr. Het script is weggeschreven naar StdErr. HotKeySettings Enable Global HotKeys Algemene sneltoetsen inschakelen Capture Rect Area Rechthoekig gebied vastleggen Capture Full Screen Volledig scherm vastleggen Capture current Screen Huidige scherm vastleggen Capture active Window Actief scherm vastleggen Capture Window under Cursor Venster onder cursor vastleggen Global HotKeys Algemene sneltoetsen Capture Last Rect Area Vorig rechthoekig gebied vastleggen Clear Wissen Capture using Portal Vastleggen met portaal HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. Sneltoetsen worden momenteel alleen ondersteund op Windows en X11. Schakel deze optie uit om de actiesneltoetsen alleen te gebruiken binnen KSnip. ImageGrabberSettings Capture mouse cursor on screenshot Cursor vastleggen bij maken van schermfoto Should mouse cursor be visible on screenshots. Of de cursor zichtbaar moet zijn op schermfoto's. Image Grabber Vastleggen Force Generic Wayland Screenshot Algemene Wayland-schermfoto afdwingen Scale Generic Wayland Screenshots Grootte van algemene Wayland-schermfoto's aanpassen Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. Algemene Wayland-implementaties die XDG DESKTOP PORTAL gebruiken, handelen beeldgroottes allemaal anders af. Met deze optie wordt de huidige beeldgrootte bepaald en toegepast op de schermfoto in ksnip. GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. GNOME en KDE Plasma ondersteunen zowel hun eigen Wayland-implementatie als die van de algemene XDG-DESKTOP-PORTAL. Schakel deze optie in om KDE Plasma en GNOME XDG-DESKTOP-PORTAL te laten gebruiken voor het maken van schermfoto's. Herstart ksnip om de wijziging toe te passen. Show Main Window after capturing screenshot Hoofdvenster tonen na maken van schermfoto Hide Main Window during screenshot Hoofdvenster verbergen tijdens maken van schermfoto Hide Main Window when capturing a new screenshot. Verberg het hoofdvenster tijdens het maken van een schermfoto. Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. Toon het hoofdvenster na het maken van een schermfoto als het hoofdvenster verborgen of geminimaliseerd is. ImgurHistoryDialog Imgur History Imgur-geschiedenis Close Sluiten Time Stamp Tijdstempel Link Link Delete Link Link verwijderen ImgurUploader Upload to imgur.com finished! De schermfoto is geüpload naar imgur.com! Received new token, trying upload again… Nieuwe toegangssleutel ontvangen; bezig met opnieuw uploaden… Imgur token has expired, requesting new token… Imgur-toegangssleutel verlopen; bezig met aanvragen van nieuwe… ImgurUploaderSettings Force anonymous upload Anoniem uploaden Always copy Imgur link to clipboard Imgur-link altijd kopiëren naar klembord Client ID Client-id Client Secret Client-geheim PIN Pincode Enter imgur Pin which will be exchanged for a token. Voer de imgur-pincode in. Deze wordt omgeruild voor een toegangssleutel. Get PIN Pincode ophalen Get Token Toegangssleutel ophalen Imgur History Imgur-geschiedenis Imgur Uploader Imgur-uploader Username Gebruikersnaam Waiting for imgur.com… Bezig met wachten op imgur.com… Imgur.com token successfully updated. De imgur.com-toegangssleutel is bijgewerkt. Imgur.com token update error. Fout tijdens bijwerken van imgur.com-toegangssleutel. After uploading open Imgur link in default browser Imgur-link na uploaden openen in standaardbrowser Link directly to image Directe link naar foto Base Url: Basis-url: Base url that will be used for communication with Imgur. Changing requires restart. De basis-url voor communicatie met Imgur. Herstart om de wijzigingen toe te passen. Clear Token Toegangssleutel wissen LoadImageFromFileOperation Unable to open image Kan schermfoto niet openen Unable to open image from path %1 De schermfoto uit het pad '%1' kan niet worden geopend MainToolBar New Nieuw Delay in seconds between triggering and capturing screenshot. De wachttijd tussen het aanroepen en vastleggen van een schermfoto, in seconden. s s Save Opslaan Save Screen Capture to file system Schermfoto lokaal opslaan Copy Kopiëren Copy Screen Capture to clipboard Schermfoto kopiëren naar klembord Tools Hulpmiddelen Undo Ongedaan maken Redo Opnieuw uitvoeren Crop Bijsnijden Crop Screen Capture Schermfoto bijsnijden MainWindow Unsaved Niet-opgeslagen Upload Uploaden Print Afdrukken Opens printer dialog and provide option to print image Afdrukvenster openen om de schermfoto af te drukken Print Preview Afdrukvoorbeeld Opens Print Preview dialog where the image orientation can be changed Afdrukvoorbeeld openen zodat de oriëntatie kan worden aangepast Scale Grootte aanpassen Quit Afsluiten Settings Instellingen &About &Over Open Openen &Edit B&ewerken &Options &Opties &Help &Hulp Image Files (*.png *.jpg *.bmp) Afbeeldingsbestanden (*.png *.jpg *.bmp) Add Watermark Watermerk toevoegen Add Watermark to captured image. Multiple watermarks can be added. Voorzie de schermfoto van een watermerk. Je kunt meerdere watermerken toevoegen. &File &Bestand Unable to show image Kan schermfoto niet tonen Save As... Opslaan als... Paste Plakken Paste Embedded Ingesloten plakken Pin Vastmaken Pin screenshot to foreground in frameless window Schermfoto vastmaken aan voorgrond van naadloos venster No image provided but one was expected. Er werd een foto verwacht, maar niks opgegeven. Copy Path Pad kopiëren Open Directory Map openen &View &Bekijken Delete Verwijderen Rename Naam wijzigen Open Images Schermfoto's openen Show Docks Panelen tonen Hide Docks Panelen verbergen Copy as data URI Kopiëren als gegevensuri Open &Recent &Recent bestand openen Modify Canvas Canvas aanpassen Upload triggerCapture to external source Schermfoto uploaden naar externe dienst Copy triggerCapture to system clipboard Schermfoto kopiëren naar klembord Scale Image Afmetingen aanpassen Rotate Draaien Rotate Image Foto draaien MultiCaptureHandler Save Opslaan Save As Opslaan als Open Directory Map openen Copy Kopiëren Copy Path Pad kopiëren Delete Verwijderen Rename Naam wijzigen NewCaptureNameProvider Capture Vastleggen PinWindow Close Sluiten Close Other Anderen sluiten Close All Alles sluiten PinWindowHandler Pin Window %1 Venster %1 vastmaken RenameOperation Image Renamed De fotonaam is gewijzigd Successfully renamed image to De nieuwe fotonaam is Image Rename Failed Naamswijziging mislukt Failed to rename image to De fotonaam kan niet worden gewijzigd in Rename image Fotonaam wijzigen New filename: Nieuwe bestandsnaam: SaveOperation Save As Opslaan als Images Schermfoto's All Files Alle bestanden Image Saved De schermfoto is opgeslagen Saving Image Failed Kan schermfoto niet opslaan Saved to Opgeslagen in Failed to save image to Kan schermfoto niet opslaan in SaverSettings Automatically save new captures to default location Nieuwe schermfoto's automatisch opslaan in standaardlocatie Prompt to save before discarding unsaved changes Altijd vragen om aanpassingen op te slaan Remember last Save Directory Recentste opslagmap onthouden When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. Schakel in om de opslagmap uit de instellingen te vervangen door de recentste opslagmap. Capture save location and filename Opslaglocatie en bestandsnaam Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. Ondersteunde bestandsformaten: JPG, PNG en BMP. Als je geen formaat opgeeft, dan wordt PNG gebruikt. De bestandsnaam mag de volgende jokertekens bevatten: - $Y, $M, $D voor datum, $h, $m, $s voor tijd, of $T voor tijd in de opmaak 'uummss'. - Gebruik # voor optelling. Voorbeeld: #### geeft 0001, met als opvolger 0002. Browse Bladeren Saver Settings Opslaginstellingen Capture save location Opslaglocatie Default Standaard Factor Factor Save Quality Opslagkwaliteit Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. Geef 0 op om bestanden met lage compressie te verkrijgen en 100 voor bestanden met hoge compressie. Niet alle formaten ondersteunen det volledige bereik, maar jpeg wel. ScriptUploaderSettings Copy script output to clipboard Scriptuitvoer kopiëren naar klembord Script: Script: Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. Pad naar het script dat moet worden gebruikt bij het uploaden. Tijdens het uploaden wordt dit script aangeroepen op het pad van de tijdelijke png. Browse Bladeren Script Uploader Script-uploader Select Upload Script Uploadscript kiezen Stop when upload script writes to StdErr Stoppen als uploadscript is weggeschreven naar StdErr Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. Markeert de upload als 'mislukt' als het script wordt weggeschreven naar StdErr. Schakel uit om scriptfouten te negeren. Filter: Filter: RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. Reguliere uitdrukking. Kopieer alleen tekst naar het klembord die hiermee overeenkomt. Sla over om álles te kopiëren. SettingsDialog Settings Instellingen OK Oké Cancel Annuleren Image Grabber Vastleggen Imgur Uploader Imgur-uploader Application Programma Annotator Aantekeningen HotKeys Sneltoetsen Uploader Uploader Script Uploader Script-uploader Saver Opslaan Stickers Stickers Snipping Area Vastleggebied Tray Icon Systeemvakpictogram Watermark Watermerk Actions Acties SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Pas de grootte van het selectiegebied aan door de handgrepen te verschuiven of de selectie te verplaatsen. Use arrow keys to move the selection. Gebruik de pijltjestoetsen om de selectie te verplaatsen. Use arrow keys while pressing CTRL to move top left handle. Houd de Ctrl-toets ingedrukt en druk op de pijltjestoetsen om het bovenste linkerhandvat te verplaatsen. Use arrow keys while pressing ALT to move bottom right handle. Houd de Alt-toets ingedrukt en druk op de pijltjestoetsen om het onderste rechterhandvat te verplaatsen. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. Bevestig de selectie door op Enter te drukken of breek af door op Esc te drukken. This message can be disabled via settings. Dit bericht kan in de instellingen worden uitgeschakeld. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Klik en sleep om een rechthoekig gebied te selecteren of druk op Esc om af te breken. Hold CTRL pressed to resize selection after selecting. Houd na het selecteren Ctrl ingedrukt om het gebied te verkleinen/vergroten. Hold CTRL pressed to prevent resizing after selecting. Houd na het selecteren Ctrl ingedrukt om vergroten/verkleinen te voorkomen. Operation will be canceled after 60 sec when no selection made. De handeling wordt na 60 sec. inactiviteit afgebroken. This message can be disabled via settings. Dit bericht kan in de instellingen worden uitgeschakeld. SnippingAreaSettings Freeze Image while snipping Schermfoto bevriezen tijdens vastleggen When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. Schakel in om de achtergrond te bevriezen tijdens het selecteren van een rechthoekig gebied. Dit verandert tevens het gedrag van vertraagde schermfoto's: de wachttijd vindt plaats vóórdat het selectiegebied wordt getoond. Deze optie is altijd uitgeschakeld op Wayland en altijd ingeschakeld op macOS. Show magnifying glass on snipping area Vergrootglas tonen op vastleggebied Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. Toont een vergrootglas om in te zoomen op de achtergrondafbeelding. Deze optie werkt alleen als 'Schermfoto bevriezen tijdens vastleggen' is ingeschakeld. Show Snipping Area rulers Linialen tonen op vastleggebied Horizontal and vertical lines going from desktop edges to cursor on snipping area. Horizontale en verticale lijnen die lopen vanaf de schermranden naar de cursor op het vastleggebied. Show Snipping Area position and size info Positie- en afmetingsinformatie tonen op vastleggebied When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. Als de linkermuisknop niet wordt ingedrukt, wordt de positie getoond. Als de knop wél wordt ingedrukt, wordt de grootte van het selectiegebied links en bovenaan getoond. Allow resizing rect area selection by default Vergroten/Verkleinen van selectiegebied toestaan When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. Schakel in om de afmetingen van het gebied van een rechthoekige selectie aan te passen. Druk na het aanpassen op Enter om op te slaan. Show Snipping Area info text Informatietekst tonen op vastleggebied Snipping Area cursor color Cursorkleur binnen vastleggebied Sets the color of the snipping area cursor. Stel de kleur in van de cursor op het vastleggebied. Snipping Area cursor thickness Cursordikte binnen vastleggebied Sets the thickness of the snipping area cursor. Stel de dikte in van de cursor op het vastleggebied. Snipping Area Vastleggebied Snipping Area adorner color Versierkleur van vastleggebied Sets the color of all adorner elements on the snipping area. Stelt de kleur in van versierde elementen in het vastleggebied. Snipping Area Transparency Doorzichtigheid van vastleggebied Alpha for not selected region on snipping area. Smaller number is more transparent. De alfawaarde van niet-geselecteerde gebieden in het selectiegebied. Lager = doorzichtiger. StickerSettings Up Omhoog Down Omlaag Use Default Stickers Standaardstickers gebruiken Sticker Settings Stickerinstellingen Vector Image Files (*.svg) Vector-afbeeldingsbestanden (*.svg) Add Toevoegen Remove Verwijderen Add Stickers Stickers toevoegen TrayIcon Show Editor Bewerker tonen TrayIconSettings Use Tray Icon Systeemvakpictogram gebruiken When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. Schakel dit in om, als je vensterbeheerder dit ondersteunt, een systeemvakpictogram te gebruiken. Herstart om de wijziging toe te passen. Minimize to Tray Minimaliseren naar systeemvak Start Minimized to Tray Geminimaliseerd in systeemvak opstarten Close to Tray Sluiten naar systeemvak Show Editor Bewerker tonen Capture Vastleggen Default Tray Icon action Standaard systeemvakpictogramactie Default Action that is triggered by left clicking the tray icon. De standaardactie na het klikken op het systeemvakpictogram. Tray Icon Settings Systeemvakinstellingen Display Tray icon notifications Systeemvakmeldingen tonen Use platform specific notification service Systeemmeldingen tonen When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. Schakel in om, indien mogelijk, systeemmeldingen te tonen. Herstart KSnip om de wijziging toe te passen. UpdateWatermarkOperation Select Image Foto kiezen Images Afbeeldingen All Files Alle bestanden UploadOperation Upload Script Required Uploadscript vereist Please add an upload script via Options > Settings > Upload Script Voeg een uploadscript toe via Opties --> Instellingen --> Uploadscript Capture Upload Schermfoto uploaden You are about to upload the image to an external destination, do you want to proceed? Je staat op het punt om een schermfoto te uploaden. Wil je doorgaan? UploaderSettings Ask for confirmation before uploading Vragen alvorens te uploaden Uploader Type: Soort upload: Imgur Imgur Script Script Uploader Uploader VersionTab Version Versie Build Bouwsel Using: Gebruikmakend van: WatermarkSettings Watermark Image Watermerkafbeelding Update Bijwerken Rotate Watermark Watermerk draaien When enabled, Watermark will be added with a rotation of 45° Gebruik deze optie om een watermerk toe te voegen dat 45° gedraaid is Watermark Settings Watermerkinstellingen ksnip-1.9.2/translations/ksnip_no.ts000066400000000000000000001545021414701001100175540ustar00rootroot00000000000000 AboutDialog About Om About Om Version Versjon Author Utvikler Close Lukk Donate Doner Contact AboutTab License: Lisens: Screenshot and Annotation Tool ActionSettingTab Name Shortcut Clear Tøm Take Capture Include Cursor Delay s s Capture Mode Show image in Pin Window Copy image to Clipboard Upload image Open image parent directory Save image Hide Main Window ActionsSettings Add Legg til Actions Settings Action AddWatermarkOperation Watermark Image Required Vannmerkingsbilde kreves Please add a Watermark Image via Options > Settings > Annotator > Update Legg til et vannmerkingsbilde via Valg → Innstillinger → Undertekster → Oppdater AnnotationSettings Smooth Painter Paths Myk ut tegningsstrøk When enabled smooths out pen and marker paths after finished drawing. Myker ut penn og markørstrøk etter utført tegning. Smooth Factor Utmykiningsfaktor Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. Økning av utmykingsfaktoren vil senke nøyaktigheten for penn og markør, men vil gjøre dem mykere. Annotator Settings Undertekstingsinnstillinger Remember annotation tool selection and load on startup Switch to Select Tool after drawing Item Number Tool Seed change updates all Number Items Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. Canvas Color Default Canvas background color for annotation area. Changing color affects only new annotation areas. Select Item after drawing With this option enabled the item gets selected after being created, allowing changing settings. ApplicationSettings Capture screenshot at startup with default mode Utfør skjermavbildning ved oppstart i forvalgt modus Application Style Programstil Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. Setter programstilen som definerer utseende og oppførsel for bruker- grensesnittet. Endringer krever omstart av ksnip. Application Settings Programinnstillinger Automatically copy new captures to clipboard Kopier nye avbildninger til utklippstavle automatisk Use Tabs Bruk faner Change requires restart. Run ksnip as single instance Hide Tabbar when only one Tab is used. Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. Remember Main Window position on move and load on startup Auto hide Tabs Auto hide Docks On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. Auto resize to content Automatically resize Main Window to fit content image. AuthorTab Contributors: Bidragsytere: Spanish Translation Spansk oversettelse Dutch Translation Nederlandsk oversettelse Russian Translation Russisk oversettelse Norwegian Bokmål Translation Bokmålsoversettelse French Translation Fransk oversettelse Polish Translation Polsk oversettelse Snap & Flatpak Support Snap og Flatpak -støtte The Authors: CanDiscardOperation Warning - Advarsel - The capture %1%2%3 has been modified. Do you want to save it? CaptureModePicker New Ny Draw a rectangular area with your mouse Tegn et rektangulært område med musen din Capture full screen including all monitors Avbild hele skjermen på tvers av alle monitorer Capture screen where the mouse is located Avbild skjerm der pekeren befinner seg Capture window that currently has focus Avbild vindu som er i fokus Capture that is currently under the mouse cursor Avbild det som er under musepekeren Capture a screenshot of the last selected rectangular area Uses the screenshot Portal for taking screenshot ContactTab Community If you have general questions, ideas or just want to talk about ksnip, please join our server. Bug Reports Please use Bruk to report bugs. for å innrapportere feil. CopyAsDataUriOperation Failed to copy to clipboard Failed to copy to clipboard as base64 encoded image. Copied to clipboard Copied to clipboard as base64 encoded image. DeleteImageOperation Delete Image Slett bilde The item '%1' will be deleted. Do you want to continue? Elementet «%1» vil bli slettet. Ønsker du å fortsette? DonateTab Donation Donasjon Become a GitHub Sponsor Bli en GitHub-sponsor here her Also possible, Også mulig, Donations are always welcome Donasjoner er alltid velkomne ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. ksnip er et ikke-profitabelt ;) gemenhetslig fritt programvareprosjekt, som <br/>likevel har kostnader som må dekkes,<br/>som domene- eller maskinvarekostnader for multiplattformsstøtte. If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that Hvis du ønsker å hjelpe, eller bare<br/>vil verdsette arbeidet som gjøres<br/>ved å spandere øl eller kaffe på utviklerne, kan du gjøre dette EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. EnumTranslator Rectangular Area Rektangulært område Last Rectangular Area Full Screen (All Monitors) Fullskjermsvisning (alle skjermer) Current Screen Nåværende skjerm Active Window Aktivt vindu Window Under Cursor Vindu under peker Screenshot Portal HandleUploadResultOperation Upload Successful Opplastet Upload script Last opp skript finished successfully. Uploaded to Opplastet til Unable to save temporary image for upload. Unable to start process, check path and permissions. Kunne ikke starte prosess, sjekk sti og tilganger. Process crashed Process timed out. Process read error. Process write error. Web error, check console output. Unknown process error. Upload Failed Script wrote to StdErr. HotKeySettings Enable Global HotKeys Capture Rect Area Capture Full Screen Capture current Screen Capture active Window Capture Window under Cursor Global HotKeys Capture Last Rect Area Clear Tøm Capture using Portal HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. ImageGrabberSettings Capture mouse cursor on screenshot Ta med peker Should mouse cursor be visible on screenshots. Hvorvidt pekeren tas med på skjermavbildninger. Image Grabber Bildehenter Force Generic Wayland Screenshot Scale Generic Wayland Screenshots Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. Show Main Window after capturing screenshot Hide Main Window during screenshot Hide Main Window when capturing a new screenshot. Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. ImgurHistoryDialog Imgur History Imgur-historikk Close Lukk Time Stamp Tidsstempel Link Lenke Delete Link Slett lenke ImgurUploader Upload to imgur.com finished! Opplastet til imgur.com. Received new token, trying upload again… Mottok nytt symbol, forsøker opplasting igjen… Imgur token has expired, requesting new token… Imgur-symbol utløpt, forespør nytt… ImgurUploaderSettings Force anonymous upload Tving anonym opplasting Always copy Imgur link to clipboard Alltid kopier Imgur-lenke til utklippstavle Client ID Klient-ID Client Secret Klient-hemmelighet PIN PIN Enter imgur Pin which will be exchanged for a token. Skriv inn Imgur-PIN brukt til utveksling for symbol Get PIN Hent PIN Get Token Hent symbol Imgur History Imgur-historikk Imgur Uploader Imgur-opplaster Username Brukernavn Waiting for imgur.com… Venter på imgur.com… Imgur.com token successfully updated. Imgur.com-symbol oppdatert. Imgur.com token update error. Imgur.com-symboloppdateringsfeil. After uploading open Imgur link in default browser Etter opplasting, åpne Imgur-lenke i forvalgt nettleser Link directly to image Base Url: Base url that will be used for communication with Imgur. Changing requires restart. Clear Token LoadImageFromFileOperation Unable to open image Unable to open image from path %1 MainToolBar New Ny Delay in seconds between triggering and capturing screenshot. Forsinkelse i sekunder mellom utløsing og avbildning av skjerm. s s Save Lagre Save Screen Capture to file system Lagre skjermavbildning til filsystem Copy Kopier Copy Screen Capture to clipboard Kopier skjermavbildning til utklippstavle Tools Verktøy Undo Angre Redo Gjenta Crop Beskjær Crop Screen Capture Beskjær skjermavbildning MainWindow Unsaved Ulagret Upload Last opp Print Skriv ut Opens printer dialog and provide option to print image Åpner utskriftsdialogvindu og gir mulighet til å skrive ut bilde Print Preview Utskriftsforhåndsvisning Opens Print Preview dialog where the image orientation can be changed Åpner utskriftsforhåndsvisningsdialogvindu der sideretning kan endres Scale Skaler Quit Avslutt Settings Innstillinger &About &Om Open Åpne &Edit &Rediger &Options &Valg &Help &Hjelp Image Files (*.png *.jpg *.bmp) Bildefiler (*.png *.jpg *.bmp) Add Watermark Legg til vannmerke Add Watermark to captured image. Multiple watermarks can be added. Legg til vannmerke til innhentet bilde. Flere vannmerker kan legges til. &File &Fil Unable to show image Klarte ikke å vise bilde Save As... Lagre som … Paste Lim inn Paste Embedded Pin Fest Pin screenshot to foreground in frameless window No image provided but one was expected. Copy Path Kopier sti Open Directory Åpne mappe &View &Vis Delete Slett Rename Gi nytt navn Open Images Åpne bilder Show Docks Hide Docks Copy as data URI Open &Recent Modify Canvas Upload triggerCapture to external source Copy triggerCapture to system clipboard Scale Image Rotate Rotate Image MultiCaptureHandler Save Lagre Save As Lagre som Open Directory Åpne mappe Copy Kopier Copy Path Kopier sti Delete Slett Rename Gi nytt navn NewCaptureNameProvider Capture PinWindow Close Lukk Close Other Close All Lukk alle PinWindowHandler Pin Window %1 Fest vindu %1 RenameOperation Image Renamed Successfully renamed image to Image Rename Failed Failed to rename image to Rename image Gi bilde nytt navn New filename: Nytt filnavn: SaveOperation Save As Lagre som Images Bilder All Files Alle filer Image Saved Bilde lagret Saving Image Failed Kunne ikke lagre bilde Saved to Lagret i Failed to save image to Klarte ikke å lagre bilde i SaverSettings Automatically save new captures to default location Prompt to save before discarding unsaved changes Forespør lagring før forkasting av ulagrede endringer Remember last Save Directory When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. Capture save location and filename Lagringssted og filnavn for skjermavbildning Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. Browse Utforsk Saver Settings Capture save location Avbildningslagringssted Default Forvalg Factor Save Quality Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. ScriptUploaderSettings Copy script output to clipboard Kopier skriptutdata til utklippstavle Script: Skript: Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. Browse Utforsk Script Uploader Select Upload Script Stop when upload script writes to StdErr Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. Filter: Filter: RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. SettingsDialog Settings Innstillinger OK OK Cancel Avbryt Image Grabber Bildehenter Imgur Uploader Imgur-opplaster Application Program Annotator Undertekster HotKeys Uploader Opplaster Script Uploader Saver Stickers Snipping Area Tray Icon Watermark Actions SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Use arrow keys to move the selection. Use arrow keys while pressing CTRL to move top left handle. Use arrow keys while pressing ALT to move bottom right handle. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. This message can be disabled via settings. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Hold CTRL pressed to resize selection after selecting. Hold CTRL pressed to prevent resizing after selecting. Operation will be canceled after 60 sec when no selection made. This message can be disabled via settings. SnippingAreaSettings Freeze Image while snipping Frys bildet under tilpasning When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. Show magnifying glass on snipping area Vis forstørrelsesglass i tilpasningsområde Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. Vis et forstørrelsesglass som forstørrer inn i bakgrunnsbildet. Dette valget fungerer med "Frys bilde under tilpasning" påskrudd. Show Snipping Area rulers Vis linjaler for tilpasningsområde Horizontal and vertical lines going from desktop edges to cursor on snipping area. Vann- og loddrette linjer som går fra skrivebordets kanter til pekeren i tilpasningsområdet. Show Snipping Area position and size info Vis posisjon og størrelsesinfo for tilpasningsområde When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. Allow resizing rect area selection by default When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. Show Snipping Area info text Snipping Area cursor color Pekerfarge for tilpasningsområde Sets the color of the snipping area cursor. Snipping Area cursor thickness Pekertykkelse for tilpasningsområde Sets the thickness of the snipping area cursor. Snipping Area Snipping Area adorner color Sets the color of all adorner elements on the snipping area. Snipping Area Transparency Alpha for not selected region on snipping area. Smaller number is more transparent. StickerSettings Up Down Use Default Stickers Sticker Settings Vector Image Files (*.svg) Add Legg til Remove Fjern Add Stickers TrayIcon Show Editor TrayIconSettings Use Tray Icon Bruk systemkurvsikon When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. Minimize to Tray Minimer til systemkurven Start Minimized to Tray Close to Tray Lukk til systemkurven Show Editor Capture Default Tray Icon action Default Action that is triggered by left clicking the tray icon. Tray Icon Settings Display Tray icon notifications Use platform specific notification service When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. UpdateWatermarkOperation Select Image Velg bilde Images Bilder All Files Alle filer UploadOperation Upload Script Required Please add an upload script via Options > Settings > Upload Script Capture Upload You are about to upload the image to an external destination, do you want to proceed? UploaderSettings Ask for confirmation before uploading Forespør bekreftelse før opplasting Uploader Type: Imgur Script Skript Uploader Opplaster VersionTab Version Versjon Build Bygg Using: Bruker: WatermarkSettings Watermark Image Vannmerkingsbilde Update Oppdater Rotate Watermark Roter vannmerke When enabled, Watermark will be added with a rotation of 45° Legger til vannmere rotert 45° Watermark Settings ksnip-1.9.2/translations/ksnip_pl.ts000066400000000000000000001663531414701001100175620ustar00rootroot00000000000000 AboutDialog About O programie About O programie Version Wersja Author Autor Close Zamknij Donate Wspomóż Contact Kontakt AboutTab License: Licencja: Screenshot and Annotation Tool Zrzut ekranu i narzędzie adnotacji ActionSettingTab Name Nazwa Shortcut Skrót Clear Wyczyść Take Capture Przechwyć Include Cursor Uwzględnij kursor Delay Opóźnij s s Capture Mode Tryb przechwytywania Show image in Pin Window Pokaż obraz w oknie Pin Copy image to Clipboard Kopiuj obraz do schowka Upload image Prześlij obraz Open image parent directory Otwórz nadrzędny katalog obrazu Save image Zapisz obraz Hide Main Window Ukryj główne okno ActionsSettings Add Dodaj Actions Settings Ustawienia działań Action Działanie AddWatermarkOperation Watermark Image Required Wymagany obraz znaku wodnego Please add a Watermark Image via Options > Settings > Annotator > Update Dodaj obraz znaku wodnego, wybierając Opcje > Ustawienia > Komentarz > Aktualizuj AnnotationSettings Smooth Painter Paths Wygładzaj linie rysunkowe When enabled smooths out pen and marker paths after finished drawing. Po włączeniu wygładza linie pióra i ścieżki znaczników po zakończeniu rysowania. Smooth Factor Współczynnik wygładzania Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. Zwiększenie współczynnika wygładzania spowoduje zmniejszenie dokładności pióra i markera ale uczyni je bardziej gładkimi. Annotator Settings Ustawienia komentarza Remember annotation tool selection and load on startup Zapamiętaj wybór narzędzia do adnotacji i załaduj go podczas uruchamiania Switch to Select Tool after drawing Item Przejdź do opcji Wybierz narzędzie po narysowaniu elementu Number Tool Seed change updates all Number Items Narzędzie numeracji Zmiana numeru aktualizuje wszystkie ponumerowane pozycje Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. Wyłączenie tej opcji powoduje zmiany narzędzia numeracji. Dotyczy tylko nowych elementów i nie wpływa na już istniejące elementy. Wyłączenie tej opcji spowoduje zduplikowanie numerów. Canvas Color Kolor płótna Default Canvas background color for annotation area. Changing color affects only new annotation areas. Domyślny kolor tła obszaru roboczego dla obszaru adnotacji. Zmiana koloru wpływa tylko na nowe obszary adnotacji. Select Item after drawing Wybierz element po narysowaniu With this option enabled the item gets selected after being created, allowing changing settings. Po włączeniu tej opcji element jest zaznaczany po utworzeniu, co pozwala na zmianę ustawień. ApplicationSettings Capture screenshot at startup with default mode Przechwytuj zrzut ekranu przy uruchamianiu w trybie domyślnym Application Style Styl aplikacji Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. Ustawia styl aplikacji, który definiuje wygląd i działanie interfejsu GUI. Zmiana wymaga ponownego uruchomienia ksnip, aby odniosła skutek. Application Settings Ustawienia aplikacji Automatically copy new captures to clipboard Automatycznie kopiuj nowe zrzuty do schowka Use Tabs Użyj zakładek Change requires restart. Zmiana wymaga ponownego uruchomienia. Run ksnip as single instance Uruchom ksnip jako pojedynczą instancję Hide Tabbar when only one Tab is used. Ukryj pasek zakładek, gdy używana jest tylko jedna karta. Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. Włączenie tej opcji pozwoli na uruchomienie tylko jednej instancji ksnip, wszystkie inne instancje uruchomione po pierwszym przekażą ich argumenty do pierwszego i zostaną zamknięte. Zmiana tej opcji wymaga ponownego uruchomienia wszystkich instancji. Remember Main Window position on move and load on startup Zapamiętaj pozycję okna głównego podczas przenoszenia i ładowania przy starcie Auto hide Tabs Ukryj automatycznie Zakładki Auto hide Docks Ukryj automatycznie Doki On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. Po uruchomieniu ukryj pasek narzędzi i ustawienia adnotacji. Widoczność doków można przełączać za pomocą klawisza Tab. Auto resize to content Dostosuj rozmiar do zawartości Automatically resize Main Window to fit content image. Automatyczna zmiana rozmiaru okna głównego w celu dopasowania do zawartości obrazu. AuthorTab Contributors: Współtwórcy: Spanish Translation Tłumaczenie na język hiszpański Dutch Translation Tłumaczenie na język niderlandzki Russian Translation Tłumaczenie na język rosyjski Norwegian Bokmål Translation Tłumaczenie na język norweski Bokmål French Translation Tłumaczenie na język francuski Polish Translation Tłumaczenie na język polski Snap & Flatpak Support Obsługa Snap & Flatpak The Authors: Autorzy: CanDiscardOperation Warning - Ostrzeżenie - The capture %1%2%3 has been modified. Do you want to save it? Zrzut z ekranu %1%2%3 został zmodyfikowany. Chcesz go zapisać? CaptureModePicker New Nowy Draw a rectangular area with your mouse Narysuj myszką prostokątny obszar Capture full screen including all monitors Przechwyć pełny ekran, w tym wszystkie monitory Capture screen where the mouse is located Przechwyć ekran, na którym znajduje się myszka Capture window that currently has focus Przechwyć okno, które aktualnie jest aktywne Capture that is currently under the mouse cursor Przechwyć okno, które jest aktualnie pod kursorem myszy Capture a screenshot of the last selected rectangular area Wykonaj zrzut ekranu z ostatnio wybranym prostokątnym obszarem Uses the screenshot Portal for taking screenshot Wykorzystuje portal do robienia zrzutów ekranu ContactTab Community Społeczność If you have general questions, ideas or just want to talk about ksnip, Jeśli masz ogólne pytania, pomysły lub po prostu chcesz porozmawiać o ksnip, please join our dołącz do nas na server. server. Bug Reports Zgłaszanie błędów Please use Użyj to report bugs. do raportowania błędów. CopyAsDataUriOperation Failed to copy to clipboard Nieudane kopiowanie do schowka Failed to copy to clipboard as base64 encoded image. Nie udało się skopiować do schowka obrazu zakodowanego w base64. Copied to clipboard Skopiowano do schowka Copied to clipboard as base64 encoded image. Skopiowano do schowka jako obraz zakodowany base64. DeleteImageOperation Delete Image Usuń Obraz The item '%1' will be deleted. Do you want to continue? Element '%1' zostanie usunięty. Czy chcesz kontynuować? DonateTab here tutaj Also possible, Możesz także, Donations are always welcome Darowizny są zawsze mile widziane Donation Wspomóż Become a GitHub Sponsor Zostań Sponsorem GitHub ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. ksnip jest niedochodowym projektem wolnego oprogramowania objętego licencją typu copylefted <br/> i nadal ma pewne koszty, które trzeba pokryć, takie jak koszty domeny lub koszty sprzętu<br/> do obsługi wielu platform. If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that Jeśli chcesz pomóc lub chcesz docenić wykonywaną pracę<br/> polegającą na poczęstowaniu programistów piwem lub kawą, możesz to zrobić EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. Dodaj nowe akcje, naciskając przycisk "Dodaj". EnumTranslator Rectangular Area Obszar prostokątny Last Rectangular Area Ostatni obszar prostokątny Full Screen (All Monitors) Pełny ekran (wszystkie monitory) Current Screen Bieżący ekran Active Window Aktywne okno Window Under Cursor Okno pod kursorem Screenshot Portal Portal zrzutu ekranu HandleUploadResultOperation Upload Successful Przesyłanie zakończone pomyślnie Upload script Prześlij skrypt finished successfully. zakończone pomyślnie. Uploaded to Przesłane do Unable to save temporary image for upload. Nie można zapisać tymczasowego obrazu do przesłania. Unable to start process, check path and permissions. Nie można uruchomić procesu, sprawdź ścieżkę i uprawnienia. Process crashed Proces uległ awarii Process timed out. Przekroczono limit czasu procesu. Process read error. Błąd odczytu procesu. Process write error. Błąd zapisu procesu. Web error, check console output. Błąd sieciowy, sprawdź dane wyjściowe konsoli. Unknown process error. Nieznany błąd procesu. Upload Failed Przesyłanie nie powiodło się Script wrote to StdErr. Skrypt wysłany do StdErr. HotKeySettings Enable Global HotKeys Włącz globalne klawisze skrótu Capture Rect Area Przechwyć obszar prostokątny Capture Full Screen Przechwyć pełny ekran Capture current Screen Przechwyć bieżący ekran Capture active Window Przechwyć aktywne okno Capture Window under Cursor Przechwyć okno pod kursorem Global HotKeys Globalne skróty klawiszowe Capture Last Rect Area Przechwyć ostatni obszar prostokątny Clear Wyczyść Capture using Portal Przechwyć za pomocą Portalu HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. Skróty klawiszowe są obecnie obsługiwane tylko dla systemów Windows i X11. Wyłączenie tej opcji spowoduje, że skróty akcji będą obsługiwane tylko przez ksnip. ImageGrabberSettings Capture mouse cursor on screenshot Przechwyć kursor myszy na zrzucie ekranu Should mouse cursor be visible on screenshots. Czy kursor myszy powinien być widoczny na zrzutach ekranu. Image Grabber Przechwyć obraz Force Generic Wayland Screenshot Wymuś rodzajowy zrzut ekranu Wayland Scale Generic Wayland Screenshots Skaluj rodzajowy zrzut ekranu z Wayland Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. Rodzajowe wdrożenia Wayland, które używają XDG-DESKTOP-PORTAL obsługują skalowanie ekranu w inny sposób. Włączenie tej opcji określi bieżące skalowanie ekranu i zastosuje je do zrzutu ekranu w ksnip. GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. GNOME i KDE Plasma obsługują własny Wayland oraz zrzuty ekranu Generic XDG-DESKTOP-PORTAL. Włączenie tej opcji wymusi KDE Plasma i GNOME do korzystania ze zrzutów ekranu XDG-DESKTOP-PORTAL. Zmiana tej opcji wymaga ponownego uruchomienia ksnip. Show Main Window after capturing screenshot Pokaż okno główne po przechwyceniu zrzutu ekranu Hide Main Window during screenshot Ukryj okno główne podczas zrzutu ekranu Hide Main Window when capturing a new screenshot. Ukryj okno główne podczas przechwytywania nowego zrzutu ekranu. Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. Pokaż Główne okno po zrobieniu nowego zrzutu ekranu kiedy główne okno było ukryte lub zminimalizowane. ImgurHistoryDialog Imgur History Historia Imgur Close Zamknij Time Stamp Czas Link Link Delete Link Usuń link ImgurUploader Upload to imgur.com finished! Przesyłanie do imgur.com zakończone! Received new token, trying upload again… Otrzymano nowy token, próbuję przesłać ponownie… Imgur token has expired, requesting new token… Token Imgur wygasł, żądanie nowego tokena… ImgurUploaderSettings Force anonymous upload Wymuś anonimowe przesyłanie Always copy Imgur link to clipboard Zawsze kopiuj link Imgur do schowka Client ID Identyfikator klienta Client Secret Szyfrowanie klienta PIN PIN Enter imgur Pin which will be exchanged for a token. Wpisz Pin imgur, który zostanie wymieniony na token. Get PIN Uzyskaj PIN Get Token Uzyskaj Token Imgur History Historia Imgur Imgur Uploader Prześlij do Imgur Username Nazwa użytkownika Waiting for imgur.com… Czekam na imgur.com… Imgur.com token successfully updated. Token Imgur.com został pomyślnie zaktualizowany. Imgur.com token update error. Błąd aktualizacji tokena Imgur.com. After uploading open Imgur link in default browser Po załadowaniu otwórz link Imgur w domyślnej przeglądarce Link directly to image Link bezpośrednio do obrazu Base Url: Podstawowy adres URL: Base url that will be used for communication with Imgur. Changing requires restart. Podstawowy adres URL, który będzie używany do komunikacji z Imgur. Zmiana wymaga ponownego uruchomienia. Clear Token Wyczyść token LoadImageFromFileOperation Unable to open image Nie można otworzyć obrazu Unable to open image from path %1 Nie można otworzyć obrazu ze ścieżki %1 MainToolBar New Nowy Delay in seconds between triggering and capturing screenshot. Opóźnienie w sekundach pomiędzy wywołaniem i wykonaniem zrzutu ekranu. s s Save Zapisz Save Screen Capture to file system Zapisz zrzut ekranu w systemie plików Copy Kopiuj Copy Screen Capture to clipboard Skopiuj zrzut ekranu do schowka Tools Narzędzia Undo Cofnij Redo Ponów Crop Kadruj Crop Screen Capture Kadruj zrzut ekranu MainWindow Unsaved Niezapisane Upload Wyślij Print Drukuj Opens printer dialog and provide option to print image Otwiera okno dialogowe drukarki i umożliwia drukowanie obrazu Print Preview Podgląd wydruku Opens Print Preview dialog where the image orientation can be changed Otwiera okno dialogowe Podglądu wydruku, w którym można zmienić orientację obrazu Scale Skaluj Quit Zakończ Settings Ustawienia &About &O programie Open Otwórz &Edit &Edytuj &Options &Opcje &Help &Pomoc Image Files (*.png *.jpg *.bmp) Pliki obrazów (*.png *.jpg *.bmp) Add Watermark Dodaj znak wodny Add Watermark to captured image. Multiple watermarks can be added. Dodaj znak wodny do przechwyconego obrazu. Można dodać wiele znaków wodnych. &File &Plik Unable to show image Nie można wyświetlić obrazu Save As... Zapisz jako... Paste Wklej Paste Embedded Wklej Osadź Pin Pin Pin screenshot to foreground in frameless window Przypnij zrzut ekranu do pierwszego planu w oknie bez ramek No image provided but one was expected. Nie dostarczono żadnego obrazu, ale oczekiwano jednego. Copy Path Kopiuj ścieżkę Open Directory Otwórz katalog &View &Widok Delete Usuń Rename Zmień nazwę Open Images Otwórz obraz Show Docks Pokaż Doki Hide Docks Ukryj Doki Copy as data URI Kopiuj jako dane URI Open &Recent Ostatnio &Otwierane Modify Canvas Modyfikacja płótna Upload triggerCapture to external source Prześlij trigerCapture do zewnętrznego źródła Copy triggerCapture to system clipboard Kopiuj triggerCapture do schowka systemowego Scale Image Skaluj obraz Rotate Obróć Rotate Image Obróć obraz MultiCaptureHandler Save Zapisz Save As Zapisz jako Open Directory Otwórz katalog Copy Kopiuj Copy Path Kopiuj ścieżkę Delete Usuń Rename Zmień nazwę NewCaptureNameProvider Capture Zrzut z ekranu PinWindow Close Zamknij Close Other Zamknij inne Close All Zamknij wszystko PinWindowHandler Pin Window %1 Przypnij okno %1 RenameOperation Image Renamed Zmieniono nazwę obrazu Successfully renamed image to Pomyślnie zmieniono nazwę obrazu na Image Rename Failed Zmiana nazwy obrazu nie powiodła się Failed to rename image to Nie udało się zmienić nazwy obrazu na Rename image Zmień nazwę obrazu New filename: Nowa nazwa pliku: SaveOperation Save As Zapisz jako Images Obrazy All Files Wszystkie Pliki Image Saved Obraz został zapisany Saving Image Failed Zapisywanie obrazu nie powiodło się Saved to Zapisano w Failed to save image to Nie udało się zapisać obrazu w SaverSettings Automatically save new captures to default location Zapisz automatycznie nowe zrzuty w domyślnej lokalizacji Prompt to save before discarding unsaved changes Pytaj czy zapisać przed odrzuceniem niezapisanych zmian Remember last Save Directory Zapamiętaj ostatni katalog zapisywania When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. Po włączeniu tej opcji nadpisze zapisany w ustawieniach katalog najnowszym katalogiem zapisu, dla każdego zapisu. Capture save location and filename Lokalizacja zapisu i nazwa pliku Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. Obsługiwane formaty to JPG, PNG i BMP. Jeśli format nie zostanie podany, domyślnie zostanie użyty format PNG. Nazwa pliku może zawierać następujące symbole wieloznaczne: - $Y, $M, $D dla daty, $h, $m, $s dla czasu lub $T dla czasu w formacie ggmmss. - Wiele kolejnych zaków # dla licznika. #### da w wyniku 0001, następne przechwycenie to 0002. Browse Przeglądaj Saver Settings Zapisz ustawienia Capture save location Zapisz zrzut ekranu w lokalizacji Default Domyślna Factor Współczynnik Save Quality Jakość zapisu Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. Podaj 0, aby uzyskać małe pliki skompresowane, 100 dla dużych plików nieskompresowanych. Nie wszystkie formaty obrazów obsługują pełny zakres, JPEG obsługuje pełny zakres. ScriptUploaderSettings Copy script output to clipboard Kopiuj dane wyjściowe skryptu do schowka Script: Skrypt: Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. Ścieżka do skryptu, który zostanie wywołany w celu przesłania. Podczas przesyłania skrypt zostanie wywołany ze ścieżką do tymczasowego pliku png jako pojedynczym argumentem. Browse Przeglądaj Script Uploader Przesyłanie skryptów Select Upload Script Wybierz skrypt do przesłania Stop when upload script writes to StdErr Zatrzymaj się przy zapisie skryptu na StdErr Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. Oznacza przesyłanie jako zakończone niepowodzeniem, gdy skrypt zapisuje do StdErr. Bez tego ustawienia błędy w skrypcie pozostaną niezauważone. Filter: Filtr: RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. Wyrażenie RegEx. Kopiuj do schowka tylko to, co pasuje do wyrażenia RegEx. W przypadku pominięcia wszystko jest kopiowane. SettingsDialog Settings Ustawienia OK OK Cancel Anuluj Image Grabber Przechwyć obraz Imgur Uploader Prześlij do Imgur Application Aplikacja Annotator Komentator HotKeys Skróty klawiszowe Uploader Przesyłanie Script Uploader Przesyłanie skryptów Saver Zapisywanie Stickers Naklejki Snipping Area Obszar wycinania Tray Icon Ikona w zasobniku Watermark Znak wodny Actions Działania SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Ponownie wybierz rozmiar wybranego prostokąta za pomocą uchwytów lub przesuń go, przeciągając zaznaczenie. Use arrow keys to move the selection. Użyj klawiszy strzałek, aby przesunąć zaznaczenie. Use arrow keys while pressing CTRL to move top left handle. Użyj klawiszy strzałek, naciskając klawisz CTRL, aby przesunąć lewy górny uchwyt. Use arrow keys while pressing ALT to move bottom right handle. Użyj klawiszy strzałek, jednocześnie naciskając ALT, aby przesunąć prawy dolny uchwyt. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. Potwierdź wybór naciskając ENTER/RETURN lub przerwij naciskając ESC. This message can be disabled via settings. Ten komunikat można wyłączyć w ustawieniach. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Kliknij i przeciągnij, aby wybrać prostokątny obszar, lub naciśnij klawisz ESC, aby zakończyć pracę. Hold CTRL pressed to resize selection after selecting. Przytrzymaj wciśnięty klawisz CTRL, aby zmienić rozmiar zaznaczenia po wybraniu. Hold CTRL pressed to prevent resizing after selecting. Przytrzymaj wciśnięty klawisz CTRL, aby zapobiec zmianie rozmiaru po wybraniu. Operation will be canceled after 60 sec when no selection made. Operacja zostanie anulowana po 60 sekundach, gdy żaden wybór nie zostanie dokonany. This message can be disabled via settings. Ten komunikat można wyłączyć w ustawieniach. SnippingAreaSettings Freeze Image while snipping Zablokuj obraz podczas wycinania When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. Po włączeniu tej opcji zamraża tło, podczas wybierania prostokątnego obszaru. Zmienia również zachowanie opóźnionych zrzutów ekranu, z tym że przy opcji włączonej opóźnienie następuje przed wyświetleniem obszaru wycinania, a z opcją wyłączoną opóźnienie następuje po wyświetleniu obszaru wycinania. Ta funkcja jest zawsze wyłączona dla Wayland i zawsze włączone dla MacOs. Show magnifying glass on snipping area Pokaż lupę w obszarze wycinania Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. Wyświetla lupę, która pozwala powiększyć obraz tła. Ta opcja działa tylko z włączoną funkcją "Zamrażaj obraz podczas przycinania". Show Snipping Area rulers Pokaż linijki obszaru wycinania Horizontal and vertical lines going from desktop edges to cursor on snipping area. Linie poziome i pionowe przechodzące od krawędzi pulpitu do kursora w obszarze wycinania. Show Snipping Area position and size info Pokaż położenie i rozmiar obszaru wycinania When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. Gdy lewy przycisk myszy nie jest wciśnięty pozycja jest wyświetlana, po naciśnięciu przycisku myszy wielkość wybranego obszaru jest wyświetlana po lewej stronie i powyżej przechwyconego obszaru. Allow resizing rect area selection by default Domyślnie zezwalaj na zmianę rozmiaru zaznaczenia obszaru prostokątnego When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. Po włączeniu tej opcji, po zaznaczeniu prostokątnego obszaru, pozwoli na zmianę rozmiaru zaznaczenia. Po zakończeniu zmiany rozmiaru można potwierdzić wybór naciskając wstecz. Show Snipping Area info text Pokaż tekst informacyjny o obszarze wycinania Snipping Area cursor color Kolor kursora obszaru wycinania Sets the color of the snipping area cursor. Ustawia kolor kursora obszaru wycinania. Snipping Area cursor thickness Grubość kursora obszaru wycinania Sets the thickness of the snipping area cursor. Ustawia grubość kursora obszaru wycinania. Snipping Area Obszar wycinania Snipping Area adorner color Ozdobny kolor obszaru przechwytywania Sets the color of all adorner elements on the snipping area. Ustawia kolor wszystkich elementów ozdobnych w obszarze wycinania. Snipping Area Transparency Przezroczystość obszaru wycinania Alpha for not selected region on snipping area. Smaller number is more transparent. Przezroczystość nie wybranego regionu w obszarze wycinania. Im mniejsza liczba, tym obszar bardziej przezroczysty. StickerSettings Up W górę Down W dół Use Default Stickers Użyj domyślnych naklejek Sticker Settings Ustawienia naklejek Vector Image Files (*.svg) Pliki obrazu wektorowego (*.svg) Add Dodaj Remove Usuń Add Stickers Dodaj naklejkę TrayIcon Show Editor Pokaż edytor TrayIconSettings Use Tray Icon Użyj ikony z zasobnika When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. Po włączeniu doda ikonę do zasobnika paska zadań, jeśli obsługuje go Menedżer okien systemu operacyjnego. Zmiana wymaga ponownego uruchomienia. Minimize to Tray Minimalizuj do zasobnika Start Minimized to Tray Uruchom zminimalizowany do zasobnika Close to Tray Zamknij do zasobnika Show Editor Pokaż Edytor Capture Zrzut z ekranu Default Tray Icon action Domyślna akcja ikony zasobnika Default Action that is triggered by left clicking the tray icon. Domyślna Akcja, która jest uruchamiana przez kliknięcie lewym przyciskiem myszy ikony zasobnika. Tray Icon Settings Ustawienia ikony zasobnika Display Tray icon notifications Wyświetlaj powiadomienia o ikonach na pasku zadań Use platform specific notification service Skorzystaj z usługi powiadomień specyficznej dla platformy When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. Gdy włączone, będzie próbował używać powiadomień specyficznych dla platformy jeśli taka istnieje. Zmiana wymaga ponownego uruchomienia, aby zaczęła obowiązywać. UpdateWatermarkOperation Select Image Wybierz obraz Images Obrazy All Files Wszystkie Pliki UploadOperation Upload Script Required Wymagany skrypt do przesłania Please add an upload script via Options > Settings > Upload Script Aby przesłać skrypt należy wybrać Opcje > Ustawienia > Przesyłanie skryptów Capture Upload Prześlij zrzut You are about to upload the image to an external destination, do you want to proceed? Masz zamiar przesłać obraz do zewnętrznego miejsca docelowego, chcesz kontynuować? UploaderSettings Ask for confirmation before uploading Poproś o potwierdzenie przed przesłaniem Uploader Type: Typ przesyłania: Imgur Imgur Script Skrypt Uploader Przesyłanie VersionTab Version Wersja Build Kompilacja Using: Z użyciem: WatermarkSettings Watermark Image Obraz znaku wodnego Update Aktualizuj Rotate Watermark Obróć znak wodny When enabled, Watermark will be added with a rotation of 45° Po włączeniu tej funkcji znak wodny zostanie dodany z obróceniem o 45 ° Watermark Settings Ustawienia znaku wodnego ksnip-1.9.2/translations/ksnip_pt.ts000066400000000000000000001663461414701001100175740ustar00rootroot00000000000000 AboutDialog About Sobre About Sobre Version Versão Author Autor Close Fechar Donate Doar Contact Contacto AboutTab License: Licença: Screenshot and Annotation Tool Ferramenta de Captura de Imagem e Edição ActionSettingTab Name Nome Shortcut Atalho Clear Apagar Take Capture Fazer Captura Include Cursor Incluir Cursor Delay Atraso s s Capture Mode Modo de Captura Show image in Pin Window Mostrar imagem na janela de pinada Copy image to Clipboard Copiar imagem para a área de transferência Upload image Enviar Imagem Open image parent directory Abrir o diretório da imagem Save image Salvar imagem Hide Main Window Esconder Janela Principal ActionsSettings Add Adicionar Actions Settings Configurações de Ações Action Ação AddWatermarkOperation Watermark Image Required Imagem para marca d'água é necessária Please add a Watermark Image via Options > Settings > Annotator > Update Adicione uma imagem de marca d'água em: Opções > Configurações > Editor > Selecionar AnnotationSettings Smooth Painter Paths Suavizar Traços When enabled smooths out pen and marker paths after finished drawing. Quando ativado, suaviza a caneta e o marcador após finalizar o desenho. Smooth Factor Fator de suavização Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. Incrementar o fator de suavização diminuirá a precisão da caneta e do marcador, mas irá torná-los mais suaves. Annotator Settings Configurações do Editor Remember annotation tool selection and load on startup Lembre-se da ferramenta selecionada e carregue na inicialização Switch to Select Tool after drawing Item Mudar para ferramenta de seleção após desenhar o item Number Tool Seed change updates all Number Items Mudança na Ferramenta atualiza todos os itens número Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. Desativar esta opção causa mudanças na ferramenta número para afetar apenas novos itens, mas não os itens existentes. Desativar esta opção permite ter números duplicados. Canvas Color Cor de fundo do ecrã Default Canvas background color for annotation area. Changing color affects only new annotation areas. Cor de fundo padrão do ecrã para a área de anotação. Alterar a cor afeta apenas novas áreas de anotação. Select Item after drawing Escolher o item após desenhar With this option enabled the item gets selected after being created, allowing changing settings. Com esta opção ativa, o item fica selecionado após ser criado, permitindo alterar as configurações. ApplicationSettings Capture screenshot at startup with default mode Capturar ecrã ao iniciar, usando o modo por omissão Application Style Estilo da Aplicação Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. Define o estilo da aplicação que determina a aparência da interface gráfica. Requer reiniciar o ksnip para aplicar as mudanças. Application Settings Configurações da Aplicação Automatically copy new captures to clipboard Automaticamente copiar novas capturas para a área de transferência Use Tabs Usar Abas Change requires restart. A mudança requer reinicialização. Run ksnip as single instance Executar o ksnip como instância única Hide Tabbar when only one Tab is used. Ocultar barra de abas quando apenas uma guia for usada. Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. Ativar esta opção permitirá que apenas uma instância do ksnip funcione, todas as outras instâncias iniciadas após a primeira passarão os argumentos dele para a primeira e fechar. Alterar esta opção requer um novo início de todas as instâncias. Remember Main Window position on move and load on startup Lembre-se da posição da janela principal ao mover e carregar na inicialização Auto hide Tabs Ocultar abas automaticamente Auto hide Docks Auto ocultar Docks On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. Na inicialização, oculte as configurações de barra de ferramentas e anotações. A visibilidade das Docks pode ser alternada com a tecla Tab. Auto resize to content Redimensionar automaticamente para o conteúdo Automatically resize Main Window to fit content image. Redimensionar automaticamente a janela principal para se ajustar a imagem. AuthorTab Contributors: Contribuidores: Spanish Translation Tradução para Espanhol Dutch Translation Tradução para Holandês Russian Translation Tradução para Russo Norwegian Bokmål Translation Tradução para Norueguês Bokmål French Translation Tradução para Francês Polish Translation Tradução para Polonês Snap & Flatpak Support Suporte a Snap e Flatpak The Authors: Autores: CanDiscardOperation Warning - Aviso - The capture %1%2%3 has been modified. Do you want to save it? A captura %1%2%3 foi modificada. Deseja salvá-la? CaptureModePicker New Novo Draw a rectangular area with your mouse Desenhar uma área retangular com o rato Capture full screen including all monitors Capturar ecrã inteiro incluindo todos os monitores Capture screen where the mouse is located Capturar o ecrã onde o rato está localizado Capture window that currently has focus Capturar a janela que atualmente está com o foco Capture that is currently under the mouse cursor Capturar o que está atualmente sob o cursor do rato Capture a screenshot of the last selected rectangular area Realizar uma captura de ecrã da última área retangular selecionada Uses the screenshot Portal for taking screenshot Usar o portal de captura de ecrã para fazer a captura do ecrã ContactTab Community Comunidade If you have general questions, ideas or just want to talk about ksnip, Se tiver questões gerais, ideias ou apenas desjea falar acerca do ksnip, please join our por favor entre no nosso server. servidor. Bug Reports Registo de Problemas Please use Por favor, utilize o to report bugs. para reportar problemas. CopyAsDataUriOperation Failed to copy to clipboard Falha ao copiar para a área de transferência Failed to copy to clipboard as base64 encoded image. Falha ao copiar para a área de transferência como imagem codificada em base64. Copied to clipboard Copiado para a área de transferência Copied to clipboard as base64 encoded image. Copiado para a área de transferência como imagem codificada em base64. DeleteImageOperation Delete Image Apagar imagem The item '%1' will be deleted. Do you want to continue? O item '%1' será apagado. Deseja continuar? DonateTab here aqui Also possible, Também é possível, Donations are always welcome Doações são sempre bem-vindas Donation Doação Become a GitHub Sponsor Torne-se um patrocinador do GitHub ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. Ksnip é um projeto de software livre sem fins lucrativos com copyleft e <br/>ainda tem alguns custos que precisam ser cobertos,<br/>como custos de domínio ou custos de hardware para suporte multiplataforma. If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that Se quiser ajudar ou apenas<br/>apreciar o trabalho que está a ser feito<br/>a oferecer uma cerveja ou café aos programadores, pode fazê-lo EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. Adicionar novas ações a pressionar o botão da guia 'Adicionar'. EnumTranslator Rectangular Area Área retangular Last Rectangular Area Última Área Retangular Full Screen (All Monitors) Ecrã cheio (Todos os monitores) Current Screen Ecrã atual Active Window Janela Ativa Window Under Cursor Janela Sob o Cursor Screenshot Portal Portal de captura do ecrã HandleUploadResultOperation Upload Successful Upload bem sucedido Upload script Upload script finished successfully. terminou com sucesso. Uploaded to Upado para Unable to save temporary image for upload. Não foi possível salvar a imagem temporária para upload. Unable to start process, check path and permissions. Não foi possível iniciar o processo, verifique o caminho e as permissões. Process crashed Processo travado Process timed out. O tempo limite do processo expirou. Process read error. Erro no processo de leitura. Process write error. Erro no processo de gravação. Web error, check console output. Erro na Web, verifique a saída do console. Unknown process error. Erro desconhecido. Upload Failed Falha no upload Script wrote to StdErr. Script escrito para StdErr. HotKeySettings Enable Global HotKeys Ativar as teclas de atalho globais Capture Rect Area Captura de Área retangular Capture Full Screen Captura do ecrã cheio Capture current Screen Captura do ecrã atual Capture active Window Captura da Janela ativa Capture Window under Cursor Captura da Janela sob o rato Global HotKeys Teclas de Atalho Globais Capture Last Rect Area Captura da Última área retangular Clear Apagar Capture using Portal Capturar utilizando Portal HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. As HotKeys são atualmente suportadas apenas em Windows e X11. Desativar esta opção também faz com que os atalhos de ação sejam apenas ksnip. ImageGrabberSettings Capture mouse cursor on screenshot Capturar o cursor do rato na captura de ecrã Should mouse cursor be visible on screenshots. O cursor do rato estará visível nas capturas de ecrã. Image Grabber Captura de Imagem Force Generic Wayland Screenshot Forçar captura do ecrã genérico para Wayland Scale Generic Wayland Screenshots Captura com escala genérica para Wayland Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. Implementações genéricas do Wayland que utilizam o XDG-DESKTOP-PORTAL lidam com o dimensionamento do ecrã de forma diferente. Ativar esta opção irá determinar a escala atual do ecrã e aplicar isso à captura do ecrã no ksnip. GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. GNOME e KDE Plasma suportam as próprias capturas do ecrã do Wayland e Generic XDG-DESKTOP-PORTAL. Ativar esta opção irá forçar o KDE Plasma e o GNOME a usar as capturas do XDG-DESKTOP-PORTAL. A alteração desta opção exige que o ksnip seja reiniciado. Show Main Window after capturing screenshot Exibir janela principal após capturar o ecrã Hide Main Window during screenshot Ocultar a janela principal durante a captura do ecrã Hide Main Window when capturing a new screenshot. Ocultar a janela principal ao capturar uma nova imagem. Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. Mostrar a Janela Principal após uma nova captura quando a Janela Principal foi escondida ou minimizada. ImgurHistoryDialog Imgur History Histórico do Imgur Close Fechar Time Stamp Registro de Data e Hora Link Link Delete Link Apagar Link ImgurUploader Upload to imgur.com finished! Upload para imgur.com concluído! Received new token, trying upload again… Novo token recebido , tentando fazer o upload novamente… Imgur token has expired, requesting new token… O token Imgur expirou, solicitando novo token… ImgurUploaderSettings Force anonymous upload Forçar upload anônimo Always copy Imgur link to clipboard Sempre copiar o link Imgur para a área de transferência Client ID Client ID Client Secret Segredo do cliente PIN PIN Enter imgur Pin which will be exchanged for a token. Digite imgur Pin, que será trocado por um token. Get PIN Obter PIN Get Token Obter Token Imgur History Histórico do Imgur Imgur Uploader Histórico do Imgur Username Nome de utilizador Imgur.com token successfully updated. Token Imgur.com atualizado com sucesso. Imgur.com token update error. Erro na atualização do token Imgur.com. Waiting for imgur.com… Aguardando imgur.com… After uploading open Imgur link in default browser Depois do upload, abrir link do Imgur no navegador padrão Link directly to image Link direto para a imagem Base Url: Url base: Base url that will be used for communication with Imgur. Changing requires restart. Url base que será usado para comunicação com Imgur. Mudança requer reinicialização. Clear Token Limpar Token LoadImageFromFileOperation Unable to open image Incapaz de abrir a imagem Unable to open image from path %1 Incapaz de abrir a imagem do caminho %1 MainToolBar New Novo Delay in seconds between triggering and capturing screenshot. Atraso em segundos entre o acionamento e captura de ecrã. s s Save Salvar Save Screen Capture to file system Gravar captura de ecrã para o sistema de ficheiros Copy Copiar Copy Screen Capture to clipboard Copiar captura de ecrã para a área de transferência Tools Ferramentas Undo Desfazer Redo Refazer Crop Recortar Crop Screen Capture Recortar captura de ecrã MainWindow Unsaved Não salvo Upload Upload Print Imprimir Opens printer dialog and provide option to print image Abrir caixa de diálogo da impressão e fornecer as opções de impressão Print Preview Visualizar impressão Opens Print Preview dialog where the image orientation can be changed Abrir caixa de diálogo Visualizar impressão, onde a orientação da imagem pode ser alterada Scale Redimensionar Quit Sair Settings Configurações &About &Sobre Open Abrir &Edit &Editar &Options &Opções &Help Aj&uda Image Files (*.png *.jpg *.bmp) Ficheiros de imagem (*.png *.jpg *.bmp) Add Watermark Adicionar marca d'água Add Watermark to captured image. Multiple watermarks can be added. Adicionar marca d'água à imagem capturada. Várias marcas d'água podem ser adicionadas. &File &Arquivo Unable to show image Não foi possível exibir a imagem Save As... Salvar como... Paste Colar Paste Embedded Colar incorporado Pin Fixar Pin screenshot to foreground in frameless window Fixar captura de ecrã em primeiro plano na janela sem moldura No image provided but one was expected. Nenhuma imagem fornecida, mas uma era esperada. Copy Path Copiar caminho Open Directory Abrir diretório &View &Exibir Delete Apagar Rename Renomear Open Images Abrir Imagens Show Docks Exibir Docks Hide Docks Ocultar Docks Copy as data URI Copiar como URI de dados Open &Recent Aberto &Recente Modify Canvas Modificar fundo do ecrã Upload triggerCapture to external source Carregar triggerCapture para fonte externa Copy triggerCapture to system clipboard Copiar o triggerCaptura para a área de transferência do sistema Scale Image Escala de Imagem Rotate Rotacionar Rotate Image Rotacionar Imagem MultiCaptureHandler Save Salvar Save As Salvar como Open Directory Abrir Diretório Copy Copiar Copy Path Copiar caminho Delete Apagar Rename Renomear NewCaptureNameProvider Capture Imagem PinWindow Close Fechar Close Other Fechar Outros Close All Fechar Todos PinWindowHandler Pin Window %1 Fixar janela %1 RenameOperation Image Renamed Imagem Renomeada Successfully renamed image to Imagem renomeada com sucesso Image Rename Failed Falhou ao renomear imagem Failed to rename image to Falhou ao renomear imagem para Rename image Renomear imagem New filename: Novo nome do ficheiro: SaveOperation Save As Salvar como Images Imagens All Files Todos os ficheiros Image Saved Imagem salva Saving Image Failed Falha ao salvar imagem Saved to Salvo em Failed to save image to Falha ao salvar a imagem em SaverSettings Automatically save new captures to default location Automaticamente salvar novas capturas para o diretório padrão Prompt to save before discarding unsaved changes Avisar para salvar antes de descartar um trabalho não salvo Remember last Save Directory Lembrar o último diretório onde os arquivos foram salvos When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. Quando ativado, substituirá o diretório de "salvamento" armazenado nas configurações para o diretório mais recente onde foi salvo, isso para cada vez que usar o comando salvar. Capture save location and filename Local e nome do ficheiro para gravar a captura Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. Os formatos suportados são JPG, PNG e BMP. Se nenhum formato for fornecido, o PNG será usado como padrão. O nome do arquivo pode conter os seguintes curingas: - $Y, $M, $D para data, $h, $m, $s para hora ou $T para hora no formato hhmmss. - # múltiplos consecutivos para contador. #### resultará em 0001, a próxima captura será 0002. Browse Selecionar Saver Settings Configurações para Salvar arquivos Capture save location Local para salvar a captura Default Padrão Factor Fator Save Quality Qualidade para salvar Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. Indique 0 para obter pequenos ficheiros compactados, 100 para grandes ficheiros não compactados. Nem todos os formatos de imagem têm suporte a todos os intervalos, o JPEG suporta. ScriptUploaderSettings Copy script output to clipboard Copiar saída do script para a área de transferência Script: Script: Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. Caminho para o script que será chamado para upload. Durante o upload, o script será chamado com o caminho para um ficheiro png temporário como um único argumento. Browse Selecionar Script Uploader Script de Uploader Select Upload Script Selecione o Script para Upload Stop when upload script writes to StdErr Parar quando o script de upload é gravado no StdErr Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. Marca o upload como malsucedido quando o script grava no StdErr. Sem essa configuração, os erros no script não serão notados. Filter: Filtro: RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. Expressão RegEx. Apenas copie para a área de transferência aquilo que corresponda à expressão RegEx. Quando omitido, tudo é copiado. SettingsDialog Settings Configurações OK OK Cancel Cancelar Application Aplicação Image Grabber Captura de Imagem Imgur Uploader Serviço Imgur Annotator Editor HotKeys Teclas de Atalho Uploader Enviador Script Uploader Script de Uploader Saver Salvar Stickers Adesivos Snipping Area Área Retangular Tray Icon Ícone da bandeja Watermark Marca d'água Actions Ações SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Redimensione o retângulo selecionado a usar as alças ou mova-o a arrastar a seleção. Use arrow keys to move the selection. Use as setas para mover a seleção. Use arrow keys while pressing CTRL to move top left handle. Use as seta enquanto pressiona CTRL para mover a alça superior esquerda. Use arrow keys while pressing ALT to move bottom right handle. Use as teclas de seta enquanto pressiona ALT para mover a alça inferior direita. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. Confirmar a seleção a pressionar ENTER/RETURN ou aborte a pressionar ESC. This message can be disabled via settings. Esta mensagem pode ser desativada nas configurações. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Clique e arraste para selecionar uma área retangular ou pressione ESC para sair. Hold CTRL pressed to resize selection after selecting. Mantenha CTRL pressionado para redimensionar a seleção após selecionar. Hold CTRL pressed to prevent resizing after selecting. Mantenha CTRL pressionado para evitar o redimensionamento após selecionar. Operation will be canceled after 60 sec when no selection made. A operação será cancelada após 60 segundos quando nenhuma seleção for feita. This message can be disabled via settings. Esta mensagem pode ser desativada nas configurações. SnippingAreaSettings Freeze Image while snipping Congelar imagem ao capturar área retangular When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. Quando ativado irá congelar o fundo enquanto a selecionar uma área retangular. Também muda o comportamento de capturas do ecrã atrasadas, com esta opção ativada o atraso acontece antes da área retangular ser exibida e com a opção desativada o atraso acontece depois que a área retangular é exibida. Este recurso está sempre desativado para Wayland e sempre ativado para MacOs. Show magnifying glass on snipping area Exibir lupa ao capturar área retangular Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. Exibir uma lupa que mostra zoom na imagem de fundo. Esta opção só funciona com 'Congelar imagem ao capturar área retangular' ativada. Show Snipping Area rulers Exibir réguas ao capturar área retangular Horizontal and vertical lines going from desktop edges to cursor on snipping area. Uma linha horizontal e vertical será exibida antes de iniciar a captura de uma área retangular. Show Snipping Area position and size info Exibir posição e tamanho ao capturar área retangular When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. Quando o botão esquerdo do rato não é pressionado a posição é exibida, quando o botão do rato é pressionado, o tamanho da área selecionada é exibido à esquerda e acima da área capturada. Allow resizing rect area selection by default Permitir redimensionamento da seleção da área retangular por padrão When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. Quando ativado, após selecionar uma área retangular, permite redimensionar a seleção. Quando realizado o redimensionamento a seleção pode ser confirmada a pressionar Enter. Show Snipping Area info text Mostrar texto de informação para área retangular Snipping Area cursor color Cor do cursor ao capturar área retangular Sets the color of the snipping area cursor. Define a cor do cursor da área retangular. Snipping Area cursor thickness Espessura do cursor ao capturar área retangular Sets the thickness of the snipping area cursor. Define a espessura do cursor da área retangular. Snipping Area Área Retangular Snipping Area adorner color Cor das bordas da área de recorte Sets the color of all adorner elements on the snipping area. Define a cor de todos as bordas na área de retangular. Snipping Area Transparency Transparência da área retangular Alpha for not selected region on snipping area. Smaller number is more transparent. Alfa para região não selecionada na área retangular. O número menor é mais transparente. StickerSettings Up Subir Down Descer Use Default Stickers Usar adesivos padrão Sticker Settings Configurações de Adesivos Vector Image Files (*.svg) Ficheiros de imagem vetorial (*.svg) Add Adicionar Remove Remover Add Stickers Adicionar adesivos TrayIcon Show Editor Exibir Editor TrayIconSettings Use Tray Icon Usar ícone da bandeja When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. Quando ativado, adiciona um ícone de bandeja na barra de tarefas, se o gestor de janelas do SO oferecer suporte. A mudança requer reinicialização. Minimize to Tray Minimizar para a Bandeja Start Minimized to Tray Iniciar Minimizado na Bandeja Close to Tray Fechar para a Bandeja Show Editor Exibir Editor Capture Capturar Default Tray Icon action Ação padrão do ícone da bandeja Default Action that is triggered by left clicking the tray icon. Ação padrão que é disparada a clicar com o botão esquerdo do rato no ícone da bandeja. Tray Icon Settings Configurações do ícone da bandeja Display Tray icon notifications Exibir notificações na bandeja Use platform specific notification service Usar o serviço de notificação específico da plataforma When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. Quando ativado, tentará usar o serviço de notificação específico da plataforma, quando tal existir. A mudança requer reinicialização para ter efeito. UpdateWatermarkOperation Select Image Selecione uma imagem Images Imagens All Files Todos os ficheiros UploadOperation Upload Script Required Script de Upload Requerido Please add an upload script via Options > Settings > Upload Script Adicione um script de upload em Opções> Configurações> Script de Uploader Capture Upload Capturar Upload You are about to upload the image to an external destination, do you want to proceed? Você está prestes a enviar a imagem para um destino externo. Deseja continuar? UploaderSettings Ask for confirmation before uploading Confirmar antes de fazer o upload Uploader Type: Tipo de Uploader: Imgur Imgur Script Script Uploader Enviador VersionTab Version Versão Build Compilação Using: Utilizando: WatermarkSettings Watermark Image Imagem de marca d'água Update Atualizar Rotate Watermark Girar marca d'água When enabled, Watermark will be added with a rotation of 45° Quando ativado, a marca d'água será adicionada com rotação de 45º Watermark Settings Configurações de Marca d'água ksnip-1.9.2/translations/ksnip_pt_BR.ts000066400000000000000000001661241414701001100201510ustar00rootroot00000000000000 AboutDialog About Sobre About Sobre Version Versão Author Autor Close Fechar Donate Doar Contact Contato AboutTab License: Licença: Screenshot and Annotation Tool Ferramenta de captura de tela e anotação ActionSettingTab Name Nome Shortcut Atalho Clear Limpar Take Capture Fazer Captura Include Cursor Incluir Cursor Delay Atraso s s Capture Mode Modo de Captura Show image in Pin Window Mostrar imagem na janela de pinada Copy image to Clipboard Copiar imagem para a área de transferência Upload image Enviar Imagem Open image parent directory Abrir o diretório da imagem Save image Salvar imagem Hide Main Window Ocultar Janela Principal ActionsSettings Add Adicionar Actions Settings Configurações de Ações Action Ação AddWatermarkOperation Watermark Image Required Marca d'água Obrigatória Please add a Watermark Image via Options > Settings > Annotator > Update Por favor, adicione uma marca d'água em: Opções > Configurações > Editor > Atualizar AnnotationSettings Smooth Painter Paths Suavizar Traços When enabled smooths out pen and marker paths after finished drawing. Quando ativado, suaviza a caneta e o marcador após finalizar o desenho. Smooth Factor Fator de Suavização Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. Incrementar o fator de suavização diminuirá a precisão da caneta e do marcador, mas irá torná-los mais suaves. Annotator Settings Configurações do Editor Remember annotation tool selection and load on startup Lembrar da ferramenta de anotação selecionada e carregue na inicialização Switch to Select Tool after drawing Item Mudar para ferramenta de seleção após desenhar o item Number Tool Seed change updates all Number Items Mudança na Ferramenta atualiza todos os itens número Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. Desativar esta opção causa mudanças na ferramenta número para afetar apenas novos itens, mas não os itens existentes. Desativar esta opção permite ter números duplicados. Canvas Color Cor de fundo da Tela Default Canvas background color for annotation area. Changing color affects only new annotation areas. Cor de fundo padrão da tela para a área de anotação. Alterar a cor afeta apenas novas áreas de anotação. Select Item after drawing Selecione o item após o desenho With this option enabled the item gets selected after being created, allowing changing settings. Com esta opção habilitada, o item é selecionado após ter sido criado, permitindo a alteração de configurações. ApplicationSettings Capture screenshot at startup with default mode Capturar a tela ao iniciar utilizando o modo padrão de captura Application Style Estilo da Aplicação Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. Define o estilo da aplicação que determina a aparência da interface gráfica. Requer reiniciar o ksnip para aplicar as mudanças. Application Settings Configurações da Aplicação Automatically copy new captures to clipboard Automaticamente copiar novas capturas para a área de transferência Use Tabs Usar Abas Change requires restart. A mudança requer reinicialização. Run ksnip as single instance Executar o ksnip como instância única Remember Main Window position on move and load on startup Lembrar da posição da janela principal ao mover e carregar na inicialização Hide Tabbar when only one Tab is used. Ocultar a barra de abas quando apenas uma aba for usada. Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. Ativar esta opção permitirá que apenas uma instância do ksnip funcione, todas as outras instâncias iniciadas após a primeira passarão seus argumentos para a primeira e fechar. Alterar esta opção requer um novo início de todas as instâncias. Auto hide Tabs Ocultar abas automaticamente Auto hide Docks Auto ocultar Docks On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. Na inicialização, oculte as configurações de barra de ferramentas e anotações. A visibilidade das Docks pode ser alternada com a tecla Tab. Auto resize to content Redimensionar automaticamente para o conteúdo Automatically resize Main Window to fit content image. Redimensionar automaticamente a janela principal para se ajustar a imagem. AuthorTab Contributors: Contribuidores: Spanish Translation Tradução para Espanhol Dutch Translation Tradução para Holandês Russian Translation Tradução para Russo Norwegian Bokmål Translation Tradução para Norueguês Bokmål French Translation Tradução para Francês Polish Translation Tradução para Polonês The Authors: Autores: Snap & Flatpak Support Suporte para Snap e Flatpak CanDiscardOperation Warning - Aviso - The capture %1%2%3 has been modified. Do you want to save it? A captura %1%2%3 foi modificada. Deseja salvá-la? CaptureModePicker New Novo Draw a rectangular area with your mouse Desenhar uma área retangular com o mouse Capture full screen including all monitors Capturar tela inteira incluindo todos os monitores Capture screen where the mouse is located Capturar a tela onde o mouse está localizado Capture window that currently has focus Capturar a janela em foco Capture that is currently under the mouse cursor Capturar o que está sob o cursor do mouse Capture a screenshot of the last selected rectangular area Realizar uma captura de tela da última área retangular selecionada Uses the screenshot Portal for taking screenshot Usa o portal de captura de tela para obter a imagem ContactTab Community Comunidade If you have general questions, ideas or just want to talk about ksnip, Se você tiver dúvidas gerais, idéias ou apenas quiser falar sobre o ksnip, please join our por favor junte-se ao nosso server. servidor. Bug Reports Relatório de erros Please use Por favor, use to report bugs. para relatar bugs. CopyAsDataUriOperation Failed to copy to clipboard Falha ao copiar para a área de transferência Failed to copy to clipboard as base64 encoded image. Falha ao copiar para a área de transferência como imagem codificada em base64. Copied to clipboard Copiado para a área de transferência Copied to clipboard as base64 encoded image. Copiado para a área de transferência como imagem codificada em base64. DeleteImageOperation Delete Image Excluir imagem The item '%1' will be deleted. Do you want to continue? O item '%1' será excluído. Deseja continuar? DonateTab here aqui Also possible, Também é possível, Donations are always welcome Doações são sempre bem-vindas Donation Doação ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. Ksnip é um projeto de software livre sem fins lucrativos com copyleft, e <br/>ainda tem alguns custos que precisam ser cobertos,<br/>como custos de domínio ou custos de hardware para suporte multiplataforma. If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that Se quiser ajudar ou apenas<br/>apreciar o trabalho que está sendo feito<br/>oferecendo uma cerveja ou café aos desenvolvedores, você pode fazer isso Become a GitHub Sponsor Seja um patrocinador do GitHub EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. Adicionar novas ações pressionando o botão da guia 'Adicionar'. EnumTranslator Rectangular Area Área retangular Last Rectangular Area Última Área Retangular Full Screen (All Monitors) Tela cheia (Todos os monitores) Current Screen Tela atual Active Window Janela Ativa Window Under Cursor Janela Sob o Cursor Screenshot Portal Portal de captura de tela HandleUploadResultOperation Upload Successful Enviado com Sucesso Upload script Upload script finished successfully. terminou com sucesso. Uploaded to Enviado para Unable to save temporary image for upload. Não foi possível salvar a imagem temporária para envio. Unable to start process, check path and permissions. Não foi possível iniciar o processo, verifique o caminho e as permissões. Process crashed Processo travado Process timed out. O tempo limite do processo expirou. Process read error. Erro no processo de leitura. Process write error. Erro no processo de gravação. Web error, check console output. Erro na Web, verifique a saída do console. Unknown process error. Erro desconhecido. Upload Failed Falha no envio Script wrote to StdErr. Script escrito para StdErr. HotKeySettings Enable Global HotKeys Ativar as teclas de atalho globais Capture Rect Area Captura de Área retangular Capture Full Screen Captura da Tela cheia Capture current Screen Captura da Tela atual Capture active Window Captura da Janela ativa Capture Window under Cursor Captura da Janela sob o mouse Global HotKeys Teclas de Atalho Globais Capture Last Rect Area Captura da Última área retangular Clear Apagar Capture using Portal Capturar usando o Portal HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. Atualmente, as teclas de atalho são suportadas apenas para Windows e X11. Desabilitar esta opção também torna os atalhos de ação apenas no ksnip. ImageGrabberSettings Capture mouse cursor on screenshot Capturar o cursor do mouse na captura de tela Should mouse cursor be visible on screenshots. O cursor do mouse estará visível nas capturas de tela. Image Grabber Captura de Imagem Show Main Window after capturing screenshot Mostrar janela principal após a captura da tela Force Generic Wayland Screenshot Forçar captura de tela genérico para Wayland GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. GNOME e KDE Plasma suportam suas próprias capturas de tela do Wayland e Generic XDG-DESKTOP-PORTAL. Ativar esta opção irá forçar o KDE Plasma e o GNOME a usar as capturas do XDG-DESKTOP-PORTAL. A alteração desta opção exige que o ksnip seja reiniciado. Scale Generic Wayland Screenshots Captura de tela com escala genérica para Wayland Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. Implementações genéricas do Wayland que utilizam o XDG-DESKTOP-PORTAL lidam com o dimensionamento de tela de forma diferente. Ativar esta opção irá determinar a escala atual da tela e aplicar isso à captura de tela no ksnip. Hide Main Window during screenshot Ocultar a janela principal durante a captura da imagem Hide Main Window when capturing a new screenshot. Ocultar a janela principal ao capturar uma nova imagem. Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. Mostrar a Janela Principal após capturar uma nova imagem quando a Janela Principal for ocultada ou minimizada. ImgurHistoryDialog Imgur History Histórico do Imgur Close Fechar Time Stamp Registro de Data e Hora Link Link Delete Link Excluir Link ImgurUploader Upload to imgur.com finished! Envio para imgur.com concluído! Received new token, trying upload again… Novo token recebido, tentando enviar novamente… Imgur token has expired, requesting new token… O token Imgur expirou, solicitando novo token… ImgurUploaderSettings Force anonymous upload Forçar envio anônimo Always copy Imgur link to clipboard Sempre copiar o link de Imgur para a área de transferência Client ID Client ID Client Secret Client Secret PIN PIN Enter imgur Pin which will be exchanged for a token. Digite o Pin do imgur Pin, que será trocado por um token. Get PIN Obter PIN Get Token Obter Token Imgur History Histórico do Imgur Imgur Uploader Uploader do Imgur Username Nome de usuário Waiting for imgur.com… Aguardando imgur.com… Imgur.com token successfully updated. Token Imgur.com atualizado com sucesso. Imgur.com token update error. Erro na atualização do token Imgur.com. After uploading open Imgur link in default browser Depois de enviar, abrir link do Imgur no navegador padrão Link directly to image Link direto para a imagem Base Url: Url base: Base url that will be used for communication with Imgur. Changing requires restart. Url base que será usado para comunicação com Imgur. Mudança requer reinicialização. Clear Token Limpar Token LoadImageFromFileOperation Unable to open image Incapaz de abrir a imagem Unable to open image from path %1 Incapaz de abrir a imagem do caminho %1 MainToolBar New Novo Delay in seconds between triggering and capturing screenshot. Atraso em segundos entre o acionamento e captura de tela. s s Save Salvar Save Screen Capture to file system Salvar captura de tela nos arquivos Copy Copiar Copy Screen Capture to clipboard Copiar captura de tela para a área de transferência Tools Ferramentas Undo Desfazer Redo Refazer Crop Recortar Crop Screen Capture Recortar captura de tela MainWindow Unsaved Não salvo Upload Enviar Print Imprimir Opens printer dialog and provide option to print image Abrir caixa de diálogo da impressão e fornecer as opções de impressão Print Preview Visualizar impressão Opens Print Preview dialog where the image orientation can be changed Abrir caixa de diálogo Visualizar impressão, onde a orientação da imagem pode ser alterada Scale Redimensionar Quit Sair Settings Configurações &About &Sobre Open Abrir &Edit &Editar &Options &Opções &Help Aj&uda Image Files (*.png *.jpg *.bmp) Arquivos de imagem (*.png *.jpg *.bmp) Add Watermark Adicionar marca d'água Add Watermark to captured image. Multiple watermarks can be added. Adicionar marca d'água à imagem capturada. Várias marcas d'água podem ser adicionadas. &File &Arquivo Unable to show image Não foi possível exibir a imagem Save As... Salvar como... Paste Colar Paste Embedded Colar Aqui No image provided but one was expected. Nenhuma imagem fornecida, mas uma era esperada. Copy Path Copiar caminho Rename Renomear Open Directory Abrir pasta Pin Pinar Pin screenshot to foreground in frameless window Pinar a captura de tela no primeiro plano de uma janela sem moldura Delete Excluir &View &Exibir Open Images Abrir imagens Show Docks Exibir Docks Hide Docks Ocultar Docks Copy as data URI Copiar como URI de dados Open &Recent Aberto &Recente Modify Canvas Modificar fundo de tela Upload triggerCapture to external source Carregar captura para fonte externa Copy triggerCapture to system clipboard Copiar captura para a área de transferência do sistema Scale Image Escala de Imagem Rotate Rotacionar Rotate Image Rotacionar Imagem MultiCaptureHandler Save Salvar Save As Salvar como Rename Renomear Open Directory Abrir pasta Copy Copiar Copy Path Copiar caminho Delete Excluir NewCaptureNameProvider Capture Imagem PinWindow Close Fechar Close Other Fechar outro Close All Fechar tudo PinWindowHandler Pin Window %1 Pinar janela %1 RenameOperation Image Renamed Imagem renomeada Successfully renamed image to Imagem renomeada com sucesso para Image Rename Failed Ocorreu um erro ao renomear a imagem Failed to rename image to Ocorreu um erro ao renomear a imagem para Rename image Renomear imagem New filename: Novo nome do arquivo: SaveOperation Save As Salvar como Images Imagens All Files Todos os arquivos Image Saved Imagem salva Saving Image Failed Falha ao salvar imagem Saved to Salvo em Failed to save image to Falha ao salvar a imagem em SaverSettings Automatically save new captures to default location Automaticamente salvar novas capturas na pasta padrão Prompt to save before discarding unsaved changes Avisar para salvar antes de descartar um trabalho não salvo Remember last Save Directory Lembrar a Última Pasta Salva When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. Quando ativado, substituirá a pasta armazenada nas configurações pela pasta mais recente salva, toda vez que salvar. Capture save location and filename Local e nome do arquivo para salvar a captura Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. Os formatos suportados são JPG, PNG e BMP. Se nenhum formato for fornecido, o PNG será usado como padrão. O nome do arquivo pode conter os seguintes curingas: - $Y, $M, $D para data, $h, $m, $s para hora ou $T para hora no formato hhmmss. - # múltiplos consecutivos para contador. #### resultará em 0001, a próxima captura será 0002. Browse Selecionar Saver Settings Configurações para Salvar arquivos Capture save location Local para salvar a captura Default Padrão Factor Fator Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. Indique 0 para obter pequenos arquivos compactados, 100 para grandes arquivos não compactados. Nem todos os formatos de imagem têm suporte a todos os intervalos, o JPEG suporta. Save Quality Qualidade para salvar ScriptUploaderSettings Copy script output to clipboard Copiar saída do script para a área de transferência Script: Script: Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. Caminho para o script que será chamado para upload. Durante o upload, o script será chamado com o caminho para um arquivo png temporário como um único argumento. Browse Selecionar Script Uploader Script de Uploader Select Upload Script Selecione o Script para Envio Stop when upload script writes to StdErr Parar quando o script de upload é gravado no StdErr Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. Marca o upload como falha quando o script escreve em StdErr. Sem essa configuração, os erros no script passarão despercebidos. Filter: Filtro: RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. Expressão Regulares. Copie para a área de transferência apenas o que corresponde à expressão RegEx. Quando omitido, tudo é copiado. SettingsDialog Settings Configurações OK OK Cancel Cancelar Image Grabber Captura de Imagem Imgur Uploader Uploader Imgur Application Aplicação Annotator Editor HotKeys Teclas de Atalho Uploader Uploader Script Uploader Script de Uploader Saver Salvar Stickers Figurinhas Snipping Area Área Retangular Tray Icon Ícone da bandeja Watermark Marca d'água Actions Ações SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Redimensione o retângulo selecionado usando as alças ou mova-o arrastando a seleção. Use arrow keys to move the selection. Use as setas para mover a seleção. Use arrow keys while pressing CTRL to move top left handle. Use as seta enquanto pressiona CTRL para mover a alça superior esquerda. Use arrow keys while pressing ALT to move bottom right handle. Use as teclas de seta enquanto pressiona ALT para mover a alça inferior direita. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. Confirmar a seleção pressionando ENTER/RETURN ou aborte pressionando ESC. This message can be disabled via settings. Esta mensagem pode ser desativada nas configurações. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Clique e arraste para selecionar uma área retangular ou pressione ESC para sair. Hold CTRL pressed to resize selection after selecting. Mantenha CTRL pressionado para redimensionar a seleção após selecionar. Hold CTRL pressed to prevent resizing after selecting. Mantenha CTRL pressionado para evitar o redimensionamento após selecionar. Operation will be canceled after 60 sec when no selection made. A operação será cancelada após 60 segundos quando nenhuma seleção for feita. This message can be disabled via settings. Esta mensagem pode ser desativada nas configurações. SnippingAreaSettings Freeze Image while snipping Congelar imagem ao capturar área retangular When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. Quando ativado irá congelar o fundo enquanto selecionando uma área retangular. Também muda o comportamento de capturas de tela atrasadas, com esta opção habilitada o atraso acontece antes da área retangular ser exibida e com a opção desativada o atraso acontece depois que a área retangular é exibida. Este recurso está sempre desabilitado para Wayland e sempre habilitado para MacOs. Show magnifying glass on snipping area Exibir lupa ao capturar área retangular Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. Exibir uma lupa que mostra zoom na imagem de fundo. Esta opção só funciona com 'Congelar imagem ao capturar área retangular' habilitada. Show Snipping Area rulers Exibir réguas ao capturar área retangular Horizontal and vertical lines going from desktop edges to cursor on snipping area. Uma linha horizontal e vertical será exibida antes de iniciar a captura de uma área retangular. Show Snipping Area position and size info Exibir posição e tamanho ao capturar área retangular When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. Quando o botão esquerdo do mouse não é pressionado a posição é exibida, quando o botão do mouse é pressionado, o tamanho da área selecionada é exibido à esquerda e acima da área capturada. Allow resizing rect area selection by default Permitir redimensionamento da seleção da área retangular por padrão When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. Quando ativado, após selecionar uma área retangular, permite redimensionar a seleção. Quando realizado o redimensionamento a seleção pode ser confirmada pressionando Enter. Show Snipping Area info text Mostrar texto de informação para área retangular Snipping Area cursor color Cor do cursor ao capturar área retangular Sets the color of the snipping area cursor. Define a cor do cursor da área retangular. Snipping Area cursor thickness Espessura do cursor ao capturar área retangular Sets the thickness of the snipping area cursor. Define a espessura do cursor da área retangular. Snipping Area Área Retangular Snipping Area adorner color Cor das bordas da área de recorte Sets the color of all adorner elements on the snipping area. Define a cor de todos as bordas na área de retangular. Snipping Area Transparency Transparência da área retangular Alpha for not selected region on snipping area. Smaller number is more transparent. Alfa para região não selecionada na área retangular. O número menor é mais transparente. StickerSettings Up Subir Down Descer Use Default Stickers Usar Figurinhas Padrão Sticker Settings Configurações de Figurinhas Vector Image Files (*.svg) Arquivos de Imagem Vetorial (*.svg) Add Adicionar Remove Remover Add Stickers Adicionar Figurinhas TrayIcon Show Editor Exibir Editor TrayIconSettings Use Tray Icon Usar ícone da bandeja When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. Quando ativado, adiciona um ícone de bandeja na barra de tarefas, se o gerenciador de janelas do SO oferecer suporte. A mudança requer reinicialização. Minimize to Tray Minimizar para a Bandeja Start Minimized to Tray Iniciar Minimizado na Bandeja Close to Tray Fechar para a Bandeja Show Editor Exibir Editor Capture Capturar Default Tray Icon action Ação padrão do ícone da bandeja Default Action that is triggered by left clicking the tray icon. Ação padrão que é disparada clicando com o botão esquerdo do mouse no ícone da bandeja. Tray Icon Settings Configurações do ícone da bandeja Display Tray icon notifications Exibir notificações na bandeja Use platform specific notification service Usar o serviço de notificação específico da plataforma When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. Quando ativado, tentará usar o serviço de notificação específico da plataforma, quando tal existir. A mudança requer reinicialização para ter efeito. UpdateWatermarkOperation Select Image Selecione uma imagem Images Imagens All Files Todos os Arquivos UploadOperation Upload Script Required Script de Upload Requerido Please add an upload script via Options > Settings > Upload Script Adicione um script de envio em Opções> Configurações> Script de Envio Capture Upload Capturar Envio You are about to upload the image to an external destination, do you want to proceed? Você está prestes a enviar a imagem para um destino externo. Deseja continuar? UploaderSettings Ask for confirmation before uploading Confirmar antes de enviar Uploader Type: Tipo de Uploader: Imgur Imgur Script Script Uploader Uploader VersionTab Version Versão Build Compilação Using: Utilizando: WatermarkSettings Watermark Image Imagem de marca d'água Update Atualizar Rotate Watermark Girar marca d'água When enabled, Watermark will be added with a rotation of 45° Quando ativado, a marca d'água será adicionada com rotação de 45º Watermark Settings Configurações de Marca d'água ksnip-1.9.2/translations/ksnip_ro.ts000066400000000000000000001523541414701001100175630ustar00rootroot00000000000000 AboutDialog About Despre About Despre Version Versiune Author Autor Close Închide Donate Donează Contact Contact AboutTab License: Licență: Screenshot and Annotation Tool Unealtă pentru capturi de ecran și adnotări ActionSettingTab Name Denumire Shortcut Scurtătură Clear Curăță Take Capture Fă o captură Include Cursor Include cursorul Delay Întârziere s s Capture Mode Regim captură Show image in Pin Window Copy image to Clipboard Copiază imaginea în clipboard Upload image Încarcă imaginea Open image parent directory Deschide dosarul părinte al imaginii Save image Salvează imaginea Hide Main Window Ascunde fereastra principală ActionsSettings Add Adaugă Actions Settings Configurări acțiune Action Acțiune AddWatermarkOperation Watermark Image Required Imagine-filigran necesară Please add a Watermark Image via Options > Settings > Annotator > Update Adăugați o imagine-filigran în Opțiuni > Configurări > Adnotator > Actualizează AnnotationSettings Smooth Painter Paths Netezește căile pictorului When enabled smooths out pen and marker paths after finished drawing. Smooth Factor Factor de netezime Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. Annotator Settings Configurări adnotator Remember annotation tool selection and load on startup Ține minte selecția uneltei de adnotare și încarc-o la lansare Switch to Select Tool after drawing Item Schimbă la unealta de selecție după desenarea elementului Number Tool Seed change updates all Number Items Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. Canvas Color Culoare canava Default Canvas background color for annotation area. Changing color affects only new annotation areas. Select Item after drawing Alege elementul după desenare With this option enabled the item gets selected after being created, allowing changing settings. ApplicationSettings Capture screenshot at startup with default mode Fă o captură la pornire cu regimul implicit Application Style Stil aplicație Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. Application Settings Configurări aplicație Automatically copy new captures to clipboard Copiază automat noua captură în clipboard Use Tabs Folosește file Change requires restart. Schimbarea necesită repornire. Run ksnip as single instance Rulează KSnip ca instanță unică Hide Tabbar when only one Tab is used. Ascunde bara de file când e folosită doar o filă. Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. Remember Main Window position on move and load on startup Ține minte poziția ferestrei principale la mutare și încarc-o la lansare Auto hide Tabs Ascunde filele automat Auto hide Docks Ascunde andocările automat On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. Auto resize to content Redimensionează automat la conținut Automatically resize Main Window to fit content image. Redimensionează automat fereastra principală să se potrivească cu conținutul. AuthorTab Contributors: Contribuitori: Spanish Translation Traducere spaniolă Dutch Translation Traducere olandeză Russian Translation Traducere rusă Norwegian Bokmål Translation Traducere norvegiană Bokmål French Translation Traducere franceză Polish Translation Traducere poloneză Snap & Flatpak Support Suport pentru Snap și Flatpak The Authors: Autorii: CanDiscardOperation Warning - Avertisment – The capture %1%2%3 has been modified. Do you want to save it? Captura %1%2%3 a fost modificată. Doriți să o salvați? CaptureModePicker New Nou Draw a rectangular area with your mouse Desenați o zonă dreptunghiulară cu mausul Capture full screen including all monitors Capturează ecran complet incluzând toate monitoarele Capture screen where the mouse is located Capturează ecranul pe care e mausul Capture window that currently has focus Capturează fereastra care e focalizată acum Capture that is currently under the mouse cursor Capturează ce e acum sub cursorul mausului Capture a screenshot of the last selected rectangular area Fă o captură a ultimei zone dreptunghiulare alese Uses the screenshot Portal for taking screenshot ContactTab Community Comunitate If you have general questions, ideas or just want to talk about ksnip, Dacă aveți întrebări generale, idei sau vreți doar să discutați despre ksnip, please join our alăturați-vă server. serverului nostru. Bug Reports Rapoarte de defecte Please use Folosiți to report bugs. pentru a raporta erori. CopyAsDataUriOperation Failed to copy to clipboard Copierea în clipboard a eșuat Failed to copy to clipboard as base64 encoded image. Copierea în clipboard ca imagine codată cu base64 a eșuat. Copied to clipboard Copiat în clipboard Copied to clipboard as base64 encoded image. Copiat în clipboard ca imagine codată cu base64. DeleteImageOperation Delete Image Șterge imaginea The item '%1' will be deleted. Do you want to continue? Elementul „%1” va fi șters. Doriți să continuați? DonateTab here aici Also possible, Donations are always welcome Donațiile sunt binevenite mereu Donation Donație Become a GitHub Sponsor Deveniți sponsor pe GitHub ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. Adăugați acțiuni noi apăsând pe butonul „Adaugă” de pe filă. EnumTranslator Rectangular Area Zonă dreptunghiulară Last Rectangular Area Ultima zonă dreptunghiulară Full Screen (All Monitors) Ecran complet (toate monitoarele) Current Screen Ecranul actual Active Window Fereastra activă Window Under Cursor Fereastra de sub cursor Screenshot Portal HandleUploadResultOperation Upload Successful Încărcare reușită Upload script finished successfully. Uploaded to Încărcat la Unable to save temporary image for upload. Unable to start process, check path and permissions. Process crashed Procesul a eșuat Process timed out. Procesul a expirat. Process read error. Process write error. Web error, check console output. Unknown process error. Upload Failed Încărcarea a eșuat Script wrote to StdErr. HotKeySettings Enable Global HotKeys Activează scurtături globale Capture Rect Area Capture Full Screen Capturează ecran complet Capture current Screen Capturează ecranul actual Capture active Window Capturează fereastra activă Capture Window under Cursor Capturează fereastra de sub cursor Global HotKeys Scurtături globale Capture Last Rect Area Clear Curăță Capture using Portal Capturează folosind Portalul HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. ImageGrabberSettings Capture mouse cursor on screenshot Capturează cursorul mausului Should mouse cursor be visible on screenshots. Image Grabber Acaparator de imagini Force Generic Wayland Screenshot Scale Generic Wayland Screenshots Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. Show Main Window after capturing screenshot Arată fereastra principală după capturare Hide Main Window during screenshot Ascunde fereastra principală în timpul capturării Hide Main Window when capturing a new screenshot. Ascunde fereastra principală în timpul capturării ecranului. Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. ImgurHistoryDialog Imgur History Istoric Imgur Close Închide Time Stamp Ștampilă temporală Link Legătură Delete Link Șterge legătura ImgurUploader Upload to imgur.com finished! Received new token, trying upload again… Imgur token has expired, requesting new token… ImgurUploaderSettings Force anonymous upload Forțează încărcare anonimă Always copy Imgur link to clipboard Copiază mereu legătura Imgur în clipboard Client ID Id. client Client Secret Secret client PIN PIN Enter imgur Pin which will be exchanged for a token. Get PIN Obține PIN-ul Get Token Obține jetonul Imgur History Istoric Imgur Imgur Uploader Încărcător Imgur Username Utilizator Waiting for imgur.com… Se așteaptă imgur.com… Imgur.com token successfully updated. Jeton imgur.com actualizat cu succes. Imgur.com token update error. Eroare la actualizarea jetonului imgur.com. After uploading open Imgur link in default browser Link directly to image Leagă direct la imagine Base Url: URL de bază: Base url that will be used for communication with Imgur. Changing requires restart. Clear Token Curăță jetonul LoadImageFromFileOperation Unable to open image Nu s-a putut deschide imaginea Unable to open image from path %1 Nu s-a putut deschide imaginea de la calea %1 MainToolBar New Nou Delay in seconds between triggering and capturing screenshot. s s Save Salvează Save Screen Capture to file system Salvează captura ecranului în sistemul de fișiere Copy Copiază Copy Screen Capture to clipboard Copiază captura de ecran în clipboard Tools Unelte Undo Desfă Redo Refă Crop Decupează Crop Screen Capture Decupează captura de ecran MainWindow Unsaved Nesalvat Upload Încarcă Print Tipărește Opens printer dialog and provide option to print image Print Preview Previzualizare tipărire Opens Print Preview dialog where the image orientation can be changed Scale Scalează Quit Termină Settings Configurări &About &Despre Open Deschide &Edit &Editare &Options &Opțiuni &Help &Ajutor Image Files (*.png *.jpg *.bmp) Fișiere cu imagini (*png *.jpg *.bmp) Add Watermark Adaugă filigran Add Watermark to captured image. Multiple watermarks can be added. &File &Fișier Unable to show image Nu s-a putut arăta imaginea Save As... Salvează ca… Paste Lipește Paste Embedded Pin Fixează Pin screenshot to foreground in frameless window No image provided but one was expected. Copy Path Copiază calea Open Directory Deschide dosar &View &Vizualizare Delete Șterge Rename Redenumește Open Images Deschide imagini Show Docks Arată andocări Hide Docks Ascunde andocări Copy as data URI Copiază datele ca URI Open &Recent Deschide &recent Modify Canvas Modifică canavaua Upload triggerCapture to external source Copy triggerCapture to system clipboard Scale Image Scalează imaginea Rotate Rotește Rotate Image Rotește imaginea MultiCaptureHandler Save Salvează Save As Salvează ca Open Directory Deschide dosar Copy Copiază Copy Path Copiază calea Delete Șterge Rename Redenumește NewCaptureNameProvider Capture Captură PinWindow Close Închide Close Other Închide celelalte Close All Închide toate PinWindowHandler Pin Window %1 RenameOperation Image Renamed Imagine redenumită Successfully renamed image to Image Rename Failed Redenumirea imaginii a eșuat Failed to rename image to Rename image Redenumește imaginea New filename: Denumire nouă: SaveOperation Save As Salvează ca Images Imagini All Files Toate fișierele Image Saved Imagine salvată Saving Image Failed Salvarea imaginii a eșuat Saved to Salvat în Failed to save image to SaverSettings Automatically save new captures to default location Prompt to save before discarding unsaved changes Remember last Save Directory Ține minte ultimul dosar de salvare When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. Capture save location and filename Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. Browse Răsfoiește Saver Settings Capture save location Locul salvării capturilor Default Implicit Factor Factor Save Quality Calitate salvare Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. ScriptUploaderSettings Copy script output to clipboard Script: Script: Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. Browse Răsfoiește Script Uploader Select Upload Script Stop when upload script writes to StdErr Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. Filter: Filtru: RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. SettingsDialog Settings Configurări OK Bine Cancel Renunță Image Grabber Acaparator de imagini Imgur Uploader Încărcător Imgur Application Aplicație Annotator Adnotator HotKeys Scurtături Uploader Încărcător Script Uploader Saver Stickers Autocolante Snipping Area Tray Icon Pictogramă în tavă Watermark Filigran Actions Acțiuni SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Use arrow keys to move the selection. Use arrow keys while pressing CTRL to move top left handle. Use arrow keys while pressing ALT to move bottom right handle. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. This message can be disabled via settings. Acest mesaj poate fi dezactivat în configurări. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Hold CTRL pressed to resize selection after selecting. Hold CTRL pressed to prevent resizing after selecting. Operation will be canceled after 60 sec when no selection made. This message can be disabled via settings. Acest mesaj poate fi dezactivat în configurări. SnippingAreaSettings Freeze Image while snipping Îngheață imaginea la tăiere When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. Show magnifying glass on snipping area Arată lupa pe zona tăieturii Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. Show Snipping Area rulers Horizontal and vertical lines going from desktop edges to cursor on snipping area. Show Snipping Area position and size info When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. Allow resizing rect area selection by default When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. Show Snipping Area info text Snipping Area cursor color Sets the color of the snipping area cursor. Snipping Area cursor thickness Sets the thickness of the snipping area cursor. Snipping Area Zona tăieturii Snipping Area adorner color Sets the color of all adorner elements on the snipping area. Snipping Area Transparency Transparența zonei tăieturii Alpha for not selected region on snipping area. Smaller number is more transparent. Alfa pentru regiunea nealeasă în zona tăieturii. Numerele mai mici sunt mai transparente. StickerSettings Up Sus Down Jos Use Default Stickers Folosește autocolante implicite Sticker Settings Configurări autocolante Vector Image Files (*.svg) Fișiere cu imagini vectoriale (*.svg) Add Adaugă Remove Elimină Add Stickers Adaugă autocolante TrayIcon Show Editor Arată redactorul TrayIconSettings Use Tray Icon Folosește pictogramă în tavă When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. Când e activată, va adăuga o pictogramă în tava de sistem dacă gestionarul de ferestre o susține. Modificarea necesită repornire. Minimize to Tray Minimizează în tavă Start Minimized to Tray Pornește minimizat în tavă Close to Tray Închide în tavă Show Editor Arată redactorul Capture Captură Default Tray Icon action Acțiune implicită pentru pictograma din tavă Default Action that is triggered by left clicking the tray icon. Acțiune implicită declanșată la clic stâng pe pictograma din tavă. Tray Icon Settings Configurări pictogramă în tavă Display Tray icon notifications Afișează notificări în tava de sistem Use platform specific notification service Folosește serviciu de notificare specific platformei When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. Când e activat, se va încerca folosirea serviciului de notificare specific platformei, dacă există. Modificarea necesită o repornire pentru a intra în vigoare. UpdateWatermarkOperation Select Image Alege imaginea Images Imagini All Files Toate fișierele UploadOperation Upload Script Required Script de încărcare necesar Please add an upload script via Options > Settings > Upload Script Adăugați un script de încărcare în Opțiuni > Configurări > Script de încărcare Capture Upload Încărcare captură You are about to upload the image to an external destination, do you want to proceed? Sunteți pe cale să încărcați imaginea pe o destinație externă, doriți să continuați? UploaderSettings Ask for confirmation before uploading Cere confirmare înainte de a încărca Uploader Type: Tip încărcător: Imgur Imgur Script Script Uploader Încărcător VersionTab Version Versiune Build Construire Using: Folosind: WatermarkSettings Watermark Image Imagine filigran Update Actualizează Rotate Watermark Rotește filigranul When enabled, Watermark will be added with a rotation of 45° La activare, filigranul va fi adăugat cu rotație de 45° Watermark Settings Configurări filigran ksnip-1.9.2/translations/ksnip_ru.ts000066400000000000000000002116431414701001100175660ustar00rootroot00000000000000 AboutDialog About О приложении About О приложении Version Версия Author Автор Close Закрыть Donate Пожертвовать Contact Контакт AboutTab License: Лицензия: Screenshot and Annotation Tool Инструмент для создания и аннотирования снимков экрана ActionSettingTab Name Имя Shortcut Ярлык Clear Очистить Take Capture Сделать снимок Include Cursor Включить курсор Delay Задержка s с Capture Mode Режим снимка Show image in Pin Window Показать изображение в закреплённом окне Copy image to Clipboard Скопировать изображение в буфер обмена Upload image Загрузить изображение Open image parent directory Открыть содержащую изображение директорию Save image Сохранить изображение Hide Main Window Скрыть основное окно ActionsSettings Add Добавить Actions Settings Настройки действий Action Действие AddWatermarkOperation Watermark Image Required Требуется изображение водяного знака Please add a Watermark Image via Options > Settings > Annotator > Update Пожалуйста, добавьте изображение водяного знака через Опции > Настройки > Параметры рисования > Установить водянной знак/логотип AnnotationSettings Smooth Painter Paths Сглаживание When enabled smooths out pen and marker paths after finished drawing. При включении сглаживает кисть после завершения рисования. Smooth Factor Коэффициент Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. Увеличение коэффициента сглаживания уменьшит точность ручки и маркера, но сделает их более плавными. Annotator Settings Параметры рисования Remember annotation tool selection and load on startup Запомните выбор инструмента аннотации и запустить при загрузке Switch to Select Tool after drawing Item Переключитесь на выбор инструмента после рисования элемента Number Tool Seed change updates all Number Items Изменение нумератора обновит все номерные элементы Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. Отключение данной опции приведёт к распространению изменений нумератора только на новые элементы, но не на уже существующие. Отключение опции разрешит дублирование номеров. Canvas Color Цвет фона Default Canvas background color for annotation area. Changing color affects only new annotation areas. Цвет фона по умолчанию для области аннотаций. Изменение цвета повлияет только на новые аннотации. Select Item after drawing Выбирать элемент после отрисовки With this option enabled the item gets selected after being created, allowing changing settings. При включении опции элемент будет автоматически выбираться после создания, позволяя менять параметры. ApplicationSettings Capture screenshot at startup with default mode Делать скриншот при запуске Application Style Стиль окон Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. Устанавливает стиль программы, который определяет внешний вид GUI. Необходимо перезапустить ksnip, чтобы изменения вступили в силу. Application Settings Основные настройки Automatically copy new captures to clipboard Автоматически копировать новые скриншоты в буфер обмена Use Tabs Использовать вкладки Change requires restart. Изменение требует перезапуска. Run ksnip as single instance Запускать только один экземпляр ksnip Hide Tabbar when only one Tab is used. Скрыть панель вкладок, если используется только одна вкладка. Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. Включение этой опции позволит запускать только один экземпляр ksnip, все остальные запускаемые экземпляры передадут аргументы первому. Для применения необходим новый запуск всех экземпляров. Remember Main Window position on move and load on startup Запомните положение главного окна при перемещении и восстановить при загрузке Auto hide Tabs Автоматически скрывать вкладки Auto hide Docks Автоматически скрывать панели On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. Скрывать панель инструментов и настройки аннтирования при запуске. Видимость панелей можно переключать клавишей Tab. Auto resize to content Автоматически масштабировать под содержимое Automatically resize Main Window to fit content image. Автоматически масштабировать главное окно под размер изображения в нём. AuthorTab Contributors: Соавторы: Spanish Translation перевод на испанский Dutch Translation перевод на нидерландский Russian Translation перевод на русский Norwegian Bokmål Translation перевод на норвежский букмол French Translation перевод на французский Polish Translation перевод на польский Snap & Flatpak Support Поддержка Snap и Flatpak The Authors: Авторы: CanDiscardOperation Warning - Внимание - The capture %1%2%3 has been modified. Do you want to save it? Снимок %1%2%3 был изменён. Желаете сохранить его? CaptureModePicker New Создать Draw a rectangular area with your mouse Выделите мышкой прямоугольную область Capture full screen including all monitors Сделать скриншот всего экрана со всех мониторов Capture screen where the mouse is located Сделать скриншот экрана, на котором расположен курсор мыши Capture window that currently has focus Сделать снимок текущего окна Capture that is currently under the mouse cursor Сделать скриншот окна, на котором расположен курсор мыши Capture a screenshot of the last selected rectangular area Сделать скриншот последней выделенной области Uses the screenshot Portal for taking screenshot Использовать портал скриншота для снимков ContactTab Community Сообщество If you have general questions, ideas or just want to talk about ksnip, Если у вас есть общие вопросы, идеи, или вы просто хотите поговорить о ksnip, please join our присоединяйтесь к нашему server. серверу. Bug Reports Сообщения об ошибках Please use Пожалуйста, используйте to report bugs. для отправки ошибок. CopyAsDataUriOperation Failed to copy to clipboard Не удалось скопировать в буфер обмена Failed to copy to clipboard as base64 encoded image. Не удалось скопировать изображение в буфер обмена в виде base64-кода. Copied to clipboard Скопировано в буфер обмена Copied to clipboard as base64 encoded image. Изображение скопировано в буфер обмена в виде base64-кода. DeleteImageOperation Delete Image Удалить изображение The item '%1' will be deleted. Do you want to continue? Элемент "%1" будет удален. Согласны продолжить? DonateTab here здесь Also possible, Также возможно, Donations are always welcome Пожертвования всегда приветствуются Donation Пожертвование Become a GitHub Sponsor Стать спонсором на GitHub ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. ksnip - это некоммерческий проект с открытым исходным кодом, но<br/>проект требует расходов, которые необходимо покрывать,<br/> такие как затраты на домен или инструменты для кросс-платформенной поддержки. If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that Если вы хотите помочь или просто<br/>отблагодарить за проделанную работу,<br/>угостив разработчиков пивом или кофе, вы можете это сделать EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. Добавьте новые действия нажатием на вкладке кнопки «Добавить». EnumTranslator Rectangular Area Прямоугольная область Last Rectangular Area Последняя прямоугольная область Full Screen (All Monitors) Полноэкранный режим (все мониторы) Current Screen Текущий экран Active Window Активное окно Window Under Cursor Окно под курсором мыши Screenshot Portal Портал скриншота HandleUploadResultOperation Upload Successful Успешно загружено Upload script Скрипт выгрузки finished successfully. успешно завершено. Uploaded to Загружено на Unable to save temporary image for upload. Не удалось сохранить временное изображение для выгрузки. Unable to start process, check path and permissions. Не удалось запустить процесс, проверьте путь и права доступа. Process crashed Процесс аварийно завершился Process timed out. Время процесса истекло. Process read error. Ошибка чтения процесса. Process write error. Ошибка записи процесса. Web error, check console output. Ошибка веб, проверьте вывод консоли. Unknown process error. Неизвестная ошибка процесса. Upload Failed Выгрузка не удалась Script wrote to StdErr. Скрипт написал в стандартный вывод ошибок. HotKeySettings Enable Global HotKeys Включить горячие клавиши (эта функция не работает в Wayland) Capture Rect Area Снимок выделенной области Capture Full Screen Снимок всего экрана Capture current Screen Снимок текущего экрана Capture active Window Снимок активного окна Capture Window under Cursor Снимок под курсором Global HotKeys Горячие клавиши Capture Last Rect Area Снимок последней области Clear Очистить Capture using Portal Захват с помощью портала HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. Горячие клавиши поддерживаются только в Windows и X11. При отключении данной опции сочетания клавиш будут работать только в ksnip. ImageGrabberSettings Capture mouse cursor on screenshot Показывать курсор мыши во время снимка Should mouse cursor be visible on screenshots. Отображать курсор мыши во время снимка. Image Grabber Настройки захвата Force Generic Wayland Screenshot Форсировать общие скриншоты Wayland Scale Generic Wayland Screenshots Масштабировать общие скриншоты Wayland Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. Общие реализации Wayland, использующие XDG-DESKTOP-PORTAL, реализуют масштабирование по-разному. Включение этой опции приведет к определению масштаба текущего экрана и применению его к скриншоту в ksnip. GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. GNOME и KDE Plasma поддерживают собственные методы скриншотов Wayland через XDG-DESKTOP-PORTAL. Включение этой опции заставит KDE Plasma и GNOME использовать метод XDG-DESKTOP-PORTAL. Изменение этого параметра требует перезапуска ksnip. Show Main Window after capturing screenshot Показать главное окно после захвата скриншота Hide Main Window during screenshot Скрыть главное окно во время снимка экрана Hide Main Window when capturing a new screenshot. Скрыть главное окно при захвате нового снимка экрана. Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. Показать основное окно после выполенения снимка, если оно было скрыто или свёрнуто. ImgurHistoryDialog Imgur History История Imgur Close Закрыть Time Stamp Время Link Ссылка Delete Link Ссылка на удаление ImgurUploader Upload to imgur.com finished! Выгрузка на imgur.com завершена! Received new token, trying upload again… Получен новый токен, повторная попытка выгрузки… Imgur token has expired, requesting new token… Срок действия токена истек, запрашивается новый токен… ImgurUploaderSettings Force anonymous upload Форсировать анонимную выгрузку Always copy Imgur link to clipboard Копировать ссылку в буфер обмена Client ID ID клиента Client Secret Секретный ключ клиента PIN PIN-код Enter imgur Pin which will be exchanged for a token. Введите PIN-код с Imgur, который будет заменен на токен. Get PIN Получить PIN Get Token Получить токен Imgur History История Imgur Imgur Uploader Выгрузка на Imgur Username Имя пользователя Waiting for imgur.com… Ожидание imgur.com… Imgur.com token successfully updated. Imgur.com: токен был обновлен. Imgur.com token update error. Imgur.com: ошибка во время обновления токена. After uploading open Imgur link in default browser После выгрузки открыть ссылку Imgur в браузере по умолчанию Link directly to image Прямая ссылка на изображение Base Url: Базовый URL: Base url that will be used for communication with Imgur. Changing requires restart. Базовый URL, используемый для связи с Imgur. Изменение потребует перезапуска. Clear Token Очистить токен LoadImageFromFileOperation Unable to open image Невозможно открыть изображение Unable to open image from path %1 Невозможно открыть изображение %1 MainToolBar New Создать Delay in seconds between triggering and capturing screenshot. Задержка в секундах перед тем, как будет сделан скриншот. s с Save Сохранить Save Screen Capture to file system Сохранить скриншот в файловой системе Copy Копировать Copy Screen Capture to clipboard Копировать скриншот в буфер обмена Tools Инструменты Undo Отменить Redo Вернуть Crop Обрезать Crop Screen Capture Обрезать снимок MainWindow Unsaved Не сохранено Upload Выгрузить Print Печать Opens printer dialog and provide option to print image Открывает диалоговое окно принтера для предоставления опций печати Print Preview Предпросмотр печати Opens Print Preview dialog where the image orientation can be changed Открыть предварительный просмотр распечатки, в котором можно изменить ориентацию изображения Scale Изменить размер Quit Выход Settings Настройки &About &О приложении Open Открыть &Edit &Редактировать &Options &Опции &Help &Помощь Image Files (*.png *.jpg *.bmp) Файлы изображений (*.png *.jpg *.bmp) Add Watermark Добавить водянной знак/логотип Add Watermark to captured image. Multiple watermarks can be added. Добавить водянной знак/логотип. Можно добавить несколько. &File &Файл Unable to show image Невозможно показать изображение Save As... Сохранить как… Paste Вставить Paste Embedded Вставить интегрированным Pin Закрепить Pin screenshot to foreground in frameless window Закрепить снимок на переднем плане в безрамочном окне No image provided but one was expected. Никакого изображения не было, но его ожидали увидеть. Copy Path Скопировать путь Open Directory Открыть расположение &View Просмотр Delete Удалить Rename Переименовать Open Images Открытое изображение Show Docks Показать панели Hide Docks Скрыть панели Copy as data URI Скопировать в виде «data: URI» Open &Recent Открыть последний файл Modify Canvas Изменить фон Upload triggerCapture to external source Загрузить снимок во внешней сервис Copy triggerCapture to system clipboard Скопировать снимок в системный буфер обмена Scale Image Масштабировать изображение Rotate Повернуть Rotate Image Повернуть изображение MultiCaptureHandler Save Сохранить Save As Сохранить как Open Directory Открыть расположение Copy Копировать Copy Path Скопировать путь Delete Удалить Rename Переименовать NewCaptureNameProvider Capture Снимок PinWindow Close Закрыть Close Other Закрыть остальные Close All Закрыть все PinWindowHandler Pin Window %1 Закрепить окно %1 RenameOperation Image Renamed Изображение переименовано Successfully renamed image to Успешно переименованное изображение на Image Rename Failed Не удалось переименовать изображение Failed to rename image to Не удалось переименовать изображение в Rename image Переименовать изображение New filename: Новое имя файла: SaveOperation Save As Сохранить как Images Изображения All Files Все файлы Image Saved Изображение сохранено Saving Image Failed Ошибка во время сохранения изображения Saved to Сохранить в Failed to save image to Ошибка во время сохранения изображения SaverSettings Automatically save new captures to default location Автоматически сохранять новые снимки в папку по умолчанию Prompt to save before discarding unsaved changes Выводить диалог сохранения изменений перед отменой Remember last Save Directory Запоминать последнюю папку для сохранения When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. При включении каждый раз будет перезаписываться папка сохранения, указанная в настройках, на последнюю используемую. Capture save location and filename Место сохранения снимков и название файла Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. Поддерживаемые форматы: JPG, PNG и BMP. Если формат не указан, будет выбран PNG как по умолчанию. Имя файла может содержать следующие подстановочные знаки: - $Y, $M, $D для даты, $h, $m, $s для времени, или $T для времени в формате hhmmss. - Используйте многократно # для счётчиков. #### приведет к результату 0001, следующий снимок будет 0002. Browse Обзор Saver Settings Настройки сохранения Capture save location Место сохранения снимка Default По умолчанию Factor Уровень Save Quality Качество сохранения Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. Укажите 0 для наибольшего сжатия, 100 для больших файлов с наилучшим качеством. Не все форматы изображений поддерживают полный диапазон, но JPEG поддерживает. ScriptUploaderSettings Copy script output to clipboard Копировать вывод скрипта в буфер обмена Script: Скрипт: Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. Путь к скрипту, вызываемому для загрузки. В процессе загрузки скрипт будет вызван с путём к временному PNG-файлу в качестве единственного аргумента. Browse Обзор Script Uploader Выгрузка через скрипт Select Upload Script Выбрать скрипт загрузки Stop when upload script writes to StdErr Прерваться, если скрипт загрузки напишет в стандартный поток ошибок Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. Отметит загрузку как неудачную, если скрипт напишет в стандартный поток ошибок. Без этой опции ошибки скрипта будут проигнорированы. Filter: Фильтр: RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. Регулярное выражение. В буфер обмена будет скопировано только то, что удовлетворяет этому выражению. Если не задано, будет скопировано всё. SettingsDialog Settings Настройки OK Сохранить Cancel Отменить Image Grabber Захват изображения Imgur Uploader Выгрузка на Imgur Application Приложение Annotator Параметры аннотирования HotKeys Горячие клавиши Uploader Выгрузка Script Uploader Выгрузка через скрипт Saver Сохранение Stickers Стикеры Snipping Area Зона обрезки Tray Icon Значок в трее Watermark Водяной знак Actions Действия SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Масштабируйте прямоугольник выделения, используя маркеры, или двигайте его, перетаскивая выделенную обрасть. Use arrow keys to move the selection. Используйте клавиши-стрелки для перемещения выделенной области. Use arrow keys while pressing CTRL to move top left handle. Удерживая Ctrl, используйте клавиши-стрелки для перемещения левого верхнего маркера. Use arrow keys while pressing ALT to move bottom right handle. Удерживая Alt, используйте клавиши-стрелки для перемещения правого нижнего маркера. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. Подтвердите выделение нажатием клавиши Enter или отмените действие нажатием Escape. This message can be disabled via settings. Это сообщение может быть отключено через настройки. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Нажмите и перемещайте для выбора прямоугольной области, или нажмите ESC для выхода. Hold CTRL pressed to resize selection after selecting. Зажмите CTRL для изменения размера после выбора зоны. Hold CTRL pressed to prevent resizing after selecting. Оставляйте CTRL нажатым для отключения режима редактирования зоны после выбора. Operation will be canceled after 60 sec when no selection made. Операция будет отменена через 60 секунд, если не будет сделано выбора. This message can be disabled via settings. Это сообщение может быть отключено через настройки. SnippingAreaSettings Freeze Image while snipping Заблокировать выделенную область при снимке When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. При включении - блокирует фон от изменений в течении выделение прямоугольной области. Также меняет поведение отложенных снимков экрана, при включенной опции - задержка включается перед отображением зоны выбора, при выключенной - после. Эта опция всегда отключена для Wayland и всегда включена для MacOs. Show magnifying glass on snipping area Показывать лупу во время выделения Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. Показывает лупу во время выделения области. Эта опция работает только при включенной опции «Заморозить выделенную область». Show Snipping Area rulers Показывать линии для зоны выделения Horizontal and vertical lines going from desktop edges to cursor on snipping area. Показывает горизонтальные и вертикальные пунктирные линии от краёв экрана к зоне выделения. Show Snipping Area position and size info Показывать координаты и размер зоны When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. Если левая кнопка мыши не нажата - положение отображается, при нажатии кнопки мыши размер выбранной области отображается в левом верхнему углу захватываемой зоны. Allow resizing rect area selection by default Разрешить изменение размера выделения по умолчанию When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. Позволяет изменить вручную размеры зоны после выделения. Для подтверждения изменённых размеров необходимо нажать кнопку Enter. Show Snipping Area info text Показывать подсказки в зоне скриншота Snipping Area cursor color Цвет курсора зоны скриншота Sets the color of the snipping area cursor. Задаёт цвет курсора для выбора области обрезки. Snipping Area cursor thickness Толщина курсора области обрезки Sets the thickness of the snipping area cursor. Задаёт толщину курсора области обрезки. Snipping Area Зона обрезки Snipping Area adorner color Цвет декорирования зоны обрезки Sets the color of all adorner elements on the snipping area. Задаёт цвет всех декоративных элементов зоны обрезки. Snipping Area Transparency Прозрачность зоны обрезки Alpha for not selected region on snipping area. Smaller number is more transparent. Прозрачность невыделенной области в зоне обрезки Меньше значение — больше прозрачность. StickerSettings Up Вверх Down Вниз Use Default Stickers Использовать стикеры по умолчанию Sticker Settings Настройки стикеров Vector Image Files (*.svg) Файлы векторных изображений (*.svg) Add Добавить Remove Удалить Add Stickers Добавить наклейки TrayIcon Show Editor Показать редактор TrayIconSettings Use Tray Icon Показывать значок в трее When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. При включении добавит значок в трей (системный лоток панели задач), если оконный менеджер ОС поддерживает это. Изменение требует перезапуска приложения. Minimize to Tray Сворачивать в трей Start Minimized to Tray Запускать свёрнутым в трей Close to Tray Сворачивать в трей при закрытии Show Editor Показать редактор Capture Снимок Default Tray Icon action Действие по умолчанию для значка в трее Default Action that is triggered by left clicking the tray icon. Действие по умолчанию, вызываемое нажатием левой кнопкой мыши на значок в трее. Tray Icon Settings Настройки значка в трее Display Tray icon notifications Отображать уведомления значка в трее Use platform specific notification service Использовать системную службу уведомлений When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. При включении будет использоваться системная служба уведомлений, если таковая существует. Для изменения необходим перезапуск. UpdateWatermarkOperation Select Image Выбрать изображение Images Изображения All Files Все файлы UploadOperation Upload Script Required Необходим скрипт загрузки Please add an upload script via Options > Settings > Upload Script Пожалуйста добавьте скрипт загрузки через Опции → Настройки → Скрипт загрузки Capture Upload Загрузка снимка You are about to upload the image to an external destination, do you want to proceed? Вы собираетесь выгрузить изображение на внешний ресурс, хотите продолжить? UploaderSettings Ask for confirmation before uploading Запрашивать подтверждение перед загрузкой Uploader Type: Тип выгрузки: Imgur Imgur Script Скрипт Uploader Выгрузка VersionTab Version Версия Build Сборка Using: Программа использует: WatermarkSettings Watermark Image Водяной знак Update Обновить Rotate Watermark Повернуть водяной знак When enabled, Watermark will be added with a rotation of 45° При включении водяной знак будет добавлен повёрнутым на 45° Watermark Settings Настройки водяного знака ksnip-1.9.2/translations/ksnip_si.ts000066400000000000000000001533441414701001100175560ustar00rootroot00000000000000 AboutDialog About පිළිබඳව About පිළිබඳව Version අනුවාදය Author Close වසන්න Donate පරිත්‍යාග Contact AboutTab License: බලපත්‍රය: Screenshot and Annotation Tool ActionSettingTab Name නම Shortcut කෙටිමග Clear හිස් කරන්න Take Capture Include Cursor Delay ප්‍රමාදය s තත්. Capture Mode Show image in Pin Window Copy image to Clipboard Upload image Open image parent directory Save image Hide Main Window ප්‍රධාන කවුළුව සඟවන්න ActionsSettings Add එකතු කරන්න Actions Settings ක්‍රියමාර්ග සැකසුම Action ක්‍රියාමාර්ගය AddWatermarkOperation Watermark Image Required Please add a Watermark Image via Options > Settings > Annotator > Update AnnotationSettings Smooth Painter Paths When enabled smooths out pen and marker paths after finished drawing. Smooth Factor Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. Annotator Settings Remember annotation tool selection and load on startup Switch to Select Tool after drawing Item Number Tool Seed change updates all Number Items Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. Canvas Color Default Canvas background color for annotation area. Changing color affects only new annotation areas. Select Item after drawing With this option enabled the item gets selected after being created, allowing changing settings. ApplicationSettings Capture screenshot at startup with default mode Application Style Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. Application Settings යෙදුමේ සැකසුම් Automatically copy new captures to clipboard Use Tabs Change requires restart. Run ksnip as single instance Hide Tabbar when only one Tab is used. Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. Remember Main Window position on move and load on startup Auto hide Tabs Auto hide Docks On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. Auto resize to content Automatically resize Main Window to fit content image. AuthorTab Contributors: සහදායකයින්: Spanish Translation ස්පාඤ්ඤ පරිවර්තනය Dutch Translation ලන්දේසි පරිවර්තනය Russian Translation රුසියානු පරිවර්තනය Norwegian Bokmål Translation නෝර්වීජියානු බොක්මාල් පරිවර්තනය French Translation ප්‍රංශ පරිවර්තනය Polish Translation පෝලන්ත පරිවර්තනය Snap & Flatpak Support ස්නැප් සහ ෆ්ලැට්පැක් සහාය The Authors: CanDiscardOperation Warning - අවවාදයයි - The capture %1%2%3 has been modified. Do you want to save it? CaptureModePicker New නව Draw a rectangular area with your mouse Capture full screen including all monitors Capture screen where the mouse is located Capture window that currently has focus Capture that is currently under the mouse cursor Capture a screenshot of the last selected rectangular area Uses the screenshot Portal for taking screenshot ContactTab Community ප්‍රජාව If you have general questions, ideas or just want to talk about ksnip, ඔබට සාමාන්‍ය ප්‍රශ්න, අදහස් තිබේ නම් හෝ කේස්නිප් ගැන කතා කිරීමට අවශ්‍ය නම්, please join our සම්බන්ධ වන්න server. සේවාදායකය. Bug Reports Please use to report bugs. CopyAsDataUriOperation Failed to copy to clipboard Failed to copy to clipboard as base64 encoded image. Copied to clipboard Copied to clipboard as base64 encoded image. DeleteImageOperation Delete Image The item '%1' will be deleted. Do you want to continue? DonateTab here මෙතැන Also possible, Donations are always welcome පරිත්‍යාග සැමවිටම පිළිගනු ලැබේ Donation පරිත්‍යාග Become a GitHub Sponsor ගිට්හබ් අනුග්‍රාහකයෙකු වන්න ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. EnumTranslator Rectangular Area Last Rectangular Area Full Screen (All Monitors) Current Screen වත්මන් තිරය Active Window සක්‍රීය කවුළුව Window Under Cursor Screenshot Portal තිරසේයා ද්වාරය HandleUploadResultOperation Upload Successful උඩුගත වීම සාර්ථකයි Upload script finished successfully. Uploaded to Unable to save temporary image for upload. Unable to start process, check path and permissions. Process crashed Process timed out. Process read error. Process write error. Web error, check console output. Unknown process error. Upload Failed උඩුගත වීම අසාර්ථකයි Script wrote to StdErr. HotKeySettings Enable Global HotKeys ගෝලීය උණුසුම්යතුර සබල කරන්න Capture Rect Area Capture Full Screen ගෝලීය උණුසුම් යතුරු Capture current Screen Capture active Window Capture Window under Cursor Global HotKeys ගෝලීය උණුසුම්යතුරු Capture Last Rect Area Clear හිස් කරන්න Capture using Portal HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. ImageGrabberSettings Capture mouse cursor on screenshot Should mouse cursor be visible on screenshots. Image Grabber Force Generic Wayland Screenshot Scale Generic Wayland Screenshots Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. Show Main Window after capturing screenshot Hide Main Window during screenshot Hide Main Window when capturing a new screenshot. Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. ImgurHistoryDialog Imgur History Close වසන්න Time Stamp Link සබැඳිය Delete Link ImgurUploader Upload to imgur.com finished! Imgur.com වෙත උඩුගත කිරීම අවසන්! Received new token, trying upload again… Imgur token has expired, requesting new token… ImgurUploaderSettings Force anonymous upload බලාත්මක නිර්නාමික උඩුගත කිරීම Always copy Imgur link to clipboard Client ID අනුග්‍රාහකයේ හැඳුනුම Client Secret අනුග්‍රාහකයේ රහස PIN Enter imgur Pin which will be exchanged for a token. Get PIN Get Token Imgur History Imgur Uploader Username පරිශීලක නාමය Waiting for imgur.com… Imgur.com සඳහා රැඳෙමින්… Imgur.com token successfully updated. Imgur.com token update error. After uploading open Imgur link in default browser Link directly to image Base Url: Base url that will be used for communication with Imgur. Changing requires restart. Clear Token LoadImageFromFileOperation Unable to open image Unable to open image from path %1 MainToolBar New නව Delay in seconds between triggering and capturing screenshot. s Save සුරකින්න Save Screen Capture to file system Copy පිටපත් Copy Screen Capture to clipboard Tools මෙවලම් Undo පෙරසේ Redo පසුසේ Crop Crop Screen Capture MainWindow Unsaved Upload උඩුගත කරන්න Print මුද්‍රණය කරන්න Opens printer dialog and provide option to print image Print Preview මුද්‍රණ පෙරදසුන Opens Print Preview dialog where the image orientation can be changed Scale Quit ඉවත් වන්න Settings සැකසුම් &About පිළිබඳව Open විවෘත කරන්න &Edit සංස්කරණය &Options විකල්ප &Help උපකාර Image Files (*.png *.jpg *.bmp) Add Watermark දිය සලකුණ එකතුකරන්න Add Watermark to captured image. Multiple watermarks can be added. &File ගොනුව Unable to show image Save As... ලෙස සුරකින්න... Paste අලවන්න Paste Embedded Pin Pin screenshot to foreground in frameless window No image provided but one was expected. Copy Path Open Directory &View Delete Rename නැවත නම් කරන්න Open Images Show Docks Hide Docks Copy as data URI දත්ත ඒ.ස.හ.(URI) ලෙස පිටපත් කරන්න Open &Recent Modify Canvas Upload triggerCapture to external source Copy triggerCapture to system clipboard Scale Image Rotate Rotate Image MultiCaptureHandler Save සුරකින්න Save As ලෙස සුරකින්න Open Directory Copy පිටපත් කරන්න Copy Path මාර්ගය පිටපත් කරන්න Delete Rename නැවත නම් කරන්න NewCaptureNameProvider Capture PinWindow Close වසන්න Close Other අනෙක්වා වසන්න Close All සියල්ල වසන්න PinWindowHandler Pin Window %1 RenameOperation Image Renamed Successfully renamed image to Image Rename Failed Failed to rename image to Rename image New filename: නව ගොනුනාමය: SaveOperation Save As ලෙස සුරකින්න Images All Files සියලුම ගොනු Image Saved Saving Image Failed Saved to Failed to save image to SaverSettings Automatically save new captures to default location Prompt to save before discarding unsaved changes Remember last Save Directory When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. Capture save location and filename Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. Browse පිරික්සන්න Saver Settings සුරැකීමේ සැකසුම් Capture save location Default Factor Save Quality සුරැකීමේ ගුණාත්මභාවය Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. ScriptUploaderSettings Copy script output to clipboard Script: Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. Browse පිරික්සන්න Script Uploader Select Upload Script Stop when upload script writes to StdErr Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. Filter: පෙරහන: RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. SettingsDialog Settings සැකසුම් OK හරි Cancel අවලංගු කරන්න Image Grabber Imgur Uploader Application යෙදුම Annotator HotKeys උණුසුම් යතුරු Uploader Script Uploader Saver සුරැකුම Stickers Snipping Area Tray Icon Watermark දිය සලකුණ Actions ක්‍රියාමාර්ග SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Use arrow keys to move the selection. Use arrow keys while pressing CTRL to move top left handle. Use arrow keys while pressing ALT to move bottom right handle. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. This message can be disabled via settings. සැකසුම් හරහා මෙම පණිවිඩය අබල කළ හැකිය. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Hold CTRL pressed to resize selection after selecting. Hold CTRL pressed to prevent resizing after selecting. Operation will be canceled after 60 sec when no selection made. This message can be disabled via settings. SnippingAreaSettings Freeze Image while snipping When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. Show magnifying glass on snipping area Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. Show Snipping Area rulers Horizontal and vertical lines going from desktop edges to cursor on snipping area. Show Snipping Area position and size info When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. Allow resizing rect area selection by default When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. Show Snipping Area info text Snipping Area cursor color Sets the color of the snipping area cursor. Snipping Area cursor thickness Sets the thickness of the snipping area cursor. Snipping Area Snipping Area adorner color Sets the color of all adorner elements on the snipping area. Snipping Area Transparency Alpha for not selected region on snipping area. Smaller number is more transparent. StickerSettings Up Down Use Default Stickers Sticker Settings Vector Image Files (*.svg) Add එකතු කරන්න Remove ඉවත් කරන්න Add Stickers TrayIcon Show Editor TrayIconSettings Use Tray Icon When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. Minimize to Tray Start Minimized to Tray Close to Tray Show Editor Capture Default Tray Icon action Default Action that is triggered by left clicking the tray icon. Tray Icon Settings Display Tray icon notifications Use platform specific notification service When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. UpdateWatermarkOperation Select Image Images All Files සියලුම ගොනු UploadOperation Upload Script Required Please add an upload script via Options > Settings > Upload Script Capture Upload You are about to upload the image to an external destination, do you want to proceed? UploaderSettings Ask for confirmation before uploading Uploader Type: Imgur Script Uploader VersionTab Version අනුවාදය Build Using: භාවිතයෙන්: WatermarkSettings Watermark Image Update යාවත්කාල Rotate Watermark දිය සලකුණ කරකවන්න When enabled, Watermark will be added with a rotation of 45° Watermark Settings දිය සලකුණු සැකසුම් ksnip-1.9.2/translations/ksnip_sv.ts000066400000000000000000001636241414701001100175750ustar00rootroot00000000000000 AboutDialog About Om About Om Version Version Author Utvecklare Close Stäng Donate Donera Contact Kontakt AboutTab License: Licens: Screenshot and Annotation Tool Skärmklipps- och anteckningsverktyg ActionSettingTab Name Namn Shortcut Genväg Clear Rensa Take Capture Ta skärmklipp Include Cursor Inkludera muspekare Delay Fördröjning s s Capture Mode Skärmklippsläge Show image in Pin Window Visa bilden i ett fäst fönster Copy image to Clipboard Kopiera bilden till urklipp Upload image Ladda upp bilden Open image parent directory Öppna bildens överordnade mapp Save image Spara bilden Hide Main Window Dölj huvudfönstret ActionsSettings Add Lägg till Actions Settings Åtgärdsinställningar Action Åtgärd AddWatermarkOperation Watermark Image Required Vattenstämpelbild krävs Please add a Watermark Image via Options > Settings > Annotator > Update Lägg till en vattenstämpel via Alternativ > Inställningar > Anteckningar > Uppdatera AnnotationSettings Smooth Painter Paths Utjämna ritade objekt When enabled smooths out pen and marker paths after finished drawing. Vid aktivering utjämnas penn- och markeringsstreck efter avslutad ritning. Smooth Factor Utjämningsfaktor Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. Ökad utjämningsfaktor minskar precisionen för penna och markör, men gör dem mjukare. Annotator Settings Anteckningsinställningar Remember annotation tool selection and load on startup Kom ihåg val av ritverktyg och läs in vid uppstart Switch to Select Tool after drawing Item Växla för att välja verktyg efter att ett objekt ritats Number Tool Seed change updates all Number Items Ändring i numreringsverktyget uppdaterar alla nummerposter Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. Inaktivering av det här alternativet innebär att numreringsverktyget påverkar endast nya objekt men inte befintliga. Inaktivering låter dig använda dubblettnummer. Canvas Color Färg på arbetsytan Default Canvas background color for annotation area. Changing color affects only new annotation areas. Standardfärg på arbetsytan i anteckningsområdet. Ändring av färgen påverkar bara nya anteckningsområden. Select Item after drawing Markera objekt efter ritning With this option enabled the item gets selected after being created, allowing changing settings. Med det här alternativet aktiverat, markeras objektet efter att det skapats, vilket gör det möjligt att ändra inställningar. ApplicationSettings Capture screenshot at startup with default mode Ta skärmklipp vid uppstart med standardläget Application Style Programstil Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. Anger programstilen, vilket definierar utseende och känsla i GUI. Ändringar tillämpas efter omstart av ksnip. Application Settings Programinställningar Automatically copy new captures to clipboard Kopiera automatiskt nya skärmklipp till urklipp Use Tabs Använd flikar Change requires restart. Ändring kräver omstart. Run ksnip as single instance Kör ksnip som enskild instans Hide Tabbar when only one Tab is used. Dölj flikfältet när endast en flik används. Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. Om du aktiverar detta alternativ kan endast en ksnip-instans köras, alla instanser som startas efter den första, kommer att skicka sina argument vidare till den första och sedan avslutas. Om det här alternativet ändras måste alla öppna instanser startas om. Remember Main Window position on move and load on startup Kom ihåg huvudfönstrets position vid förflyttning och läs in vid programstart Auto hide Tabs Dölj flikar automatiskt Auto hide Docks Dölj dockor automatiskt On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. Dölj verktygsfält och noteringsinställningar vid uppstart. Dockors synlighet kan växlas med Tab-tangenten. Auto resize to content Storleksändra automatiskt efter innehåll Automatically resize Main Window to fit content image. Ändra automatiskt storleken på huvudfönstret för att passa bilden. AuthorTab Contributors: Medverkande: Spanish Translation Spansk översättning Dutch Translation Nederländsk översättning Russian Translation Rysk översättning Norwegian Bokmål Translation Norsk (Bokmål) översättning French Translation Fransk översättning Polish Translation Polsk översättning Snap & Flatpak Support Snap- & Flatpak-stöd The Authors: Upphovsmän: CanDiscardOperation Warning - Varning! - The capture %1%2%3 has been modified. Do you want to save it? Klippet %1%2%3 har ändrats. Vill du spara det? CaptureModePicker New Nytt Draw a rectangular area with your mouse Dra upp ett rektangulärt område med musen Capture full screen including all monitors Avbildar hela skärmen, samtliga skärmar inkluderade Capture screen where the mouse is located Avbildar skärmen där muspekaren befinner sig Capture window that currently has focus Avbildar det fönster som har fokus Capture that is currently under the mouse cursor Avbildar fönstret under muspekaren Capture a screenshot of the last selected rectangular area Tar ett skärmklipp av senast markerade rektangulära område Uses the screenshot Portal for taking screenshot Använder skärmklippsportalen för att ta skärmdump ContactTab Community Gemenskap If you have general questions, ideas or just want to talk about ksnip, Om du har allmänna frågor, idéer eller bara vill prata om ksnip, please join our kan du gå med i vår server. server. Bug Reports Felrapporter Please use Använd to report bugs. för att rapportera fel. CopyAsDataUriOperation Failed to copy to clipboard Kunde inte kopiera till urklipp Failed to copy to clipboard as base64 encoded image. Kunde inte kopiera till urklipp som base64-kodad bild. Copied to clipboard Kopierat till urklipp Copied to clipboard as base64 encoded image. Kopierat till urklipp som base64-kodad bild. DeleteImageOperation Delete Image Ta bort bild The item '%1' will be deleted. Do you want to continue? "%1" kommer att tas bort. Vill du fortsätta? DonateTab here här Also possible, Också möjligt, Donations are always welcome Donationer är alltid välkomna Donation Donation Become a GitHub Sponsor Bli en GitHub-sponsor ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. ksnip är ett icke-lönsamt mjukvaruprojekt, som<br/>fortfarande har vissa kostnader som måste täckas,<br/>som domänkostnader eller hårdvarukostnader för flerplattformsberoende stöd. If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that Om du vill hjälpa till eller bara<br/>uppskattar det arbete som görs<br/>genom att bjuda utvecklaren på en öl eller kaffe, kan du göra det EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. Lägg till nya åtgärder genom att trycka på "Lägg till". EnumTranslator Rectangular Area Rektangulärt område Last Rectangular Area Senaste rektangulära område Full Screen (All Monitors) Helskärm (Alla skärmar) Current Screen Aktuell skärm Active Window Aktivt fönster Window Under Cursor Fönster under muspekaren Screenshot Portal Skärmklippsportal HandleUploadResultOperation Upload Successful Uppladdning slutförd Upload script Ladda upp skript finished successfully. har slutförts. Uploaded to Uppladdat till Unable to save temporary image for upload. Kan inte spara temporär bild för uppladdning. Unable to start process, check path and permissions. Det gick inte att starta processen, kontrollera sökväg och behörigheter. Process crashed Processen kraschade Process timed out. Tidsgränsen för processen överskreds. Process read error. Läsfel i processen. Process write error. Skrivfel i processen. Web error, check console output. Webbfel, kontrollera utdata i konsolen. Unknown process error. Okänt processfel. Upload Failed Uppladdning misslyckades Script wrote to StdErr. Skript skrev till StdErr. HotKeySettings Enable Global HotKeys Aktivera systemövergripande snabbtangenter Capture Rect Area Avbilda rektangulärt område Capture Full Screen Avbilda helskärm Capture current Screen Avbilda aktuell skärm Capture active Window Avbilda aktivt fönster Capture Window under Cursor Avbilda fönster under muspekare Global HotKeys Systemövergripande snabbtangenter Capture Last Rect Area Avbilda senaste rektangulära område Clear Rensa Capture using Portal Klipp ut med hjälp av Portal HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. Snabbtangenter stöds för närvarande endast av Windows och X11. Inaktivering av detta alternativ gör också åtgärdsgenvägar till endast ksnip. ImageGrabberSettings Capture mouse cursor on screenshot Ta med muspekaren i skärmklipp Should mouse cursor be visible on screenshots. Om muspekaren skall vara synlig i skärmklipp. Image Grabber Områdesklipp Force Generic Wayland Screenshot Framtvinga inbyggt Wayland-skärmklipp Scale Generic Wayland Screenshots Skala inbyggt Wayland-skärmklipp Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. Inbyggda Wayland-implementeringar som använder XDG-DESKTOP-PORTAL hanterar skärmskalning olikt. Aktivering av detta alternativ kommer avgöra aktuell skärmskalning och tillämpa det på skärmklipp i ksnip. GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. GNOME och KDE Plasma stödjer det egna Wayland och inbyggda XDG-DESKTOP-PORTAL-skärmklipp. Om alternativet aktiveras kommer KDE Plasma och GNOME att använda XDG-DESKTOP-PORTAL-skärmklipp. Ändring i det här alternativet kräveratt ksnip startas om. Show Main Window after capturing screenshot Visa huvudfönstret efter utfört skärmklipp Hide Main Window during screenshot Dölj huvudfönstret under skärmklipp Hide Main Window when capturing a new screenshot. Dölj huvudfönstret när du tar ett nytt skärmklipp. Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. Visa huvudfönstret efter att ha tagit ett nytt skärmklipp, när huvudfönstret var dolt eller minimerat. ImgurHistoryDialog Imgur History Imgur-historik Close Stäng Time Stamp Tidsstämpel Link Länk Delete Link Ta bort länk ImgurUploader Upload to imgur.com finished! Uppladdning till imgur.com slutförd! Received new token, trying upload again… Tog emot ny token. Försöker ladda upp igen… Imgur token has expired, requesting new token… Imgur-token har upphört att gälla. Ber om ny token… ImgurUploaderSettings Force anonymous upload Tvinga fram anonym uppladdning Always copy Imgur link to clipboard Kopiera alltid Imgur-länk till urklipp Client ID Klient-ID Client Secret Klienthemlighet PIN PIN Enter imgur Pin which will be exchanged for a token. Ange Imgur PIN-kod, vilken byts mot en token. Get PIN Hämta PIN Get Token Hämta token Imgur History Imgur-historik Imgur Uploader Imgur-uppladdare Username Användarnamn Waiting for imgur.com… Väntar på imgur.com… Imgur.com token successfully updated. Imgur.com-token uppdaterades. Imgur.com token update error. Imgur.com-token uppdateringsfel. After uploading open Imgur link in default browser Öppna Imgur-länken i standardwebbläsare efter uppladdning Link directly to image Länka direkt till bilden Base Url: Grundläggande URL: Base url that will be used for communication with Imgur. Changing requires restart. Grundläggande URL som används för kommunikation med Imgur. Ändring kräver omstart. Clear Token Rensa token LoadImageFromFileOperation Unable to open image Kan inte öppna bilden Unable to open image from path %1 Kan inte öppna bild från sökvägen %1 MainToolBar New Nytt Delay in seconds between triggering and capturing screenshot. Fördröjning i sekunder mellan utlösning och själva skärmklippet. s s Save Spara Save Screen Capture to file system Spara skärmklippet Copy Kopiera Copy Screen Capture to clipboard Kopiera skärmklippet till urklipp Tools Verktyg Undo Ångra Redo Upprepa Crop Beskär Crop Screen Capture Beskär skärmklippet MainWindow Unsaved Osparad Upload Ladda upp Print Skriv ut Opens printer dialog and provide option to print image Öppnar en utskriftsdialog visar alternativen för utskrift Print Preview Förhandsgranskning Opens Print Preview dialog where the image orientation can be changed Öppnar en förhandsvisning av utskriften där bildorienteringen kan ändras Scale Skala Quit Avsluta Settings Inställningar &About &Om Open Öppna &Edit &Redigera &Options A&lternativ &Help &Hjälp Image Files (*.png *.jpg *.bmp) Bildfiler (*.png *.jpg *.bmp) Add Watermark Lägg till vattenstämpel Add Watermark to captured image. Multiple watermarks can be added. Lägg en vattenstämpel på skärmklippet. Flera vattenstämplar kan infogas. &File &Arkiv Unable to show image Kan inte visa bilden Save As... Spara som... Paste Klistra in Paste Embedded Klistra in inbäddat Pin Fäst Pin screenshot to foreground in frameless window Fäst skärmklipp i förgrunden i ramlöst fönster No image provided but one was expected. Ingen bild tillgänglig, men en var förväntad. Copy Path Kopiera sökväg Open Directory Öppna mapp &View &Visa Delete Ta bort Rename Byt namn Open Images Öppna bilder Show Docks Visa dockor Hide Docks Dölj dockor Copy as data URI Kopiera som data-URI Open &Recent Öppna &tidigare Modify Canvas Ändra arbetsyta Upload triggerCapture to external source Ladda upp skärmklipp till extern källa Copy triggerCapture to system clipboard Kopiera skärmklipp till systemets urklipp Scale Image Skala bild Rotate Rotera Rotate Image Rotera bild MultiCaptureHandler Save Spara Save As Spara som Open Directory Öppna mapp Copy Kopiera Copy Path Kopiera sökväg Delete Ta bort Rename Byt namn NewCaptureNameProvider Capture Klipp PinWindow Close Stäng Close Other Stäng övriga Close All Stäng alla PinWindowHandler Pin Window %1 Fäst fönster %1 RenameOperation Image Renamed Bilden har bytt namn Successfully renamed image to Bilden har bytt namn till Image Rename Failed Kunde inte byta namn Failed to rename image to Kunde inte byta namn till Rename image Byt namn på bilden New filename: Nytt filnamn: SaveOperation Save As Spara som Images Bilder All Files Alla filer Image Saved Bild sparad Saving Image Failed Kunde inte spara bilden Saved to Sparad i Failed to save image to Kunde inte spara bilden i SaverSettings Automatically save new captures to default location Spara automatiskt nya skärmklipp till standardplatsen Prompt to save before discarding unsaved changes Fråga om att spara, innan osparade ändringar kasseras Remember last Save Directory Kom ihåg senaste lagringsmappen When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. Vid aktivering kommer den i inställningarna sparade lagringsmappen att skrivas över med senaste lagringsmappen, varje gång något sparas. Capture save location and filename Klipplagringsplats och filnamn Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. Formaten som stöds är JPG, PNG och BMP. Om inget format anges används PNG som standard. Filnamn kan innehålla följande jokertecken: - $Y, $M, $D för datum, $h, $m, $s för tid eller $T för tid i hhmmss-format. - Flera på varandra följande # för räknare. #### kommer att resultera i 0001, nästa klipp blir 0002. Browse Bläddra Saver Settings Inställningar för lagring Capture save location Klipplagringsplats Default Standard Factor Faktor Save Quality Lagringskvalitet Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. Ange 0 för att erhålla små komprimerade filer, 100 för stora okomprimerade filer. Alla bildformat stödjer inte hela intervallet, det gör JEPG. ScriptUploaderSettings Copy script output to clipboard Kopiera skriptutdata till urklipp Script: Skript: Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. Sökväg till det skript som kommer att anropas för uppladdning. Under uppladdningen kommer skriptet att anropas med sökvägen till en temporär png-fil som enskilt argument. Browse Bläddra Script Uploader Uppladdare för skript Select Upload Script Välj uppladdningsskript Stop when upload script writes to StdErr Stoppa när uppladdningsskript skriver till StdErr Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. Markerar uppladdning som misslyckad när skript skriver till StdErr. Utan den här inställningen visas inga fel i skriptet. Filter: Filter: RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. RegEx-uttryck. Kopiera endast till urklipp, vad som matchar RegEx-uttrycket. När detta utelämnas kopieras allt. SettingsDialog Settings Inställningar OK OK Cancel Avbryt Image Grabber Klippverktyg Imgur Uploader Imgur-uppladdare Application Program Annotator Ritverktyg HotKeys Snabbtangenter Uploader Uppladdare Script Uploader Uppladdare för skript Saver Lagring Stickers Dekaler Snipping Area Klippområde Tray Icon Systemfältsikon Watermark Vattenstämpel Actions Åtgärder SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Ändra storlek på markerad rektangel med hjälp av handtagen eller flytta den genom att dra markeringen. Use arrow keys to move the selection. Använd piltangenter för att flytta markeringen. Use arrow keys while pressing CTRL to move top left handle. Använd CTRL+piltangenter för att flytta handtaget i vänster överkant. Use arrow keys while pressing ALT to move bottom right handle. Använd ALT+piltangenter för att flytta handtaget i höger underkant. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. Bekräfta markering genom att trycka RETUR/ENTER eller avbryt med ESC. This message can be disabled via settings. Detta meddelande kan inaktiveras i inställningarna. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Klicka och dra för att markera ett rektangulärt område eller tryck ESC för att avsluta. Hold CTRL pressed to resize selection after selecting. Håll CTRL nedtryckt för att ändra storlek på markeringen. Hold CTRL pressed to prevent resizing after selecting. Håll CTRL nedtryckt för att förhindra storlekändring efter markering. Operation will be canceled after 60 sec when no selection made. Åtgärden avbryts efter 60 sekunder, om ingen markering gjorts. This message can be disabled via settings. Detta meddelande kan inaktiveras i inställningarna. SnippingAreaSettings Freeze Image while snipping Frys bilden under klipp When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. Vid aktivering fryses bakgrunden medan ett rektangulärt område markeras. Det ändrar också beteendet för fördröjt skärmklipp. Med detta alternativ aktiverat, sker fördröjningen innan klippområdet visas och med alternativet avaktiverat, sker fördröjningen efter klippområdet visas. Denna funktion är alltid inaktiverad för Wayland och alltid aktiverad för MacOS. Show magnifying glass on snipping area Visa förstoringsglas på klippområde Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. Visa ett förstoringsglas som zoomar in i bakgrundsbilden. Detta alternativ fungerar endast när "Frys bilden under klipp" är aktiverat. Show Snipping Area rulers Visa linjaler på klippområdet Horizontal and vertical lines going from desktop edges to cursor on snipping area. Horisontella och vertikala linjer går från skrivbordskanten till markören i klippområdet. Show Snipping Area position and size info Visa klippområdesplacering och storleksinformation When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. När vänster musknapp inte hålls ner, visas positionen. När musknappen hålls ner, visas storleken på markerat område till vänster och över klippområdet. Allow resizing rect area selection by default Tillåt storleksändring av rektangelområde som standard When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. Vid aktivering kommer en rektangulär områdesmarkering att kunna storleksändras. När storleksändringen slutförts kan den tillämpas genom att trycka Retur. Show Snipping Area info text Visa informationstext för klippområde Snipping Area cursor color Färg på klippområdesmarkören Sets the color of the snipping area cursor. Anger färgen på markören för klippområdet. Snipping Area cursor thickness Tjocklek på klippområdesmarkören Sets the thickness of the snipping area cursor. Anger tjockleken på klippområdets markör. Snipping Area Klippområde Snipping Area adorner color Klippområdets prydnadsfärg Sets the color of all adorner elements on the snipping area. Ställer in färgen på alla prydnadselement i klippområdet. Snipping Area Transparency Klippområdets transparens Alpha for not selected region on snipping area. Smaller number is more transparent. Alfa för icke markerad region på klippområdet. Lägre siffra är mer transparens. StickerSettings Up Upp Down Ner Use Default Stickers Använda standarddekaler Sticker Settings Dekalinställningar Vector Image Files (*.svg) Vektorbilder (*.svg) Add Lägg till Remove Ta bort Add Stickers Lägg till dekaler TrayIcon Show Editor Visa redigerare TrayIconSettings Use Tray Icon Använd systemfältsikon When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. Vid aktivering läggs en ikon till i systemfältet, om operativsystemet stödjer det. Ändring kräver omstart. Minimize to Tray Minimera till systemfältet Start Minimized to Tray Starta minimerad i systemfältet Close to Tray Stäng till systemfältet Show Editor Visa redigerare Capture Klipp Default Tray Icon action Standardåtgärd för systemfältsikon Default Action that is triggered by left clicking the tray icon. Standardåtgärd som utlöses genom att vänsterklicka på systemfältsikonen. Tray Icon Settings Inställningar för systemfältsikon Display Tray icon notifications Visa systemfältsaviseringar Use platform specific notification service Använd plattformsspecifik aviseringstjänst When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. Vid aktivering försöker ksnip använda plattformsspecifik avisering när sådan finnes. Ändring kräver omstart för att tillämpas. UpdateWatermarkOperation Select Image Välj bild Images Bilder All Files Alla filer UploadOperation Upload Script Required Uppladdningsskript krävs Please add an upload script via Options > Settings > Upload Script Lägg till ett uppladdningsskript via Alternativ> Inställningar>Uppladdningsskript Capture Upload Skärmklippsuppladdning You are about to upload the image to an external destination, do you want to proceed? Du håller på att ladda upp bilden till en extern destination, vill du fortsätta? UploaderSettings Ask for confirmation before uploading Bekräfta före uppladdning Uploader Type: Uppladdartyp: Imgur Imgur Script Skript Uploader Uppladdare VersionTab Version Version Build Kompilering Using: Använder: WatermarkSettings Watermark Image Vattenstämpel Update Uppdatera Rotate Watermark Rotera vattenstämpel When enabled, Watermark will be added with a rotation of 45° Vid aktivering, roteras vattenstämpeln 45° Watermark Settings Vatenstämpelinställningar ksnip-1.9.2/translations/ksnip_tr.ts000066400000000000000000001573501414701001100175710ustar00rootroot00000000000000 AboutDialog About Hakkında About Hakkında Version Sürüm Author Yazar Close Kapat Donate Bağış Contact AboutTab License: Lisans: Screenshot and Annotation Tool ActionSettingTab Name Shortcut Clear Temizle Take Capture Include Cursor Delay s sn Capture Mode Show image in Pin Window Copy image to Clipboard Upload image Open image parent directory Save image Hide Main Window ActionsSettings Add Ekle Actions Settings Action AddWatermarkOperation Watermark Image Required Filigran Resmi Gerekli Please add a Watermark Image via Options > Settings > Annotator > Update Lüffen Filigran Resmini Ayarlar > Seçenekler > Ek Açıklama > Güncelle kısmından ekleyin AnnotationSettings Smooth Painter Paths Boyama Yollarını Yumuşat When enabled smooths out pen and marker paths after finished drawing. Etkinleştirildiğinde, çizim bittikten sonra kalem ve işaretleme yollarını yumuşatır. Smooth Factor Yumuşatma Çarpanı Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. Yumuşatma faktörü artırmak, kalem ve işaretleyici için hassasiyeti azaltır ancak daha düzgün hale getirir. Annotator Settings Yorumcu Ayarları Remember annotation tool selection and load on startup Switch to Select Tool after drawing Item Number Tool Seed change updates all Number Items Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. Canvas Color Default Canvas background color for annotation area. Changing color affects only new annotation areas. Select Item after drawing With this option enabled the item gets selected after being created, allowing changing settings. ApplicationSettings Capture screenshot at startup with default mode Uygulama başlarken varsayılan kipte ekran görüntüsünü yakala Application Style Uygulama Tarzı Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. GUI'nin görünümünü ve uygulamanın temasını ayarlar. Değişiklik sonrası Ksnip'in yeniden başlatılması gerekir. Application Settings Uygulama Ayarları Automatically copy new captures to clipboard Yeni kayıtları otomatik olarak kopyala Use Tabs Pencereleri kullan Change requires restart. Değişiklikler için yeniden başlatma gerekli Run ksnip as single instance Ksnip tek örnek olarak çalışsın Hide Tabbar when only one Tab is used. Yalnızca tek sekme kullanıldığında, sekme çubuğunu gizle. Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. Remember Main Window position on move and load on startup Auto hide Tabs Auto hide Docks On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. Auto resize to content Automatically resize Main Window to fit content image. AuthorTab Contributors: Katkıcılar: Spanish Translation İspanyolca Çeviriler Dutch Translation Hollandaca Çeviriler Russian Translation Rusça Çeviriler Norwegian Bokmål Translation Norveççe Bokmål Çeviriler French Translation Fransızca Çeviriler Polish Translation Polanyaca Çeviriler Snap & Flatpak Support Snap & Flatpak Desteği The Authors: CanDiscardOperation Warning - Uyarı - The capture %1%2%3 has been modified. Do you want to save it? CaptureModePicker New Yeni Draw a rectangular area with your mouse Farenizle dikdörtgen bir alan çizin Capture full screen including all monitors Tüm ekranlar dahil tam ekran görüntü yakalama Capture screen where the mouse is located Farenin bulunduğu ekranı yakalayın Capture window that currently has focus Odaklanılan mevcut pencereyi yakala Capture that is currently under the mouse cursor Fare imlecinin altında olanı yakala Capture a screenshot of the last selected rectangular area En son seçilen bölgeyi seç Uses the screenshot Portal for taking screenshot ContactTab Community If you have general questions, ideas or just want to talk about ksnip, please join our server. Bug Reports Please use Hata raporlaması için lütfen to report bugs. sayfasını kullanın. CopyAsDataUriOperation Failed to copy to clipboard Failed to copy to clipboard as base64 encoded image. Copied to clipboard Copied to clipboard as base64 encoded image. DeleteImageOperation Delete Image The item '%1' will be deleted. Do you want to continue? DonateTab here Also possible, Donations are always welcome Donation Bağış Become a GitHub Sponsor GitHub Sponsoru Olun ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. EnumTranslator Rectangular Area Alan Seçimi Last Rectangular Area Full Screen (All Monitors) Tam Ekran (Tüm Ekranlar) Current Screen Geçerli Ekran Active Window Etkin Pencere Window Under Cursor İmleç Altındaki Pencere Screenshot Portal HandleUploadResultOperation Upload Successful Yükleme Başarılı Upload script Yükleme kodu finished successfully. başarıyla yüklendi. Uploaded to Unable to save temporary image for upload. geçici resimi kaydederken sorun oluştu Unable to start process, check path and permissions. İşlem başlatılamadı, yolu ve yetkileri kontrol edin. Process crashed İşlem kesintiye uğradı Process timed out. Zaman aşımı Process read error. İşlemi okuma hatası Process write error. İşlemi yazma hatası Web error, check console output. Web hatası, konsol çıkışını kontrol edin Unknown process error. Bilinmeyen işlem hatası Upload Failed Yükleme Başarısız Script wrote to StdErr. HotKeySettings Enable Global HotKeys Kısayolları Aktifleştir Capture Rect Area Capture Full Screen Bütün Ekrani Kaydet Capture current Screen Şuanki Ekrani Kaydet Capture active Window Etkin pencereyi yakala Capture Window under Cursor Imlecin Altındaki Ekranı Kaydet Global HotKeys Evrensel Kısayollar Capture Last Rect Area Son Seçimi Kaydet Clear Temizle Capture using Portal HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. ImageGrabberSettings Capture mouse cursor on screenshot Ekran görüntüsünde fare imlecini yakala Should mouse cursor be visible on screenshots. Ekran görüntüsünde fare imleci gözükür. Image Grabber Görüntü Yakalayıcı Force Generic Wayland Screenshot Scale Generic Wayland Screenshots Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. Show Main Window after capturing screenshot Hide Main Window during screenshot Hide Main Window when capturing a new screenshot. Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. ImgurHistoryDialog Imgur History Imgur Geçmişi Close Kapat Time Stamp Zaman Damgası Link Bağlantı Delete Link Bağlantıyı Sil ImgurUploader Upload to imgur.com finished! imgur.com adresine yükleme işlemi tamamlandı! Received new token, trying upload again… Yeni belirteç alındı, tekrar yüklenmeye çalışılıyor… Imgur token has expired, requesting new token… Imgur belirtecinin süresi doldu, yeni belirteç isteniyor… ImgurUploaderSettings Force anonymous upload Anonim yüklemeyi zorla Always copy Imgur link to clipboard Imgur bağlantısını her zaman panoya kopyala Client ID İstemci Kimliği Client Secret İstemci Gizliliği PIN PIN Enter imgur Pin which will be exchanged for a token. Bir belirteçle değiştirilecek olan imgur Pin'ini girin. Get PIN PIN Al Get Token Belirteç Al Imgur History Imgur Geçmişi Imgur Uploader Imgur Yükleyici Username Kullanıcı Adı Waiting for imgur.com… Imgur.com bekleniyor… Imgur.com token successfully updated. Imgur.com belirteci başarıyla güncellendi. Imgur.com token update error. Imgur.com belirteç güncelleme hatası. After uploading open Imgur link in default browser Yüklenme gerçekleştikten sonra Imgur linkini varsayılan tarayıcı ile aç Link directly to image Base Url: Ana Url: Base url that will be used for communication with Imgur. Changing requires restart. Clear Token LoadImageFromFileOperation Unable to open image Unable to open image from path %1 MainToolBar New Yeni Delay in seconds between triggering and capturing screenshot. Tetiklemeden sonra saniye cinsinden gecikir ve ekran görüntüsünü yakalanır. s sn Save Kaydet Save Screen Capture to file system Yakalanan ekran görüntüsünü dosya sistemine kaydet Copy Kopyala Copy Screen Capture to clipboard Yakalanan ekran görüntüsünü panoya kopyala Tools Araçlar Undo Geri Redo İleri Crop Kırp Crop Screen Capture Yakalanan Ekran Görüntüsünü Kırp MainWindow Unsaved Kaydedilmemiş Upload Karşıya yükle Print Yazdır Opens printer dialog and provide option to print image Yazıcı iletişim kutusunu açar ve görüntü yazdırma seçeneği sunar Print Preview Yazdırma Önizleme Opens Print Preview dialog where the image orientation can be changed Resim yönünün değiştirilebileceği Baskı Önizleme iletişim penceresini açar Scale Ölçekle Quit Kapat Settings Ayarlar &About &Hakkında Open &Edit &Düzenle &Options &Seçenekler &Help &Yardım Image Files (*.png *.jpg *.bmp) Resim Dosyaları (*.png *.jpg *.bmp) Add Watermark Fligran ekle Add Watermark to captured image. Multiple watermarks can be added. &File D&osya Unable to show image Resim gösterilemiyor Save As... Farklı Kaydet... Paste Yapıştır Paste Embedded Gömülü Yapıştır Pin Sabitle Pin screenshot to foreground in frameless window No image provided but one was expected. Copy Path Hedefi Kopyala Open Directory Dizini Aç &View &Görünüm Delete Rename Open Images Show Docks Hide Docks Copy as data URI Open &Recent Modify Canvas Upload triggerCapture to external source Copy triggerCapture to system clipboard Scale Image Rotate Rotate Image MultiCaptureHandler Save Kaydet Save As Farklı Kaydet Open Directory Dizini Aç Copy Kopyala Copy Path Hedefi Kopyala Delete Rename NewCaptureNameProvider Capture Yakala PinWindow Close Kapat Close Other Diğerlerini Kapat Close All Tümünü Kapat PinWindowHandler Pin Window %1 RenameOperation Image Renamed Successfully renamed image to Image Rename Failed Failed to rename image to Rename image New filename: SaveOperation Save As Farklı Kaydet Images Resimler All Files Tüm Dosyalar Image Saved Resim Kaydedildi Saving Image Failed Resim Kaydedilemedi Saved to Kayıt edildiği yer Failed to save image to Resmi konuma kayıt edilemedi SaverSettings Automatically save new captures to default location Varsayılan noktaya otomatik olarak kaydet Prompt to save before discarding unsaved changes Kaydedilmemiş değişiklikleri iptal etmeden önce, kaydetmek için uyar Remember last Save Directory Son kayıt dizinini hatırla When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. Capture save location and filename Yakalanan görüntüyü kaydetme konumu ve dosya adı Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. Browse Gözat Saver Settings Kaydedici Ayarları Capture save location Görüntü yakalama kayıt konumu Default Varsayılan Factor Save Quality Kayıt Kalitesi Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. ScriptUploaderSettings Copy script output to clipboard Script: Betik: Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. Browse Gözat Script Uploader Yükleyici Kodu Select Upload Script Karşıya Yükleme Betiği Seç Stop when upload script writes to StdErr Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. Filter: RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. SettingsDialog Settings Ayarlar OK Tamam Cancel İptal Image Grabber Görüntü Yakalayıcı Imgur Uploader Imgur Yükleyici Application Uygulama Annotator HotKeys Kısayollar Uploader Yükleyici Script Uploader Yükleyici Kodu Saver Kaydedici Stickers Etiketler Snipping Area Tray Icon Watermark Actions SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Use arrow keys to move the selection. Use arrow keys while pressing CTRL to move top left handle. Use arrow keys while pressing ALT to move bottom right handle. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. This message can be disabled via settings. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Hold CTRL pressed to resize selection after selecting. Hold CTRL pressed to prevent resizing after selecting. Operation will be canceled after 60 sec when no selection made. This message can be disabled via settings. SnippingAreaSettings Freeze Image while snipping Seçim yaparken arka alanı dondur When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. Show magnifying glass on snipping area Seçim alanında büyüteç göster Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. Arkaplan görüntüsüne yakınlaştırma yapan bir büyüteç gösterilir. Bu seçenek yalnızca 'Seçim yaparken arka alanı dondur' etkinken çalışır. Show Snipping Area rulers Seçim Alanı cetvellerini göster Horizontal and vertical lines going from desktop edges to cursor on snipping area. Seçim yaparken dikey ve yatay cetvellerin gösterilmesini sağlar. Show Snipping Area position and size info Seçim alanı konumu ve boyut bilgisini göster When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. Allow resizing rect area selection by default When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. Show Snipping Area info text Snipping Area cursor color Seçim Alanı imleç rengi Sets the color of the snipping area cursor. Snipping Area cursor thickness Seçim Alanı imleç kalınlığı Sets the thickness of the snipping area cursor. Snipping Area Snipping Area adorner color Sets the color of all adorner elements on the snipping area. Snipping Area Transparency Alpha for not selected region on snipping area. Smaller number is more transparent. StickerSettings Up Yukarı Down Aşağı Use Default Stickers Varsayılan Etiketi Kullan Sticker Settings Etiket Ayarları Vector Image Files (*.svg) Vektör Resim Dosyalari (*.svg) Add Ekle Remove Kaldır Add Stickers TrayIcon Show Editor Düzenleyici Göster TrayIconSettings Use Tray Icon Pencere Iconu Kullan When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. Etkinleştirildiğinde, işletim sisteminin pencere yöneticisi destekliyorsa görev çubuğuna bir tepsi simgesi ekleyecektir. Değişiklik yeniden başlatma gerektirir. Minimize to Tray Pencereyi küçült Start Minimized to Tray Küçültülmüş durumda başlat Close to Tray Görev çubuğuna küçült Show Editor Düzenleyici Göster Capture Yakala Default Tray Icon action Default Action that is triggered by left clicking the tray icon. Tray Icon Settings Display Tray icon notifications Use platform specific notification service When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. UpdateWatermarkOperation Select Image Resmi Seç Images Resimler All Files Tüm Dosyalar UploadOperation Upload Script Required Yükleme Kodu Gerekli Please add an upload script via Options > Settings > Upload Script Lütfen yükleme kodu ekleyin > Ayarlar > Yükleme Kodu Capture Upload Yüklemi Kaydet You are about to upload the image to an external destination, do you want to proceed? Resmi harici konuma yüklemek üzerisiniz, devam etmek istiyormusunuz? UploaderSettings Ask for confirmation before uploading Yüklemeden önce onay iste Uploader Type: Yükleyici Türü: Imgur Imgur Script Kod Uploader Yükleyici VersionTab Version Sürüm Build İnşa Using: Kullanım: WatermarkSettings Watermark Image Filigran Resmi Update Güncelle Rotate Watermark Filigrani Döndür When enabled, Watermark will be added with a rotation of 45° Etkinleştirildiğinde, filigran 45 derece açıyla eklenecektir. Watermark Settings ksnip-1.9.2/translations/ksnip_uk.ts000066400000000000000000002165621414701001100175640ustar00rootroot00000000000000 AboutDialog About Про програму About Про програму Version Версія Author Автор Close Закрити Donate Підтримати Contact Зв'язок AboutTab License: Ліцензія: Screenshot and Annotation Tool Програма для створення та анотування знімків вікон ActionSettingTab Name Назва Shortcut Скорочення Clear Очистити Take Capture Зробити знімок Include Cursor Разом із вказівником Delay Затримка s с Capture Mode Режим знімання Show image in Pin Window Показати зображення у пришпиленому вікні Copy image to Clipboard Копіювати зображення до буфера обміну даними Upload image Вивантажити зображення Open image parent directory Відкрити зображення у батьківському каталозі Save image Зберегти зображення Hide Main Window Приховати головне вікно ActionsSettings Add Додати Actions Settings Параметри дій Action Дія AddWatermarkOperation Watermark Image Required Потрібне зображення водяного знаку Please add a Watermark Image via Options > Settings > Annotator > Update Будь ласка, додайте водяний знак за допомогою пункту Параметри → Налаштування → Анотатор → Оновити AnnotationSettings Smooth Painter Paths Згладжувати намальовані контури When enabled smooths out pen and marker paths after finished drawing. Якщо позначено, згладжувати лінії, які намальовано пером або маркером, після завершення малювання. Smooth Factor Коефіцієнт згладжування Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. Збільшення коефіцієнта згладжування зменшить чіткість ліній, залишених пером чи маркером, але зробить їх
 плавнішими. Annotator Settings Налаштування анотатора Remember annotation tool selection and load on startup Запам'ятовувати вибраний засіб анотування і завантажувати його після запуску Switch to Select Tool after drawing Item Після малювання об'єкта перемкнутися на засіб позначення Number Tool Seed change updates all Number Items Зміна у засобі перенумерування оновлює усі записи номерів Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. Якщо цей пункт не буде позначено, зміни у засобі нумерування стосуватимуться лише нових записів, і не стосуватимуться наявних. Якщо пункт не буде позначено, також можлива поява дублікатів номерів. Canvas Color Колір полотна Default Canvas background color for annotation area. Changing color affects only new annotation areas. Типовий колір тла полотна для області анотацій. Зміна кольору стосуватиметься лише нових областей анотацій. Select Item after drawing Позначити елемент після малювання With this option enabled the item gets selected after being created, allowing changing settings. Якщо цей пункт буде позначено, програма позначатиме елемент після його створення, надаючи змогу змінити його параметри. ApplicationSettings Capture screenshot at startup with default mode Захоплювати знімок після запуску у типовому режимі Application Style Стиль вікна програми Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. Встановлює стиль вікна програми, який визначає її вигляд. Щоб оформлення змінилося, перезапустіть ksnip. Application Settings Параметри програми Automatically copy new captures to clipboard Автоматично копіювати нові знімки до буферу обміну Use Tabs Використовувати вкладки Change requires restart. Набуття змінами чинності потребує перезапуску. Run ksnip as single instance Запускати ksnip у режимі єдиного екземпляра Hide Tabbar when only one Tab is used. Ховати панель вкладок, якщо використано лише одну вкладку. Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. Якщо позначити цей пункт, запускатиметься лише один екземпляр ksnip. Усі інші запущені екземпляри просто передаватимуть свої аргументи першому екземпляру і завершуватимуть роботу. Зміна значення параметра для набуття чинності потребуватиме перезапуску усіх екземплярів. Remember Main Window position on move and load on startup Запам'ятати розташування головного вікна і відновлювати його після запуску Auto hide Tabs Автоматично ховати вкладки Auto hide Docks Автоматично ховати панелі On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. Після запуску приховати панель інструментів і параметри анотацій. Видимістю бічних панелей можна керувати за допомогою клавіші Tab. Auto resize to content Автоматичний розмір за вмістом Automatically resize Main Window to fit content image. Автоматично змінювати розміри головного вікна за зображенням-вмістом. AuthorTab Contributors: Учасники розробки: Spanish Translation Переклад іспанською Dutch Translation Переклад голландською Russian Translation Переклад російською Norwegian Bokmål Translation Переклад норвезькою (букмол) French Translation Переклад французькою Polish Translation Переклад польською Snap & Flatpak Support Підтримка Snap & Flatpak The Authors: Автори: CanDiscardOperation Warning - Попередження — The capture %1%2%3 has been modified. Do you want to save it? Захоплене зображення %1%2%3 було змінено. Хочете його зберегти? CaptureModePicker New Створити Draw a rectangular area with your mouse Виділіть мишкою прямокутну область Capture full screen including all monitors Зробити знімок усього екрана з усіх моніторів Capture screen where the mouse is located Зробити знімок екрана, на якому розташовано вказівник миші Capture window that currently has focus Зробити знімок сфокусованого вікна Capture that is currently under the mouse cursor Зробити знімок вікна, на якому розташовано вказівник миші Capture a screenshot of the last selected rectangular area Зробити знімок останньої позначеної прямокутної області Uses the screenshot Portal for taking screenshot Використовує портал знімків вікон для створення знімка ContactTab Community Спільнота If you have general questions, ideas or just want to talk about ksnip, Якщо у вас є питання загального характеру, ідеї або ви просто хочете обговорити ksnip, please join our будь ласка, долучайтеся до нашого server. сервера. Bug Reports Звіти щодо вад Please use Будь ласка, скористайтеся to report bugs. для надсилання сповіщень щодо вад. CopyAsDataUriOperation Failed to copy to clipboard Не вдалося скопіювати до буфера Failed to copy to clipboard as base64 encoded image. Не вдалося скопіювати до буфера дані зображення у кодуванні base64. Copied to clipboard Скопійовано до буфера Copied to clipboard as base64 encoded image. Скопійовано до буфера як зображення у кодуванні base64. DeleteImageOperation Delete Image Вилучити зображення The item '%1' will be deleted. Do you want to continue? Запис «%1» буде вилучено. Хочете виконати цю дію? DonateTab here тут Also possible, Також можливо, Donations are always welcome Пожертви завжди вітаються Donation Пожертва Become a GitHub Sponsor Стати спонсором на GitHub ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. ksnip — проєкт зі створення неприбуткового програмного забезпечення із вільними умовами ліцензування та умовами безкоштовного поширення.<br/>Втім, це не означає, що він не коштує нічого.<br/>Нам доводиться сплачувати за домен та обладнання для підтримання роботи програми на багатьох платформах. If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that Якщо ви хочете допомогти або просто<br/>віддячити за виконану роботу<br/>келихом пива або чашкою кави для розробників, ви можете це зробити EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. Нові дії можна додати натисканням кнопки «Додати». EnumTranslator Rectangular Area Прямокутна ділянка Last Rectangular Area Остання прямокутна ділянка Full Screen (All Monitors) Повноекранний режим (усі монітори) Current Screen Поточний екран Active Window Активне вікно Window Under Cursor Вікно під вказівником Screenshot Portal Портал знімків вікон HandleUploadResultOperation Upload Successful Успішне вивантаження Upload script Скрипт вивантаження finished successfully. успішно завершено. Uploaded to Вивантажено до Unable to save temporary image for upload. Не вдалося зберегти тимчасове зображення для вивантаження. Unable to start process, check path and permissions. Не вдалося запустити процес. Перевірте шлях і права доступу. Process crashed Аварійне завершення процесу Process timed out. Перевищено час очікування на очікування даних від процесу. Process read error. Помилка під час читання даних з процесу. Process write error. Помилка під час спроби записати дані до процесу. Web error, check console output. Помилка із мережею, ознайомтеся із виведеними до консолі даними. Unknown process error. Невідома помилка обробки. Upload Failed Невдала спроба вивантаження Script wrote to StdErr. Скрипт записано до StdErr. HotKeySettings Enable Global HotKeys Увімкнути глобальні гарячі клавіші Capture Rect Area Зняти прямокутну область Capture Full Screen Зняти весь екран Capture current Screen Зняти поточний екран Capture active Window Зняти активне вікно Capture Window under Cursor Зняти вікно під курсором Global HotKeys Глобальні гарячі клавіші Capture Last Rect Area Зняти останню прямокутну область Clear Очистити Capture using Portal Захопити за допомогою порталу HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. Підтримку клавіатурних скорочень у поточній версії передбачено лише для Windows і X11. Зняття позначення з цього пункту обмежує клавіатурні скорочення лише ksnip. ImageGrabberSettings Capture mouse cursor on screenshot Показувати вказівник миші на знімку Should mouse cursor be visible on screenshots. Чи має бути показано вказівник миші на знімках. Image Grabber Захоплення знімків Force Generic Wayland Screenshot Примусове створення типового знімка Wayland Scale Generic Wayland Screenshots Масштабувати типові знімки у Wayland Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. Типові реалізації Wayland, які використовують XDG-DESKTOP-PORTAL, обробляють масштабування екрана інакше. Вмикання цього параметра призведе до визначення поточного масштабування екрана і застосування його до знімка у ksnip. GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. У GNOME і Плазмі KDE передбачено власні засоби створення знімків Wayland та типових знімків XDG-DESKTOP-PORTAL. Якщо позначити цей пункт, програма примусово використовуватиме у Плазмі KDE і GNOME знімки XDG-DESKTOP-PORTAL. Для набуття чинності цим параметром ksnip слід перезапустити. Show Main Window after capturing screenshot Показувати головне вікно після створення знімка Hide Main Window during screenshot Ховати головне вікно під час створення знімка Hide Main Window when capturing a new screenshot. Ховати головне вікно під час створення знімка. Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. Показати головне вікно після створення знімка, якщо головне вікно було приховано або згорнуто. ImgurHistoryDialog Imgur History Історія завантажень Close Закрити Time Stamp Позначка часу Link Посилання Delete Link Видалити посилання ImgurUploader Upload to imgur.com finished! Вивантаження на imgur.com завершено! Received new token, trying upload again… Отримано новий жетон, спробуємо вивантажити ще раз… Imgur token has expired, requesting new token… Термін дії жетона Imgur вичерпано, надсилаємо запит щодо нового жетона… ImgurUploaderSettings Force anonymous upload Примусове анонімне вивантаження Always copy Imgur link to clipboard Завжди копіювати посилання Imgur до буфера обміну даними Client ID Ід. клієнта Client Secret Закритий ключ клієнта PIN PIN Enter imgur Pin which will be exchanged for a token. Вкажіть PIN-код imgur, який буде обміняно на жетон. Get PIN Отримати PIN-код Get Token Отримати жетон Imgur History Журнал Imgur Imgur Uploader Вивантажувач на Imgur Username Користувач Waiting for imgur.com… Очікування на imgur.com… Imgur.com token successfully updated. Жетор Imgur.com успішно оновлено. Imgur.com token update error. Помилка під час спроби оновити жетон Imgur.com. After uploading open Imgur link in default browser Після завантаження відкрити посилання на Imgur у браузері за замовчуванням Link directly to image Пряме посилання до зображення Base Url: Базова адреса: Base url that will be used for communication with Imgur. Changing requires restart. Базова адреса, яку буде використано для обміну даними з Imgur. Для набуття змінами чинності слід перезапустити програму. Clear Token Вилучити жетон LoadImageFromFileOperation Unable to open image Не вдалося відкрити зображення Unable to open image from path %1 Не вдалося відкрити зображення зі шляхом %1 MainToolBar New Створити Delay in seconds between triggering and capturing screenshot. Затримка у секундах перед тим, як буде зроблено знімок. s с Save Зберегти Save Screen Capture to file system Зберегти знімок у файловій системі Copy Копіювати Copy Screen Capture to clipboard Копіювати знімок до буфера обміну Tools Інструменти Undo Скасувати Redo Повторити Crop Обрізати Crop Screen Capture Обрізати захоплене з екрана MainWindow Unsaved Не збережений Upload Завантажити Print Роздрукувати Opens printer dialog and provide option to print image Відкрити діалогове вікно з можливістю роздрукувати зображення Print Preview Перегляд друку Opens Print Preview dialog where the image orientation can be changed Відкрити попередній перегляд роздруківки, в якому можна змінити орієнтацію зображення Scale Розмір Quit Закрити Settings Параметри &About &Про програму Open Відкрити &Edit &Правка &Options &Налаштування &Help &Довідка Image Files (*.png *.jpg *.bmp) Файли зображень (*.png, *.jpg, *.bmp) Add Watermark Додати водяний знак Add Watermark to captured image. Multiple watermarks can be added. Додати водяний знак до знімка. Можна додати декілька знаків. &File &Файл Unable to show image Не вдається показати зображення Save As... Зберегти як… Paste Вставити Paste Embedded Вставити вбудованим Pin Пришпилити Pin screenshot to foreground in frameless window Пришпилити знімок вікна до переднього плану у вікні без рамки No image provided but one was expected. Не надано зображення, хоча програма його очікувала. Copy Path Копіювати шлях Open Directory Відкрити каталог &View П&ерегляд Delete Вилучити Rename Перейменувати Open Images Відкрити зображення Show Docks Показати бічні панелі Hide Docks Приховати бічні панелі Copy as data URI Копіювати як адресу даних Open &Recent Відкрити &нещодавні Modify Canvas Змінити полотно Upload triggerCapture to external source Вивантажити triggerCapture на зовнішнє джерело Copy triggerCapture to system clipboard Скопіювати triggerCapture до буфера обміну даними системи Scale Image Масштабувати зображення Rotate Обертати Rotate Image Обертати зображення MultiCaptureHandler Save Зберегти Save As Зберегти як Open Directory Відкрити каталог Copy Копіювати Copy Path Копіювати шлях Delete Вилучити Rename Перейменувати NewCaptureNameProvider Capture Захопити PinWindow Close Закрити Close Other Закрити інші Close All Закрити всі PinWindowHandler Pin Window %1 Пришпилити вікно %1 RenameOperation Image Renamed Зображення перейменовано Successfully renamed image to Зображення успішно перейменовано на Image Rename Failed Не вдалося перейменувати зображення Failed to rename image to Не вдалося перейменувати зображення на Rename image Перейменувати зображення New filename: Нова назва файла: SaveOperation Save As Зберегти як Images зображення All Files усі файли Image Saved Зображення збережено Saving Image Failed Не вдалося зберегти зображення Saved to Зберегти до Failed to save image to Не вдалося зберегти зображення до SaverSettings Automatically save new captures to default location Автоматично зберігати нові знімки до типової теки Prompt to save before discarding unsaved changes Питати, чи бажаєте зберегти зміни до зображення, перш ніж їх відкидати Remember last Save Directory Запам'ятовувати останній каталог зберігання When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. Якщо позначено, програма перезаписуватиме каталог зберігання знімків у параметрах останнім каталогом зберігання під час кожного збереження знімка. Capture save location and filename Місце автоматичного збереження та формат назви знімків Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. Підтримуваними форматами є JPG, PNG і BMP. Якщо формат не вказано, типово буде використано PNG. Шаблон може включати такі рядки-замінники: - $Y (рік), $M (місяць), $D (день) для дати, $h (години), $m (хвилини), $s (секунди) для часу або $T для часу у форматі ггххсс. - Декілька послідовних # для лічильника. #### дасть нумерацію 0001, далі 0002 тощо. Browse Вибрати Saver Settings Параметри засобу зберігання Capture save location Місце збереження знімків Default Типові Factor Коефіцієнт Save Quality Якість збереження Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. Вкажіть 0 для отримання малих стиснених файлів або 100 для отримання великих файлів без стискання. Повний діапазон коефіцієнтів стискання передбачено не усіма форматами, але його підтримку передбачено у JPEG. ScriptUploaderSettings Copy script output to clipboard Копіювати виведення скрипту до буфера обміну Script: Скрипт: Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. Шлях до скрипту, який буде викликано для вивантаження даних. Під час вивантаження скрипт буде викликано із параметром шляху до тимчасового файла png як єдиним аргументом. Browse Вибрати Script Uploader Вивантажувач скриптів Select Upload Script Виберіть скрипт для вивантаження Stop when upload script writes to StdErr Зупиняти обробку, якщо скрипт виведення записує щось до StdErr Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. Позначати вивантаження як невдале, якщо скрипт записує щось до StdErr. Якщо пункт не позначено, програма не братиме до уваги повідомлення про помилки, які виведено скриптом. Filter: Фільтр: RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. Формальний вираз. Копіювати до буфера обміну даними лише те, що відповідає формальному виразу. Якщо не вказано, буде скопійовано усі дані. SettingsDialog Settings Налаштування OK Зберегти Cancel Скасувати Image Grabber Захоплення знімків Imgur Uploader Завантаження на Imgur Application Основне Annotator Параметри анотатору HotKeys Гарячі клавіші Uploader Вивантажувач Script Uploader Вивантажувач скриптів Saver Зберігач Stickers Стікери Snipping Area Обрізання області Tray Icon Піктограма у лотку Watermark Водяний знак Actions Дії SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. Змініть розміри позначеного прямокутника за допомогою елементів керування або пересуньте його перетягуванням ділянки. Use arrow keys to move the selection. Скористайтеся клавішами зі стрілками для пересування позначеного. Use arrow keys while pressing CTRL to move top left handle. Скористайтеся клавішами зі стрілками разом із Ctrl для пересуванян верхнього лівого кута. Use arrow keys while pressing ALT to move bottom right handle. Скористайтеся клавішами зі стрілками разом із Alt для пересування нижнього правого кута. Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. Підтвердьте позначення натисканням Enter/Return або скасуйте дію натисканням Esc. This message can be disabled via settings. Це повідомлення можна вимкнути у параметрах програми. SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. Натисніть кнопку миші і перетягніть, щоб позначити прямокутну ділянку, або натисніть Esc, щоб вийти. Hold CTRL pressed to resize selection after selecting. Утримуйте натиснутою клавішу Ctrl, щоб змінити розміри ділянки після позначення. Hold CTRL pressed to prevent resizing after selecting. Утримйте натиснутою клавішу Ctrl, щоб запобігти зміні розмірів після позначення. Operation will be canceled after 60 sec when no selection made. Дію буде скасовано, якщо протягом 60 секунд нічного не буде позначено. This message can be disabled via settings. Це повідомлення можна вимкнути у параметрах програми. SnippingAreaSettings Freeze Image while snipping Заморозити зображення на час обрізання When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. Якщо увімкнено, програма заморозить тло при позначенні прямокутної ділянки. Параметр також змінює поведінку при створенні відкладених знімків — якщо увімкнено цей параметр, програма робитиме паузу перед тим, як показувати вирізану область, а якщо параметр вимкнено — після показу вирізаної області. Цю можливість завжди вимкнено у Wayland і завжди увімкнено у MacOs. Show magnifying glass on snipping area Показувати лупу під час вирізання ділянки Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. Показувати збільшувальне скло, яке дає змогу наблизити фонове зображення. Цей пункт працюватиме, лише якщо ввімкнено замороження зображення. Show Snipping Area rulers Показувати лінійки області вирізання Horizontal and vertical lines going from desktop edges to cursor on snipping area. Показувати горизонтальну та вертикальну лінії, які відходять від краю екрана до вказівника миші під час позначення області знімка. Show Snipping Area position and size info Показувати інформацію щодо позиції і розміру вирізаної області When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. Якщо ліву кнопку миші не натиснуто, буде показано позицію. Якщо ліву кнопку миші натиснуто, ліворуч вгорі захопленої області буде показано її розміри. Allow resizing rect area selection by default Типово дозволити зміну розмірів прямокутної позначеної ділянки When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. Якщо позначено, після вибору прямокутної ділянки буде уможливлено зміну її розмірів. Зміну розмірів може бути підтверджено натисканням клавіші Enter. Show Snipping Area info text Показати інформаційний текст області вирізання Snipping Area cursor color Колір вказівника під час вирізання області Sets the color of the snipping area cursor. Встановлює колір вказівника при вирізанні ділянки. Snipping Area cursor thickness Товщина вказівника при вирізанні ділянки Sets the thickness of the snipping area cursor. Встановлює товщину вказівника області обрізання. Snipping Area Обрізання області Snipping Area adorner color Орнаментальний колір області обрізання Sets the color of all adorner elements on the snipping area. Встановлює колір усіх елементів орнаменту області обрізання. Snipping Area Transparency Прозорість області обрізання Alpha for not selected region on snipping area. Smaller number is more transparent. Рівень прозорості для непозначеної ділянки області обрізання. Менше значення — прозоріша ділянка. StickerSettings Up Down Use Default Stickers Використовувати типові стікери Sticker Settings Параметри стікерів Vector Image Files (*.svg) файли векторних зображень (*.svg) Add Додати Remove Вилучити Add Stickers Додати наліпки TrayIcon Show Editor Показати редактор TrayIconSettings Use Tray Icon Піктограма у лотку When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. Якщо позначено, програма додасть піктограму лотка на панель задач, якщо у засобі керування вікнами операційної системи передбачено її підтримку. Зміна потребує перезапуску програми. Minimize to Tray Згорнути до лотка Start Minimized to Tray Запускати згорнутою до лотка Close to Tray Закривати до лотка Show Editor Показати редактор Capture Захопити Default Tray Icon action Типова дія для піктограми лотка Default Action that is triggered by left clicking the tray icon. Типова дія, яку буде виконано у відповідь на клацання лівою кнопкою миші на піктограмі у лотку. Tray Icon Settings Параметри піктограми лотка Display Tray icon notifications Показувати сповіщення піктограми лотка Use platform specific notification service Скористатися специфічною для платформи службою сповіщень When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. Якщо увімкнено, програма спробує скористатися специфічною для платформи службою сповіщень, якщо така існує. Для набуття чинності змінами програму слід буде перезапустити. UpdateWatermarkOperation Select Image Вибрати зображення Images зображення All Files усі файли UploadOperation Upload Script Required Потрібен скрипт вивантаження Please add an upload script via Options > Settings > Upload Script Будь ласка, додайте скрипт вивантаження за допомогою пункту меню «Налаштування > Параметри > Скрипт вивантаження» Capture Upload Вивантаження захопленого зображення You are about to upload the image to an external destination, do you want to proceed? Ви наказали програмі вивантажити зображення на віддалений сервер. Хочете зробити саме це? UploaderSettings Ask for confirmation before uploading Питати підтвердження перед вивантаженням Uploader Type: Тип вивантажувача: Imgur Imgur Script Скрипт Uploader Вивантажувач VersionTab Version Версія Build Збірка Using: Використовуємо: WatermarkSettings Watermark Image Зображення водяного знаку Update Оновити Rotate Watermark Повернути водяний знак When enabled, Watermark will be added with a rotation of 45° Якщо позначено, водяний знак буде додано із обертанням на 45° Watermark Settings Параметри водяного знаку ksnip-1.9.2/translations/ksnip_zh_CN.ts000066400000000000000000001575371414701001100201540ustar00rootroot00000000000000 AboutDialog About 关于 About 关于 Version 版本 Author 作者 Close 关闭 Donate 捐赠 Contact 联系 AboutTab License: 许可证: Screenshot and Annotation Tool 屏幕截图和注释工具 ActionSettingTab Name 名称 Shortcut 快捷键 Clear 清除 Take Capture 捕获 Include Cursor 包含光标 Delay 延迟 s s Capture Mode 捕获模式 Show image in Pin Window 在图钉窗口中显示图像 Copy image to Clipboard 图像复制到剪贴板 Upload image 上传图像 Open image parent directory 打开图像父目录 Save image 保存图像 Hide Main Window 隐藏主窗口 ActionsSettings Add 添加 Actions Settings 操作设置 Action 操作 AddWatermarkOperation Watermark Image Required 需要水印图像 Please add a Watermark Image via Options > Settings > Annotator > Update 请通过“选项”>“设置”>“注释器”>“更新”添加水印图像 AnnotationSettings Smooth Painter Paths 平滑绘制的路径 When enabled smooths out pen and marker paths after finished drawing. 如启用,绘制完成后 消除笔和标记路径。 Smooth Factor 平滑因子 Increasing the smooth factor will decrease precision for pen and marker but will make them more smooth. 增加平滑因子将减少 笔和记号笔的精度,但会 使它们更平滑。 Annotator Settings 注释器设置 Remember annotation tool selection and load on startup 记住注释器选择并在启动时加载 Switch to Select Tool after drawing Item 绘制后切换到选择工具 Number Tool Seed change updates all Number Items 数字工具种子更改将更新所有数字项目 Disabling this option causes changes of the number tool seed to affect only new items but not existing items. Disabling this option allows having duplicate numbers. 禁用此选项将导致数字工具的更改 种子仅影响新项目,而不影响现有项目。 禁用此选项将允许重复的数字。 Canvas Color 画布颜色 Default Canvas background color for annotation area. Changing color affects only new annotation areas. 注释区域画布的默认背景颜色 改变颜色只会影响新的注释区域。 Select Item after drawing 绘图后选择项目 With this option enabled the item gets selected after being created, allowing changing settings. 启用此选项后,将在创建项目后对其进行选择, 从而可以更改设置。 ApplicationSettings Capture screenshot at startup with default mode 使用默认模式在启动时捕获屏幕截图 Application Style 应用程序样式 Sets the application style which defines the look and feel of the GUI. Change requires ksnip restart to take effect. 设置定义GUI外观的应用程序样式。 更改要求ksnip重新启动才能生效。 Application Settings 应用程序设置 Automatically copy new captures to clipboard 自动将新的捕获复制到剪贴板 Use Tabs 使用标签 Change requires restart. 修改需要重启后生效。 Run ksnip as single instance 以单实例模式运行 ksnip Hide Tabbar when only one Tab is used. 当只有一个标签时隐藏标签栏。 Enabling this option will allow only one ksnip instance to run, all other instances started after the first will pass its arguments to the first and close. Changing this option requires a new start of all instances. 启用这个选项将会只允许一个ksnip实例运行, 所有其它实例启动时会将参数传给第一个实例 然后退出。改变这个选项需要在关闭所有实例 后启动新的实例。 Remember Main Window position on move and load on startup 在移动时记住主窗口的位置并在启动时加载 Auto hide Tabs 自动隐藏标签 Auto hide Docks 自动隐藏 Docks On startup hide Toolbar and Annotation Settings. Docks visibility can be toggled with the Tab Key. 在启动时隐藏工具栏和注释器, 可以按下 Tab 键显示 Dock。 Auto resize to content 自动调整内容大小 Automatically resize Main Window to fit content image. 自动调整主窗口的大小以适合内容图像。 AuthorTab Contributors: 贡献者: Spanish Translation 西班牙语翻译 Dutch Translation 荷兰语翻译 Russian Translation 俄语翻译 Norwegian Bokmål Translation 挪威语的翻译 French Translation 法语翻译 Polish Translation 波兰语翻译 Snap & Flatpak Support Snap 和 Flatpak 支持 The Authors: 作者: CanDiscardOperation Warning - 警告 - The capture %1%2%3 has been modified. Do you want to save it? 捕获 %1%2%3 已经被修改。 是否需要保存? CaptureModePicker New 新建 Draw a rectangular area with your mouse 用鼠标绘制一个矩形区域 Capture full screen including all monitors 捕获全屏,包括所有监视器 Capture screen where the mouse is located 捕获鼠标所在的屏幕 Capture window that currently has focus 捕获目前焦点所在的窗口 Capture that is currently under the mouse cursor 捕获当前在鼠标光标下的内容 Capture a screenshot of the last selected rectangular area 捕获上一次选择的矩形区域的屏幕截图 Uses the screenshot Portal for taking screenshot 使用 the screenshot Portal 截图 ContactTab Community 社区 If you have general questions, ideas or just want to talk about ksnip, 如果您有一般性问题,想法或只想谈谈 ksnip, please join our 请加入我们 server. 服务。 Bug Reports 错误报告 Please use 请使用 to report bugs. 报告错误。 CopyAsDataUriOperation Failed to copy to clipboard 复制到剪切板失败 Failed to copy to clipboard as base64 encoded image. 以 base64 图片编码形式复制到剪切板失败。 Copied to clipboard 已复制到剪切板 Copied to clipboard as base64 encoded image. 已将图像的 base64 编码复制到剪切板。 DeleteImageOperation Delete Image 删除图像 The item '%1' will be deleted. Do you want to continue? 项目 '%1' 将被删除。 你想继续吗? DonateTab here 这里 Also possible, 也可以 Donations are always welcome 欢迎捐款 Donation 捐赠 Become a GitHub Sponsor 成为一名 GitHub 赞助者 ksnip is a non-profitable copylefted libre software project, and<br/>still has some costs that need to be covered,<br/>like domain costs or hardware costs for cross-platform support. ksnip 是一个非盈利的公共版权自由软件项目,<br/> 仍有一些成本需要支付,<br/> 比如域名成本和跨平台支持所需的硬件成本。 If you want to help or just<br/>want to appreciate the work being done<br/>by treating developers to a beer or coffee, you can do that 如果您想请开发人员喝杯啤酒或咖啡或只是想<br/>欣赏正在完成的工作<br/>,则可以这样做 EmptyActionSettingTab Add new actions by pressing the 'Add' tab button. 通过点击“添加”标签按钮来添加新的操作。 EnumTranslator Rectangular Area 矩形区域 Last Rectangular Area 上一个矩形区域 Full Screen (All Monitors) 全屏(所有监视器) Current Screen 当前屏幕 Active Window 活动的窗口 Window Under Cursor 光标下的窗口 Screenshot Portal 截图门户 HandleUploadResultOperation Upload Successful 上传成功 Upload script 上传脚本 finished successfully. 已成功完成。 Uploaded to 上传到 Unable to save temporary image for upload. 无法为上传保存临时图像。 Unable to start process, check path and permissions. 无法启动进程,请检查路径和权限是否正确。 Process crashed 进程已崩溃 Process timed out. 进程超时。 Process read error. 进程读错误。 Process write error. 进程写错误。 Web error, check console output. 网络错误,请检查控制台输出。 Unknown process error. 未知的处理错误。 Upload Failed 上传失败 Script wrote to StdErr. 脚本在标准错误上有输出。 HotKeySettings Enable Global HotKeys 启用全局热键 Capture Rect Area 捕获矩形区域 Capture Full Screen 捕获全屏 Capture current Screen 捕获当前屏幕 Capture active Window 捕捉活动的窗口 Capture Window under Cursor 捕获光标下的窗口 Global HotKeys 全局热键 Capture Last Rect Area 捕捉上一次的矩形区域 Clear 清除 Capture using Portal 使用 Portal 捕获 HotKeys are currently supported only for Windows and X11. Disabling this option makes also the action shortcuts ksnip only. 当前仅 Windows 和 X11 支持热键。 禁用此选项也会使仅 ksnip 操作快捷方式。 ImageGrabberSettings Capture mouse cursor on screenshot 截图时包含鼠标光标 Should mouse cursor be visible on screenshots. 屏幕截图时鼠标 光标是否可见。 Image Grabber 图像采集器 Force Generic Wayland Screenshot 强制通用 Wayland 截图 Scale Generic Wayland Screenshots 缩放通用 Wayland 截图 Generic Wayland implementations that use XDG-DESKTOP-PORTAL handle screen scaling differently. Enabling this option will determine the current screen scaling and apply that to the screenshot in ksnip. 使用 XDG-DESKTOP-PORTAL 的通用 Wayland 实现 以不同的方式处理屏幕缩放。 启用此选项将确定当前屏幕缩放 并将其 应用于 ksnip 中的屏幕截图 。 GNOME and KDE Plasma support their own Wayland and the Generic XDG-DESKTOP-PORTAL screenshots. Enabling this option will force KDE Plasma and GNOME to use the XDG-DESKTOP-PORTAL screenshots. Change in this option require a ksnip restart. GNOME 和 KDE Plasma 支持各自的Wayland, 也有通用的 XDG-DESKTOP-PORTAL 屏幕截图。 启用该选项将强制 KDE Plasma 和 GNOME 使用 XDG-DESKTOP-PORTAL 截图方式。 改变这个选项需要重新启动 ksnip。 Show Main Window after capturing screenshot 捕捉屏幕截图后显示主窗口 Hide Main Window during screenshot 截图时隐藏主窗口 Hide Main Window when capturing a new screenshot. 捕获一个新截图时隐藏主窗口。 Show Main Window after capturing a new screenshot when the Main Window was hidden or minimize. 隐藏或最小化主窗口时在捕获新的 屏幕快照后显示主窗口。 ImgurHistoryDialog Imgur History Imgur 历史记录 Close 关闭 Time Stamp 时间戳 Link 链接 Delete Link 删除链接 ImgurUploader Upload to imgur.com finished! 上传到 imgur.com 完成! Received new token, trying upload again… 收到新令牌,正在尝试再次上传… Imgur token has expired, requesting new token… Imgur 令牌已过期,正在请求新令牌… ImgurUploaderSettings Force anonymous upload 强制匿名上传 Always copy Imgur link to clipboard 总是将 Imgur 链接复制到剪贴板 Client ID Client ID Client Secret Client Secret PIN PIN Enter imgur Pin which will be exchanged for a token. 输入Imgur Pin,它将会被替换为令牌。 Get PIN 获得 PIN Get Token 获得令牌 Imgur History Imgur 历史记录 Imgur Uploader Imgur上载程序 Username 用户名 Waiting for imgur.com… 等待 imgur.com 的回应… Imgur.com token successfully updated. Imgur.com 令牌已成功更新。 Imgur.com token update error. Imgur.com 令牌更新错误。 After uploading open Imgur link in default browser 上传到Imgur后在默认浏览器中打开 Link directly to image 直接链接到图片 Base Url: 基址 URL: Base url that will be used for communication with Imgur. Changing requires restart. 基地 URL 用来与 Imgur 通信。 更改需要重启应用。 Clear Token 清空 Token LoadImageFromFileOperation Unable to open image 无法打开图片 Unable to open image from path %1 无法从路径 %1 中打开图片 MainToolBar New 新建 Delay in seconds between triggering and capturing screenshot. 触发并捕获屏幕截图 的延迟秒数。 s Save 保存 Save Screen Capture to file system 将屏幕截图保存到文件 Copy 复制 Copy Screen Capture to clipboard 复制屏幕截图到剪贴板 Tools 工具 Undo 撤消 Redo 重做 Crop 剪裁 Crop Screen Capture 剪裁屏幕截图 MainWindow Unsaved 未保存 Upload 上传 Print 打印 Opens printer dialog and provide option to print image 打开打印机设置对话框 Print Preview 打印预览 Opens Print Preview dialog where the image orientation can be changed 打开“打印预览”对话框,可以在其中更改图像方向 Scale 缩放 Quit 退出 Settings 设置 &About 关于(&A) Open 打开 &Edit 编辑(&E) &Options 选项(&O) &Help 帮助(&H) Image Files (*.png *.jpg *.bmp) 图像文件 (* .png * .jpg * .bmp) Add Watermark 添加水印 Add Watermark to captured image. Multiple watermarks can be added. 为捕获的图像添加水印。可以添加多个水印。 &File 文件(&F) Unable to show image 无法显示图像 Save As... 另存为... Paste 粘贴 Paste Embedded 嵌入粘贴 Pin 图钉 Pin screenshot to foreground in frameless window 将截图固定在无边框的前台窗口上 No image provided but one was expected. 需要提供一个图像。 Copy Path 复制路径 Open Directory 打开目录 &View 查看(&V) Delete 删除 Rename 重命名 Open Images 打开图像 Show Docks 显示 Docks Hide Docks 隐藏 Docks Copy as data URI 复制为数据 URI Open &Recent 打开 & 最近 Modify Canvas 修改画布 Upload triggerCapture to external source 上传 triggerCapture 到外部源 Copy triggerCapture to system clipboard 复制 triggerCapture 到系统剪贴板 Scale Image 缩放图像 Rotate 旋转 Rotate Image 旋转图像 MultiCaptureHandler Save 保存 Save As 另存为 Open Directory 打开目录 Copy 复制 Copy Path 复制路径 Delete 删除 Rename 重命名 NewCaptureNameProvider Capture 捕获 PinWindow Close 关闭 Close Other 关闭其它 Close All 关闭所有 PinWindowHandler Pin Window %1 固定窗口 %1 RenameOperation Image Renamed 图像已重命名 Successfully renamed image to 成功重命名图像为 Image Rename Failed 图像重命名失败 Failed to rename image to 无法将图像重命名为 Rename image 重命名图像 New filename: 新文件名: SaveOperation Save As 另存为 Images 图像 All Files 所有文件 Image Saved 图片已保存 Saving Image Failed 保存图像失败 Saved to 保存到 Failed to save image to 无法将图像保存到 SaverSettings Automatically save new captures to default location 自动将新的捕获保存到默认位置 Prompt to save before discarding unsaved changes 在放弃未保存的更改之前提示保存 Remember last Save Directory 记住上次保存的目录 When enabled will overwrite the save directory stored in settings with the latest save directory, for every save. 启用后每次保存都会将设置中的保存目录 覆盖为上次的保存目录。 Capture save location and filename 捕获保存位置和文件名 Supported Formats are JPG, PNG and BMP. If no format provided, PNG will be used as default. Filename can contain following wildcards: - $Y, $M, $D for date, $h, $m, $s for time, or $T for time in hhmmss format. - Multiple consecutive # for counter. #### will result in 0001, next capture would be 0002. 支持 JPG、PNG 和 BMP 格式。如果没有提供格式,将使用PNG作为默认格式。 文件名可以包含以下通配符。 - $Y, $M, $D 代表日期,$h, $m, $s 代表时间,或 $T 代表 hhmmss 格式的时间。 - 多个连续的 # 代表计数器。若 #### 代表 0001,下一次捕获则会是0002。 Browse 浏览 Saver Settings 保存设置 Capture save location 捕获保存位置 Default 默认 Factor 因子 Save Quality 保存质量 Specify 0 to obtain small compressed files, 100 for large uncompressed files. Not all image formats support the full range, JPEG does. 指定 0 可以获得小的压缩文件,100 会获得大的未压缩文件。 并非所有图像格式都像 JPEG 一样支持全部范围。 ScriptUploaderSettings Copy script output to clipboard 将脚本输出复制到剪切板 Script: 脚本: Path to script that will be called for uploading. During upload the script will be called with the path to a temporary png file as a single argument. 上传时调用的脚本的路径。在上传过程中,脚本将被以 临时 png 文件的路径作为单一参数调用。 Browse 浏览 Script Uploader 上传脚本 Select Upload Script 选择上传脚本 Stop when upload script writes to StdErr 在上传脚本输出至标准错误时停止 Marks the upload as failed when script writes to StdErr. Without this setting errors in the script will be unnoticed. 当脚本输出至标准错误时,将上传标记为失败。 没有此设置,脚本中的错误将不会被注意到。 Filter: 过滤器: RegEx Expression. Only copy to clipboard what matches the RegEx Expression. When omitted, everything is copied. 正则表达式。仅在匹配上正则表达式时复制到剪贴板。 若省略此项,将复制所有内容。 SettingsDialog Settings 设置 OK 确定 Cancel 取消 Image Grabber 图像采集器 Imgur Uploader Imgur 上传程序 Application 应用程序 Annotator 注释器 HotKeys 快捷键 Uploader 上传程序 Script Uploader 上传脚本 Saver 保存 Stickers 贴纸 Snipping Area 截图区域 Tray Icon 托盘图标 Watermark 水印 Actions 操作 SnippingAreaResizerInfoText Resize selected rect using the handles or move it by dragging the selection. 使用控制柄调整所选矩形的大小,或通过拖动选区来移动它。 Use arrow keys to move the selection. 使用方向键移动选中区域。 Use arrow keys while pressing CTRL to move top left handle. 按 CTRL 键的同时使用方向键移动左上角的控制柄。 Use arrow keys while pressing ALT to move bottom right handle. 按 ALT 键的同时使用方向键移动右下角的控制柄。 Confirm selection by pressing ENTER/RETURN or abort by pressing ESC. 按 ENTER/RETURN 确认选择,或按 ESC 中止选择。 This message can be disabled via settings. 可以通过设置禁用此消息。 SnippingAreaSelectorInfoText Click and Drag to select a rectangular area or press ESC to quit. 点击并拖动选择一个矩形区域或按 ESC 键退出。 Hold CTRL pressed to resize selection after selecting. 选择后按住 CTRL 键调整选区大小。 Hold CTRL pressed to prevent resizing after selecting. 选择后,按住 CTRL 键防止调整大小。 Operation will be canceled after 60 sec when no selection made. 如果未进行选择,则60秒后将取消操作。 This message can be disabled via settings. 可以通过设置禁用此消息。 SnippingAreaSettings Freeze Image while snipping 截图时冻结图像 When enabled will freeze the background while selecting a rectangular region. It also changes the behavior of delayed screenshots, with this option enabled the delay happens before the snipping area is shown and with the option disabled the delay happens after the snipping area is shown. This feature is always disabled for Wayland and always enabled for MacOs. 启用后将在选择矩形区域时冻结背景。 它还会更改延迟屏幕截图的行为, 从而更改了延迟屏幕截图的行为, 启用此选项将延迟发生在显示剪裁区域之前, 而禁用此选项 将延迟发生在显示剪裁区域之后。 Wayland 始终禁用此功能, MacOs 始终启用此功能。 Show magnifying glass on snipping area 在截屏区域显示放大镜 Show a magnifying glass which zooms into the background image. This option only works with 'Freeze Image while snipping' enabled. 显示放大背景图的 放大镜。此设置仅在 启用了'在截图时冻结图像'时生效。 Show Snipping Area rulers 在截图区域显示标尺 Horizontal and vertical lines going from desktop edges to cursor on snipping area. 在截屏区域,显示从屏幕边缘到鼠标 的水平线和垂直线。 Show Snipping Area position and size info 显示截图区域的位置和尺寸信息 When left mouse button is not pressed the position is shown, when the mouse button is pressed, the size of the select area is shown left and above from the captured area. 当未按下鼠标左键时, 显示位置, 当按下鼠标按钮时, 所选区域的大小显示在捕获区域的左上方。 Allow resizing rect area selection by default 默认情况下允许调整矩形区域的大小 When enabled will, after selecting a rect area, allow resizing the selection. When done resizing the selection can be confirmed by pressing return. 启用后, 将在选择矩形区域后允许调整选择的大小。 完成调整大小后, 可以按回车键确认选择。 Show Snipping Area info text 显示截图区域信息文本 Snipping Area cursor color 截图区域的光标颜色 Sets the color of the snipping area cursor. 设置剪切区域光标的颜色。 Snipping Area cursor thickness 截图区域的光标粗细 Sets the thickness of the snipping area cursor. 设置剪切区域光标的粗细。 Snipping Area 截屏区域 Snipping Area adorner color 截图区域装饰色 Sets the color of all adorner elements on the snipping area. 设置剪切区域上 所有装饰元素的颜色。 Snipping Area Transparency 截图区域透明度 Alpha for not selected region on snipping area. Smaller number is more transparent. 剪裁区域中未选择区域的 Alpha。 数字越小越透明。 StickerSettings Up 向上 Down 向下 Use Default Stickers 使用默认贴纸 Sticker Settings 贴纸设置 Vector Image Files (*.svg) 矢量图像文件 (*.svg) Add 添加 Remove 移除 Add Stickers 添加贴纸 TrayIcon Show Editor 显示编辑器 TrayIconSettings Use Tray Icon 使用托盘图标 When enabled will add a Tray Icon to the TaskBar if the OS Window Manager supports it. Change requires restart. 启用后,如系统窗口管理器支持,会向任务栏添加托盘图标。 更改需要重新启动才能生效。 Minimize to Tray 最小化到托盘 Start Minimized to Tray 启动时最小化到托盘 Close to Tray 关闭到托盘 Show Editor 显示编辑器 Capture 捕获 Default Tray Icon action 默认托盘图标行为 Default Action that is triggered by left clicking the tray icon. 左键单击托盘图标时的默认触发行为。 Tray Icon Settings 托盘图标设置 Display Tray icon notifications 显示任务栏图标通知 Use platform specific notification service 使用平台特定的通知服务 When enabled will use try to use platform specific notification service when such exists. Change requires restart to take effect. 启用后将使用尝试使用特定于平台的通知存在时提供服务。 更改需要重新启动才能生效。 UpdateWatermarkOperation Select Image 选择图像 Images 图像 All Files 所有文件 UploadOperation Upload Script Required 需要上传脚本 Please add an upload script via Options > Settings > Upload Script 请通过选项>设置>上传脚本添加一个上传脚本 Capture Upload 捕获上传 You are about to upload the image to an external destination, do you want to proceed? 您即将把图像上传至外部站点。您是否想要继续? UploaderSettings Ask for confirmation before uploading 上传前请求确认 Uploader Type: 上传类型: Imgur Imgur Script 脚本 Uploader 上传程序 VersionTab Version 版本 Build 构建版本 Using: 使用: WatermarkSettings Watermark Image 水印图像 Update 更新 Rotate Watermark 旋转水印 When enabled, Watermark will be added with a rotation of 45° 启用后,将添加旋转 45° 的水印 Watermark Settings 水印设置