diff -Nru flameshot-0.6.0/appveyor.yml flameshot-0.6.0+git20190714/appveyor.yml --- flameshot-0.6.0/appveyor.yml 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/appveyor.yml 2019-07-14 16:21:21.000000000 +0000 @@ -1,6 +1,6 @@ image: Visual Studio 2015 -version: 0.5.{build}.0 +version: 0.6.{build}.0 # Major_Version_Number.Minor_Version_Number.Build_Number.Revision_Number branches: @@ -61,8 +61,8 @@ - if "%PLATFORM%" EQU "X64" (xcopy "openssl-utils.git\win64\*.dll" "distrib\flameshot") - if "%PLATFORM%" EQU "x86" (xcopy "openssl-utils.git\win32\*.dll" "distrib\flameshot") - cd distrib - - 7z a flameshot_win_%PLATFORM%_portable_%flameshot_version%.zip flameshot - - curl --upload-file ./flameshot_win_%PLATFORM%_portable_%flameshot_version%.zip https://transfer.sh/flameshot_win_%PLATFORM%_portable_%flameshot_version%.zip + - 7z a flameshot_%flameshot_version%_win_%PLATFORM%.zip flameshot + - appveyor-retry curl --upload-file ./flameshot_%flameshot_version%_win_%PLATFORM%.zip https://transfer.sh/flameshot_%flameshot_version%_win_%PLATFORM%.zip # artifacts: diff -Nru flameshot-0.6.0/CONTRIBUTING.md flameshot-0.6.0+git20190714/CONTRIBUTING.md --- flameshot-0.6.0/CONTRIBUTING.md 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/CONTRIBUTING.md 2019-07-14 16:21:21.000000000 +0000 @@ -24,7 +24,9 @@ | Georgian | ge | :bookmark:v0.5.1 | [giogziro95](https://github.com/giogziro95) | | French | fr | :bookmark:v0.5.1 | [ld892012](https://github.com/ld892012) | | Polish | pl | :bookmark:v0.5.1 | [napcok](https://github.com/napcok) | - +| Serbian | sr | :bookmark:v0.6.0 | [cobisimo](https://github.com/cobisimo) | +| Ukrainian | uk | :bookmark:v0.6.0 | [vboden](https://github.com/vboden) | +| German | de | :bookmark:v0.6.0 | [DaVukovic](https://github.com/DaVukovic) | ## Code diff -Nru flameshot-0.6.0/dbus/org.dharkael.Flameshot.xml flameshot-0.6.0+git20190714/dbus/org.dharkael.Flameshot.xml --- flameshot-0.6.0/dbus/org.dharkael.Flameshot.xml 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/dbus/org.dharkael.Flameshot.xml 2019-07-14 16:21:21.000000000 +0000 @@ -34,6 +34,15 @@ + + + + + + +**Describe the bug** + + +**To Reproduce** + + +**Expected behavior** + + +**System Information** + diff -Nru flameshot-0.6.0/.github/ISSUE_TEMPLATE/Feature_request.md flameshot-0.6.0+git20190714/.github/ISSUE_TEMPLATE/Feature_request.md --- flameshot-0.6.0/.github/ISSUE_TEMPLATE/Feature_request.md 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/.github/ISSUE_TEMPLATE/Feature_request.md 2019-07-14 16:21:21.000000000 +0000 @@ -1,9 +1,9 @@ ---- -name: feature request -about: Suggest an idea for this project - ---- - -**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 [...] -Please, a single feature per issue. +--- +name: feature request +about: Suggest an idea for this project + +--- + +**Is your feature request related to a problem?** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] +Please, a single feature per issue. diff -Nru flameshot-0.6.0/img/app/flameshot.svg flameshot-0.6.0+git20190714/img/app/flameshot.svg --- flameshot-0.6.0/img/app/flameshot.svg 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/img/app/flameshot.svg 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,6 @@ - + + + diff -Nru flameshot-0.6.0/img/hicolor/scalable/apps/flameshot.svg flameshot-0.6.0+git20190714/img/hicolor/scalable/apps/flameshot.svg --- flameshot-0.6.0/img/hicolor/scalable/apps/flameshot.svg 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/img/hicolor/scalable/apps/flameshot.svg 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,6 @@ - + + + diff -Nru flameshot-0.6.0/README.md flameshot-0.6.0+git20190714/README.md --- flameshot-0.6.0/README.md 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/README.md 2019-07-14 16:21:21.000000000 +0000 @@ -1,70 +1,122 @@ -# Flameshot -![image](./img/app/flameshot.png) -> Powerful yet simple to use screenshot software. - -[![Build Status](https://img.shields.io/travis/lupoDharkael/flameshot.svg)](https://travis-ci.org/lupoDharkael/flameshot) -[![Build Status](https://ci.appveyor.com/api/projects/status/github/lupoDharkael/flameshot?svg=true)](https://ci.appveyor.com/project/lupoDharkael/flameshot) -[![License](https://img.shields.io/github/license/lupoDharkael/flameshot.svg)](https://github.com/lupoDharkael/flameshot/blob/master/LICENSE) -[![Release](https://img.shields.io/github/release/lupoDharkael/flameshot.svg)](https://github.com/lupoDharkael/flameshot/releases) +
+

+

+ + Flameshot + +
+ Flameshot +

+

Powerful yet simple to use screenshot software.

+

+

+ + GNU/Linux Build Status + + + Windows Build Status + + + Latest Stable Release + + + Total Downloads + + + License + + + Docs + +

+
-## Usage Preview -![image](./img/preview/animatedUsage.gif) + + +## Preview + +![image](img/preview/animatedUsage.gif) ## Index + - [Features](#features) -- [Contribute](#contribute) - [Usage](#usage) + - [CLI configuration](#cli-configuration) - [Keyboard Shortcuts](#keyboard-shortcuts) + - [Local](#local) + - [Global](#global) + - [On KDE Plasma desktop](#on-kde-plasma-desktop) - [Considerations](#considerations) - [Installation](#installation) - [Compilation](#compilation) - - [Debian](#debian) - - [Fedora](#fedora) - - [Arch](#arch) + - [Dependencies](#dependencies) + - [Compile-time](#compile-time) + - [Run-time](#run-time) + - [Optional](#optional) + - [Debian](#debian) + - [Fedora](#fedora) + - [Arch](#arch) + - [Build](#build) - [Install](#install) - [Packaging](#packaging) - [License](#license) +- [Contribute](#contribute) - [Donations](#donations) +- [Acknowledgment](#acknowledgment) ## Features + - Customizable appearance. - Easy to use. - In-app screenshot edition. - DBus interface. - Upload to Imgur. -## Contribute -If you want to contribute check the [CONTRIBUTING.md](./CONTRIBUTING.md) - ## Usage + Example commands: -- capture with GUI: - `flameshot gui` +- Capture with GUI: -- capture with GUI with custom save path: + ```shell + flameshot gui + ``` - `flameshot gui -p ~/myStuff/captures` +- Capture with GUI with custom save path: -- open GUI with a delay of 2 seconds: + ```shell + flameshot gui -p ~/myStuff/captures + ``` - `flameshot gui -d 2000` +- Open GUI with a delay of 2 seconds: -- fullscreen capture with custom save path (no GUI) and delayed: + ```shell + flameshot gui -d 2000 + ``` - `flameshot full -p ~/myStuff/captures -d 5000` +- Fullscreen capture with custom save path (no GUI) and delayed: -- fullscreen capture with custom save path copying to clipboard: + ```shell + flameshot full -p ~/myStuff/captures -d 5000 + ``` - `flameshot full -c -p ~/myStuff/captures` +- Fullscreen capture with custom save path copying to clipboard: -- capture the screen containing the mouse and print the image (bytes) in PNG format: + ```shell + flameshot full -c -p ~/myStuff/captures + ``` - `flameshot screen -r` +- Capture the screen containing the mouse and print the image (bytes) in PNG format: -- capture the screen number 1 and copy it to the clipboard: + ```shell + flameshot screen -r + ``` - `flameshot screen -n 1 -c` +- Capture the screen number 1 and copy it to the clipboard: + + ```shell + flameshot screen -n 1 -c + ``` In case of doubt choose the first or the second command as shortcut in your favorite desktop environment. @@ -73,19 +125,26 @@ Check out the information window to see all the available shortcuts in the graphical capture mode. ### CLI configuration + You can use the graphical menu to configure Flameshot, but alternatively you can use your terminal or scripts to do so. -- open the configuration menu: +- Open the configuration menu: - `flameshot config` + ```shell + flameshot config + ``` -- show the initial help message in the capture mode: +- Show the initial help message in the capture mode: - `flameshot config --showhelp true` + ```shell + flameshot config --showhelp true + ``` -- for more information about the available options use the help flag: +- For more information about the available options use the help flag: - `flameshot config -h` + ```shell + flameshot config -h + ``` ## Keyboard shortcuts @@ -93,16 +152,17 @@ These shortcuts are available in GUI mode: -| Keys | Description | -|--- |--- | -| , , , | Move selection 1px | -| Shift + , , , | Resize selection 1px | -| Esc | Quit capture | -| Ctrl + C | Copy to clipboard | -| Ctrl + S | Save selection as a file | -| Ctrl + Z | Undo the last modification | -| Right Click | Show color picker | -| Mouse Wheel | Change the tool's thickness | +| Keys | Description | +|--- |--- | +| , , , | Move selection 1px | +| Shift + , , , | Resize selection 1px | +| Esc | Quit capture | +| Ctrl + C | Copy to clipboard | +| Ctrl + S | Save selection as a file | +| Ctrl + Z | Undo the last modification | +| Spacebar | Toggle visibility of sidebar with options of the selected tool, color picker for the drawing color and history menu | +| Right Click | Show the color wheel | +| Mouse Wheel | Change the tool's thickness | Shift + drag a handler of the selection area: mirror redimension in the opposite handler. @@ -114,26 +174,29 @@ To make configuration easier, there's a [file](docs/shortcuts-config/flameshot-shortcuts-kde) in the repository that more or less automates this process. This file will assign the following keys to the following actions by default: -| Keys | Description | -|--- |--- | -| Prt Sc | Start the Flameshot screenshot tool and take a screenshot | -| Ctrl + Prt Sc | Wait for 3 seconds, then start the Flameshot screenshot tool and take a screenshot | -| Shift + Prt Sc | Take a full-screen (all monitors) screenshot and save it | -| Ctrl + Shift + Prt Sc | Take a full-screen (all monitors) screenshot and copy it to the clipboard | +| Keys | Description | +|--- |--- | +| Prt Sc | Start the Flameshot screenshot tool and take a screenshot | +| Ctrl + Prt Sc | Wait for 3 seconds, then start the Flameshot screenshot tool and take a screenshot | +| Shift + Prt Sc | Take a full-screen (all monitors) screenshot and save it | +| Ctrl + Shift + Prt Sc | Take a full-screen (all monitors) screenshot and copy it to the clipboard | If you don't like the defaults, you can change them manually later. Steps for using the configuration: -1. The configuration file configures shortcuts so that Flameshot automatically saves (without opening the save dialog) screenshots to _~/Pictures/Screenshots_ folder. Make sure you have that folder by running the following command: - ``` +1. The configuration file configures shortcuts so that Flameshot automatically saves (without opening the save dialog) screenshots to `~/Pictures/Screenshots` folder. Make sure you have that folder by running the following command: + + ```shell mkdir -p ~/Pictures/Screenshots ``` - (If you don't like the default location, you can skip this step and configure your preferred directory later.) + (If you don't like the default location, you can skip this step and configure your preferred directory later.) 2. Download the configuration file: - ``` - cd ~/Desktop; wget https://raw.githubusercontent.com/lupoDharkael/flameshot/master/docs/shortcuts-config/flameshot-shortcuts-kde + + ```shell + cd ~/Desktop + wget https://raw.githubusercontent.com/lupoDharkael/flameshot/master/docs/shortcuts-config/flameshot-shortcuts-kde ``` 3. Go to _System Settings_ → _Shortcuts_ → _Custom Shortcuts_. 4. If there's one, you'll need to disable an entry for Spectacle, the default KDE screenshot utility first because its shortcuts might collide with Flameshot's ones; so, just uncheck the _Spectacle_ entry. @@ -145,113 +208,152 @@ - Experimental Gnome Wayland and Plasma Wayland support. -- If you are using Gnome you need to install the [TopIcons](https://extensions.gnome.org/extension/1031/topicons/) extension in order to see the systemtray icon. +- If you are using Gnome you need to install the [Gnome Shell Extension Appindicator](https://github.com/Ubuntu/gnome-shell-extension-appindicator) extension in order to see the systemtray icon. - In order to speed up the first launch of Flameshot (DBus init of the app can be slow), consider starting the application automatically on boot. - Press Enter or Ctrl + C when you are in a capture mode and you don't have an active selection and the whole desktop will be copied to your clipboard! Pressing Ctrl + S will save your capture in a file! Check the [Shortcuts](#shortcuts) for more information. -- Execute the command `flameshot` without parameters or use the "Launch Flameshot" desktop entry to launch a running instance of the program without taking actions. +- Execute the command `flameshot` without parameters to launch a running instance of the program without taking actions. ## Installation There are packages available for a few distros: -- [Arch](https://www.archlinux.org/packages/community/x86_64/flameshot/) + +- [Arch](https://www.archlinux.org/packages/community/x86_64/flameshot/): `pacman -S flameshot` + Snapshot also available via AUR: [flameshot-git](https://aur.archlinux.org/packages/flameshot-git). - [Debian 10+](https://tracker.debian.org/pkg/flameshot): `apt install flameshot` + Package for Debian 9 ("Stretch") also [available via stretch-backports](https://backports.debian.org/). - [Ubuntu 18.04+](https://launchpad.net/ubuntu/+source/flameshot): `apt install flameshot` - [openSUSE](https://software.opensuse.org/package/flameshot) -- [Void Linux](https://github.com/voidlinux/void-packages/tree/master/srcpkgs/flameshot) (`xbps-install flameshot`) +- [Void Linux](https://github.com/void-linux/void-packages/tree/master/srcpkgs/flameshot) (`xbps-install flameshot`) - [Docker](https://github.com/ManuelLR/docker-flameshot) - Fedora: `dnf install flameshot` +- [Snap/Flatpak/AppImage](https://github.com/flameshotapp/packages) +- Besides, generic packages available via [opensuse software repository](https://software.opensuse.org//download.html?project=home%3AVitzy&package=flameshot) + +
+ Expand this section to see what distros are using an up to date version of flameshot + + Packaging status + +
## Compilation -The compilation requires Qt version 5.3 or higher and GCC 4.9.2 or higher. -### Debian -Compilation Dependencies: -```` -apt install git g++ build-essential qt5-qmake qt5-default qttools5-dev-tools libqt5svg5-dev -```` - -Compilation: run `qmake && make` in the main directory. - -### Fedora -Compilation Dependencies: -```` -dnf install qt5-devel gcc-c++ git qt5-qtbase-devel qt5-linguist qt5-qtsvg-devel -```` - -Compilation: run `qmake-qt5 && make` in the main directory. - -### Arch -Compilation Dependencies: -```` -pacman -S base-devel git qt5-base qt5-tools qt5-svg -```` +To build the application in your system, you'll need to install the dependencies needed for it and Package names might be different for each distribution, see [Dependencies](#dependencies) below for more information. -Compilation: run `qmake && make` in the main directory. +### Dependencies -### Install +#### Compile-time -Simply use `make install` with privileges. +- Qt >= 5.3 + + Development tools +- GCC >= 4.9.2 -## Packaging +#### Run-time -Having `git` installed is required if you want to have precise app version information inside Flameshot after the generation of the makefile with `qmake`. +- Qt + + SVG -In order to generate the makefile installing in `/usr` instead of in `/usr/local` you can use the `packaging` option to generate the proper makefile (`qmake CONFIG+=packaging` instead of just `qmake`). +#### Optional -If you want to install in a custom directory you can use the `INSTALL_ROOT` variable. +- Git +- OpenSSL +- CA Certificates -**Example**: -You want to install Flameshot in ~/myBuilds/test. You would execute the following to do so: -`qmake CONFIG+=packaging && make INSTALL_ROOT=~/myBuilds/test install` +#### Debian -### Runtime Dependencies +```shell +# Compile-time +apt install g++ build-essential qt5-default qt5-qmake qttools5-dev-tools -**Debian**: -```` -libqt5dbus5, libqt5network5, libqt5core5a, libqt5widgets5, libqt5gui5 -```` -Optional: -``` -openssl, ca-certificates +# Run-time +apt install libqt5dbus5 libqt5network5 libqt5core5a libqt5widgets5 libqt5gui5 libqt5svg5-dev + +# Optional +apt install git openssl ca-certificates ``` -**Fedora**: -```` -qt5-qtbase -```` -Optional: +#### Fedora + +```shell +# Compile-time +dnf install gcc-c++ qt5-devel qt5-qtbase-devel qt5-linguist + +# Run-time +dnf install qt5-qtbase qt5-qtsvg-devel + +# Optional +dnf install git openssl ca-certificates ``` -openssl, ca-certificates + +#### Arch + +```shell +# Compile-time +pacman -S base-devel git qt5-base qt5-tools + +# Run-time +pacman -S qt5-svg + +# Optional +pacman -S openssl ca-certificates ``` -**Arch**: -```` -qt5-base -```` -Optional: +### Build + +After installing all the dependencies, finally run the following commands in the sources root directory: + +```shell +mkdir build +cd build +qmake ../ +make ``` -openssl, ca-certificates + +### Install + +Simply use `make install` with privileges. + +## Packaging + +Having `git` installed is required if you're building Flameshot from a snapshot to have precise version information. + +In order to generate the instructions in the `Makefile` to install the application in `/usr` instead of in `/usr/local` you can pass the `packaging` option to `qmake` (`qmake CONFIG+=packaging`). + +If you want to install in a custom directory you can use the `INSTALL_ROOT` variable. + +**Example**: + +If you want to install Flameshot in `~/myBuilds/test`, you can execute the following to do so: + +```shell +qmake CONFIG+=packaging +make INSTALL_ROOT=~/myBuilds/test install ``` ## License -- The main code is licensed under [GPLv3](./LICENSE) -- The logo of Flameshot is licensed under [Free Art License v1.3](./img/flameshotLogoLicense.txt) +- The main code is licensed under [GPLv3](LICENSE) +- The logo of Flameshot is licensed under [Free Art License v1.3](img/app/flameshotLogoLicense.txt) - The button icons are licensed under Apache License 2.0. See: https://github.com/google/material-design-icons - The code at capture/capturewidget.cpp is based on https://github.com/ckaiser/Lightscreen/blob/master/dialogs/areadialog.cpp (GPLv2) - The code at capture/capturewidget.h is based on https://github.com/ckaiser/Lightscreen/blob/master/dialogs/areadialog.h (GPLv2) -- I copied a few lines of code from KSnapshot regiongrabber.cpp revision 796531 (LGPL) +- I copied a few lines of code from KSnapshot regiongrabber.cpp revision `796531` (LGPL) - Qt-Color-Widgets taken and modified from https://github.com/mbasaglia/Qt-Color-Widgets (see their license and exceptions in the project) (LGPL/GPL) Info: If I take code from your project and that implies a relicense to GPLv3, you can reuse my changes with the original previous license of your project applied. +## Contribute + +If you want to contribute check the [CONTRIBUTING.md](CONTRIBUTING.md) + ## Donations I improve Flameshot in my free time because I want to create something good for everyone to use. -If you want you can donate some bucks [here](https://www.paypal.me/lupoDharkael). +If you want you can donate some bucks with the following options: +- [Paypal](https://www.paypal.me/lupoDharkael) +- bitcoin:1K6oiUKWVjP3x9ZuW9C7NbDfcFkMx3G8ue + ## Acknowledgment I really appreciate those who have shown interest in the early development process: diff -Nru flameshot-0.6.0/rpm/flameshot.spec flameshot-0.6.0+git20190714/rpm/flameshot.spec --- flameshot-0.6.0/rpm/flameshot.spec 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/rpm/flameshot.spec 2019-07-14 16:21:21.000000000 +0000 @@ -1,5 +1,5 @@ Name: flameshot -Version: 0.5.0 +Version: 0.6.0 Release: 1%{?dist} Summary: Powerful yet simple to use screenshot software Summary(eu-ES): Potente pero simple de usar software de capturas @@ -25,6 +25,7 @@ Requires: qt5-qtbase >= 5.3.0 Requires: qt5-qttools +Requires: qt5-qtsvg %description Flameshot is a screenshot software, it's @@ -57,17 +58,10 @@ %{_datadir}/icons/hicolor %changelog -* Tue Jan 09 2018 Zetao Yang - 0.5.0-1 -- Updated for flameshot 0.5.0 -- Catalan translation. -- Debian package configuration. -- Add --raw flag: prints the raw bytes of the png after the capture. -- Bash completion. -- Blur tool. -- Preview draw size on mouse pointer after tool selection. -- App Launcher tool: choose an app to open the capture. -- Travis integration -- Configuration import, export and reset. -- Experimental Wayland support (Plasma & Gnome) -* Tue Jan 09 2018 Zetao Yang - 0.5.0-1 -- Initial package +* Sat Aug 18 2018 Zetao Yang - 0.6.0-1 +- Updated for flameshot 0.6.0 +- More details, please see https://flameshot.js.org/#/changelog?id=v060 +* Tue Jan 09 2018 Zetao Yang - 0.5.0-1 +- Initial package for flameshot 0.5.0 +- More details, please see https://flameshot.js.org/#/changelog?id=v051 + diff -Nru flameshot-0.6.0/snap/gui/flameshot.desktop flameshot-0.6.0+git20190714/snap/gui/flameshot.desktop --- flameshot-0.6.0/snap/gui/flameshot.desktop 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/snap/gui/flameshot.desktop 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -[Desktop Entry] -Name=Flameshot -Name[es]=Tomar captura gráfica -Name[zh_CN]=进行图形截图 -GenericName=Screen capture tool -GenericName[es]=Herramienta de captura de pantalla -GenericName[tr]=Ekran kayıt aracı -GenericName[zh_CN]=屏幕截图工具 -Comment=Powerful yet simple to use screenshot software. -Comment[es]=Potente pero simple de usar software de capturas. -Comment[tr]=Güçlü ve kullanımı kolay ekran kayıt yazılımı. -Comment[zh_CN]=强大又易用的截图软件 -Keywords=flameshot;screenshot;capture; -Keywords[zh_CN]=flameshot;screenshot;capture;截图; -Exec=flameshot gui -Icon=${SNAP}/meta/gui/flameshot.png -Terminal=false -Type=Application -Categories=Graphics; -StartupNotify=false diff -Nru flameshot-0.6.0/snap/gui/flameshot-init.desktop flameshot-0.6.0+git20190714/snap/gui/flameshot-init.desktop --- flameshot-0.6.0/snap/gui/flameshot-init.desktop 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/snap/gui/flameshot-init.desktop 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -[Desktop Entry] -Name=Launch Flameshot -Name[es]=Iniciar Flameshot -Name[tr]=Flameshot Başlat -Name[zh_CN]=启动 Flameshot -GenericName=Screenshot tool -GenericName[es]=Herramienta de captura de pantalla -GenericName[tr]=Ekran kayıt aracı -GenericName[zh_CN]=截图工具 -Comment=Powerful yet simple to use screenshot software. -Comment[es]=Potente pero simple de usar software de capturas. -Comment[zh_CN]=强大又易用的截图软件 -Keywords=flameshot;screenshot;capture; -Keywords[zh_CN]=flameshot;screenshot;capture;截图; -Exec=flameshot -Icon=${SNAP}/meta/gui/flameshot.png -Type=Application -Categories=Graphics; Binary files /tmp/tmpi_xvfL/fGknhE3Oj7/flameshot-0.6.0/snap/gui/flameshot.png and /tmp/tmpi_xvfL/Em6udIrFmG/flameshot-0.6.0+git20190714/snap/gui/flameshot.png differ diff -Nru flameshot-0.6.0/snap/snapcraft.yaml flameshot-0.6.0+git20190714/snap/snapcraft.yaml --- flameshot-0.6.0/snap/snapcraft.yaml 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/snap/snapcraft.yaml 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ -name: flameshot -version: git -icon: img/app/flameshot.svg -summary: Powerful yet simple to use screenshot software -description: | - A powerful open source screenshot and annotation tool for Linux, Flameshot - has a varied set of markup tools available, which include Freehand drawing, - Lines, Arrows, Boxes, Circles, Highlighting, Blur. Additionally, you can - customise the color, size and/or thickness of many of these image annotation - tools. - -grade: devel # must be 'stable' to release into candidate/stable channels -confinement: devmode # use 'strict' once you have the right plugs and slots - - -apps: - flameshot: - command: desktop-launch ${SNAP}/usr/bin/flameshot - environment: - LC_ALL: C.UTF-8 - slots: [ dbus-svc ] - plugs: - - desktop - - desktop-legacy - - home - - network - - network-bind - - opengl - - pulseaudio - - unity7 - - wayland - - x11 - -parts: - flameshot: - after: - - desktop-qt5 - - indicator-qt5 - plugin: qmake - qt-version: qt5 - options: - - CONFIG+=packaging - source: . - source-type: git - build-packages: - - qt5-default - - qttools5-dev-tools - - libqt5svg5-dev - stage-packages: - - dbus-x11 - - libgtk2.0-0 - - openssl - - ca-certificates - - desktop-qt5: - stage: [ -./**/lib/*/qt5/**/libappmenu-qt5.so ] - -slots: - # Depending on in which environment we're running we either need - # to use the system or session DBus so we also need to have one - # slot for each. - dbus-svc: - interface: dbus - bus: session - name: org.dharkael.Flameshot diff -Nru flameshot-0.6.0/src/cli/commandargument.cpp flameshot-0.6.0+git20190714/src/cli/commandargument.cpp --- flameshot-0.6.0/src/cli/commandargument.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/cli/commandargument.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/cli/commandargument.h flameshot-0.6.0+git20190714/src/cli/commandargument.h --- flameshot-0.6.0/src/cli/commandargument.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/cli/commandargument.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/cli/commandlineparser.cpp flameshot-0.6.0+git20190714/src/cli/commandlineparser.cpp --- flameshot-0.6.0/src/cli/commandlineparser.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/cli/commandlineparser.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -31,9 +31,9 @@ QTextStream err(stderr); auto versionOption = CommandOption({"v", "version"}, - "Displays version information"); + QStringLiteral("Displays version information")); auto helpOption = CommandOption({"h", "help"}, - "Displays this help"); + QStringLiteral("Displays this help")); QString optionsToString(const QList &options, const QList &arguments) { @@ -43,7 +43,7 @@ // of every option at the same horizontal character position. for (auto const &option: options) { QStringList dashedOptions = option.dashedNames(); - QString joinedDashedOptions = dashedOptions.join(", "); + QString joinedDashedOptions = dashedOptions.join(QStringLiteral(", ")); if (!option.valueName().isEmpty()) { joinedDashedOptions += QStringLiteral(" <%1>") .arg(option.valueName()); @@ -61,20 +61,20 @@ // generate the text QString result; if(!dashedOptionList.isEmpty()) { - result += "Options:\n"; - QString linePadding = QString(" ").repeated(size + 4).prepend("\n"); + result += QLatin1String("Options:\n"); + QString linePadding = QStringLiteral(" ").repeated(size + 4).prepend("\n"); for (int i = 0; i < options.length(); ++i) { result += QStringLiteral(" %1 %2\n") .arg(dashedOptionList.at(i).leftJustified(size, ' ')) .arg(options.at(i).description() - .replace("\n", linePadding)); + .replace(QLatin1String("\n"), linePadding)); } if (!arguments.isEmpty()) { - result += "\n"; + result += QLatin1String("\n"); } } if (!arguments.isEmpty()) { - result += "Arguments:\n"; + result += QLatin1String("Arguments:\n"); } for (int i = 0; i < arguments.length(); ++i) { result += QStringLiteral(" %1 %2\n") @@ -121,14 +121,14 @@ QString arg = *actualIt; bool ok = true; // track values - int equalsPos = arg.indexOf("="); + int equalsPos = arg.indexOf(QLatin1String("=")); QString valueStr; if (equalsPos != -1) { valueStr = arg.mid(equalsPos +1); // right arg = arg.mid(0, equalsPos); // left } // check format -x --xx... - bool isDoubleDashed = arg.startsWith("--"); + bool isDoubleDashed = arg.startsWith(QLatin1String("--")); ok = isDoubleDashed ? arg.length() > 3 : arg.length() == 2; if (!ok) { @@ -182,8 +182,8 @@ ok = option.checkValue(valueStr); if (!ok) { QString err = option.errorMsg(); - if (!err.endsWith(".")) - err += "."; + if (!err.endsWith(QLatin1String("."))) + err += QLatin1String("."); out << err; return ok; } @@ -219,7 +219,7 @@ // process the other args for (; it != args.cend() && ok; ++it) { const QString &value = *it; - if (value.startsWith("-")) { + if (value.startsWith(QLatin1String("-"))) { ok = processOptions(args, it, actualNode); } else { @@ -326,7 +326,7 @@ } QString argText = node->subNodes.isEmpty() ? "" : "[arguments]"; helpText += QStringLiteral("Usage: %1 [%2-options] %3\n\n") - .arg(args.join(" ")) + .arg(args.join(QStringLiteral(" "))) .arg(argName).arg(argText); // add command options and subarguments QList subArgs; diff -Nru flameshot-0.6.0/src/cli/commandlineparser.h flameshot-0.6.0+git20190714/src/cli/commandlineparser.h --- flameshot-0.6.0/src/cli/commandlineparser.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/cli/commandlineparser.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/cli/commandoption.cpp flameshot-0.6.0+git20190714/src/cli/commandoption.cpp --- flameshot-0.6.0/src/cli/commandoption.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/cli/commandoption.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -70,7 +70,7 @@ void CommandOption::setValue(const QString &value) { if (m_valueName.isEmpty()) { - m_valueName = "value"; + m_valueName = QLatin1String("value"); } m_value = value; } diff -Nru flameshot-0.6.0/src/cli/commandoption.h flameshot-0.6.0+git20190714/src/cli/commandoption.h --- flameshot-0.6.0/src/cli/commandoption.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/cli/commandoption.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/config/buttonlistview.cpp flameshot-0.6.0+git20190714/src/config/buttonlistview.cpp --- flameshot-0.6.0/src/config/buttonlistview.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/config/buttonlistview.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/config/buttonlistview.h flameshot-0.6.0+git20190714/src/config/buttonlistview.h --- flameshot-0.6.0/src/config/buttonlistview.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/config/buttonlistview.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/config/clickablelabel.cpp flameshot-0.6.0+git20190714/src/config/clickablelabel.cpp --- flameshot-0.6.0/src/config/clickablelabel.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/config/clickablelabel.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/config/clickablelabel.h flameshot-0.6.0+git20190714/src/config/clickablelabel.h --- flameshot-0.6.0/src/config/clickablelabel.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/config/clickablelabel.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/config/configwindow.cpp flameshot-0.6.0+git20190714/src/config/configwindow.cpp --- flameshot-0.6.0/src/config/configwindow.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/config/configwindow.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/config/configwindow.h flameshot-0.6.0+git20190714/src/config/configwindow.h --- flameshot-0.6.0/src/config/configwindow.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/config/configwindow.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/config/extendedslider.cpp flameshot-0.6.0+git20190714/src/config/extendedslider.cpp --- flameshot-0.6.0/src/config/extendedslider.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/config/extendedslider.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/config/extendedslider.h flameshot-0.6.0+git20190714/src/config/extendedslider.h --- flameshot-0.6.0/src/config/extendedslider.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/config/extendedslider.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/config/filenameeditor.cpp flameshot-0.6.0+git20190714/src/config/filenameeditor.cpp --- flameshot-0.6.0/src/config/filenameeditor.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/config/filenameeditor.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/config/filenameeditor.h flameshot-0.6.0+git20190714/src/config/filenameeditor.h --- flameshot-0.6.0/src/config/filenameeditor.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/config/filenameeditor.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/config/geneneralconf.cpp flameshot-0.6.0+git20190714/src/config/geneneralconf.cpp --- flameshot-0.6.0/src/config/geneneralconf.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/config/geneneralconf.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -36,6 +36,7 @@ initShowDesktopNotification(); initShowTrayIcon(); initAutostart(); + initCloseAfterCapture(); // this has to be at the end initConfingButtons(); @@ -47,6 +48,7 @@ m_helpMessage->setChecked(config.showHelpValue()); m_sysNotifications->setChecked(config.desktopNotificationValue()); m_autostart->setChecked(config.startupLaunchValue()); + m_closeAfterCapture->setChecked(config.closeAfterScreenshotValue()); #if defined(Q_OS_LINUX) || defined(Q_OS_UNIX) m_showTray->setChecked(!config.disabledTrayIconValue()); @@ -74,6 +76,10 @@ ConfigHandler().setStartupLaunch(checked); } +void GeneneralConf::closeAfterCaptureChanged(bool checked) { + ConfigHandler().setCloseAfterScreenshot(checked); +} + void GeneneralConf::importConfiguration() { QString fileName = QFileDialog::getOpenFileName(this, tr("Import")); if (fileName.isEmpty()) { @@ -99,7 +105,7 @@ void GeneneralConf::exportFileConfiguration() { QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"), - "flameshot.conf"); + QStringLiteral("flameshot.conf")); // Cancel button if (fileName.isNull()) { @@ -163,7 +169,7 @@ m_showTray->setToolTip(tr("Show the systemtray icon")); m_layout->addWidget(m_showTray); - connect(m_showTray, &QCheckBox::clicked, this, + connect(m_showTray, &QCheckBox::stateChanged, this, &GeneneralConf::showTrayIconChanged); #endif } @@ -204,3 +210,15 @@ connect(m_autostart, &QCheckBox::clicked, this, &GeneneralConf::autostartChanged); } + +void GeneneralConf::initCloseAfterCapture() { + m_closeAfterCapture = new QCheckBox(tr("Close after capture"), this); + ConfigHandler config; + bool checked = config.closeAfterScreenshotValue(); + m_closeAfterCapture->setChecked(checked); + m_closeAfterCapture->setToolTip(tr("Close after taking a screenshot")); + m_layout->addWidget(m_closeAfterCapture); + + connect(m_closeAfterCapture, &QCheckBox::clicked, this, + &GeneneralConf::closeAfterCaptureChanged); +} diff -Nru flameshot-0.6.0/src/config/geneneralconf.h flameshot-0.6.0+git20190714/src/config/geneneralconf.h --- flameshot-0.6.0/src/config/geneneralconf.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/config/geneneralconf.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -36,6 +36,7 @@ void showDesktopNotificationChanged(bool checked); void showTrayIconChanged(bool checked); void autostartChanged(bool checked); + void closeAfterCaptureChanged(bool checked); void importConfiguration(); void exportFileConfiguration(); void resetConfiguration(); @@ -46,6 +47,7 @@ QCheckBox *m_showTray; QCheckBox *m_helpMessage; QCheckBox *m_autostart; + QCheckBox *m_closeAfterCapture; QPushButton *m_importButton; QPushButton *m_exportButton; QPushButton *m_resetButton; @@ -55,4 +57,5 @@ void initShowTrayIcon(); void initConfingButtons(); void initAutostart(); + void initCloseAfterCapture(); }; diff -Nru flameshot-0.6.0/src/config/strftimechooserwidget.cpp flameshot-0.6.0+git20190714/src/config/strftimechooserwidget.cpp --- flameshot-0.6.0/src/config/strftimechooserwidget.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/config/strftimechooserwidget.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/config/strftimechooserwidget.h flameshot-0.6.0+git20190714/src/config/strftimechooserwidget.h --- flameshot-0.6.0/src/config/strftimechooserwidget.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/config/strftimechooserwidget.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/config/uicoloreditor.cpp flameshot-0.6.0+git20190714/src/config/uicoloreditor.cpp --- flameshot-0.6.0/src/config/uicoloreditor.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/config/uicoloreditor.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -125,7 +125,7 @@ h2->addWidget(frame2); frame2->setFixedSize(frameSize, frameSize); m_labelContrast = new ClickableLabel(tr("Contrast Color"), this); - m_labelContrast->setStyleSheet("color : gray"); + m_labelContrast->setStyleSheet(QStringLiteral("color : gray")); h2->addWidget(m_labelContrast); m_vLayout->addLayout(h2); @@ -149,7 +149,7 @@ if (m_lastButtonPressed != b) { m_lastButtonPressed = b; - QString offStyle("QLabel { color : gray; }"); + QString offStyle(QStringLiteral("QLabel { color : gray; }")); if (b == m_buttonMainColor) { m_colorWheel->setColor(m_uiColor); diff -Nru flameshot-0.6.0/src/config/uicoloreditor.h flameshot-0.6.0+git20190714/src/config/uicoloreditor.h --- flameshot-0.6.0/src/config/uicoloreditor.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/config/uicoloreditor.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/config/visualseditor.cpp flameshot-0.6.0+git20190714/src/config/visualseditor.cpp --- flameshot-0.6.0/src/config/visualseditor.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/config/visualseditor.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -45,9 +45,9 @@ connect(m_opacitySlider, &ExtendedSlider::modificationsEnded, this, &VisualsEditor::saveOpacity); QHBoxLayout *localLayout = new QHBoxLayout(); - localLayout->addWidget(new QLabel("0%")); + localLayout->addWidget(new QLabel(QStringLiteral("0%"))); localLayout->addWidget(m_opacitySlider); - localLayout->addWidget(new QLabel("100%")); + localLayout->addWidget(new QLabel(QStringLiteral("100%"))); QLabel *label = new QLabel(); QString labelMsg = tr("Opacity of area outside selection:") + " %1%"; diff -Nru flameshot-0.6.0/src/config/visualseditor.h flameshot-0.6.0+git20190714/src/config/visualseditor.h --- flameshot-0.6.0/src/config/visualseditor.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/config/visualseditor.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/core/capturerequest.cpp flameshot-0.6.0+git20190714/src/core/capturerequest.cpp --- flameshot-0.6.0/src/core/capturerequest.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/core/capturerequest.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/core/capturerequest.h flameshot-0.6.0+git20190714/src/core/capturerequest.h --- flameshot-0.6.0/src/core/capturerequest.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/core/capturerequest.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -37,7 +37,7 @@ CaptureRequest(CaptureMode mode, const uint delay = 0, - const QString &path = "", + const QString &path = QLatin1String(""), const QVariant &data = QVariant(), ExportTask tasks = NO_TASK); diff -Nru flameshot-0.6.0/src/core/controller.cpp flameshot-0.6.0+git20190714/src/core/controller.cpp --- flameshot-0.6.0/src/core/controller.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/core/controller.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -21,6 +21,7 @@ #include "src/widgets/infowindow.h" #include "src/config/configwindow.h" #include "src/widgets/capture/capturebutton.h" +#include "src/widgets/capturelauncher.h" #include "src/utils/systemnotification.h" #include "src/utils/screengrabber.h" #include @@ -161,6 +162,11 @@ } } +void Controller::openLauncherWindow() { + CaptureLauncher *w = new CaptureLauncher(); + w->show(); +} + void Controller::enableTrayIcon() { if (m_trayIcon) { return; @@ -171,6 +177,9 @@ // Wait 400 ms to hide the QMenu doLater(400, this, [this](){ this->startVisualCapture(); }); }); + QAction *launcherAction = new QAction(tr("&Open Launcher"), this); + connect(launcherAction, &QAction::triggered, this, + &Controller::openLauncherWindow); QAction *configAction = new QAction(tr("&Configuration"), this); connect(configAction, &QAction::triggered, this, &Controller::openConfigWindow); @@ -183,13 +192,15 @@ QMenu *trayIconMenu = new QMenu(); trayIconMenu->addAction(captureAction); + trayIconMenu->addAction(launcherAction); + trayIconMenu->addSeparator(); trayIconMenu->addAction(configAction); trayIconMenu->addAction(infoAction); trayIconMenu->addSeparator(); trayIconMenu->addAction(quitAction); m_trayIcon = new QSystemTrayIcon(); - m_trayIcon->setToolTip("Flameshot"); + m_trayIcon->setToolTip(QStringLiteral("Flameshot")); m_trayIcon->setContextMenu(trayIconMenu); QIcon trayicon = QIcon::fromTheme("flameshot-tray", QIcon(":img/app/flameshot.png")); m_trayIcon->setIcon(trayicon); @@ -244,10 +255,17 @@ it.value().exportCapture(p); m_requestMap.erase(it); } + if (ConfigHandler().closeAfterScreenshotValue()) { + QApplication::quit(); + } } void Controller::handleCaptureFailed(uint id) { m_requestMap.remove(id); + + if (ConfigHandler().closeAfterScreenshotValue()) { + QApplication::quit(); + } } void Controller::doLater(int msec, QObject *receiver, lambda func) { diff -Nru flameshot-0.6.0/src/core/controller.h flameshot-0.6.0+git20190714/src/core/controller.h --- flameshot-0.6.0/src/core/controller.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/core/controller.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -52,10 +52,11 @@ void openConfigWindow(); void openInfoWindow(); + void openLauncherWindow(); void enableTrayIcon(); void disableTrayIcon(); void sendTrayNotification(const QString &text, - const QString &title = "Flameshot Info", + const QString &title = QStringLiteral("Flameshot Info"), const int timeout = 5000); void updateConfigComponents(); diff -Nru flameshot-0.6.0/src/core/flameshotdbusadapter.cpp flameshot-0.6.0+git20190714/src/core/flameshotdbusadapter.cpp --- flameshot-0.6.0/src/core/flameshotdbusadapter.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/core/flameshotdbusadapter.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -59,6 +59,10 @@ Controller::getInstance()->requestCapture(req); } +void FlameshotDBusAdapter::openLauncher() { + Controller::getInstance()->openLauncherWindow(); +} + void FlameshotDBusAdapter::captureScreen(int number, QString path, bool toClipboard, int delay, uint id) { diff -Nru flameshot-0.6.0/src/core/flameshotdbusadapter.h flameshot-0.6.0+git20190714/src/core/flameshotdbusadapter.h --- flameshot-0.6.0/src/core/flameshotdbusadapter.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/core/flameshotdbusadapter.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -36,6 +36,7 @@ Q_NOREPLY void graphicCapture(QString path, int delay, uint id); Q_NOREPLY void fullScreen(QString path, bool toClipboard, int delay, uint id); Q_NOREPLY void captureScreen(int number, QString path, bool toClipboard, int delay, uint id); + Q_NOREPLY void openLauncher(); Q_NOREPLY void openConfig(); Q_NOREPLY void trayIconEnabled(bool enabled); Q_NOREPLY void autostartEnabled(bool enabled); diff -Nru flameshot-0.6.0/src/core/globalshortcutfilter.cpp flameshot-0.6.0+git20190714/src/core/globalshortcutfilter.cpp --- flameshot-0.6.0/src/core/globalshortcutfilter.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/core/globalshortcutfilter.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/core/globalshortcutfilter.h flameshot-0.6.0+git20190714/src/core/globalshortcutfilter.h --- flameshot-0.6.0/src/core/globalshortcutfilter.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/core/globalshortcutfilter.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/main.cpp flameshot-0.6.0+git20190714/src/main.cpp --- flameshot-0.6.0/src/main.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/main.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -24,6 +24,7 @@ #include "src/utils/pathinfo.h" #include "src/core/capturerequest.h" #include +#include #include #include #include @@ -46,22 +47,26 @@ if (argc == 1) { SingleApplication app(argc, argv); - QTranslator translator; + QTranslator translator, qtTranslator; QStringList trPaths = PathInfo::translationsPaths(); for (const QString &path: trPaths) { bool match = translator.load(QLocale(), - "Internationalization", "_", + QStringLiteral("Internationalization"), QStringLiteral("_"), path); if (match) { break; } } + qtTranslator.load(QLocale::system(), "qt", "_", + QLibraryInfo::location(QLibraryInfo::TranslationsPath)); + app.installTranslator(&translator); + app.installTranslator(&qtTranslator); app.setAttribute(Qt::AA_DontCreateNativeWidgetSiblings, true); - app.setApplicationName("flameshot"); - app.setOrganizationName("Dharkael"); + app.setApplicationName(QStringLiteral("flameshot")); + app.setOrganizationName(QStringLiteral("Dharkael")); auto c = Controller::getInstance(); #if defined(Q_OS_LINUX) || defined(Q_OS_UNIX) @@ -71,8 +76,8 @@ SystemNotification().sendMessage( QObject::tr("Unable to connect via DBus")); } - dbus.registerObject("/", c); - dbus.registerService("org.dharkael.Flameshot"); + dbus.registerObject(QStringLiteral("/"), c); + dbus.registerService(QStringLiteral("org.dharkael.Flameshot")); #endif // Exporting captures must be connected after the dbus interface // or the dbus signal gets blocked until we end the exports. @@ -85,66 +90,67 @@ * CLI parsing | * ------------*/ QCoreApplication app(argc, argv); - app.setApplicationName("flameshot"); - app.setOrganizationName("Dharkael"); + app.setApplicationName(QStringLiteral("flameshot")); + app.setOrganizationName(QStringLiteral("Dharkael")); app.setApplicationVersion(qApp->applicationVersion()); CommandLineParser parser; // Add description parser.setDescription( - "Powerful yet simple to use screenshot software."); - parser.setGeneralErrorMessage("See 'flameshot --help'."); + QStringLiteral("Powerful yet simple to use screenshot software.")); + parser.setGeneralErrorMessage(QStringLiteral("See 'flameshot --help'.")); // Arguments - CommandArgument fullArgument("full", "Capture the entire desktop."); - CommandArgument guiArgument("gui", "Start a manual capture in GUI mode."); - CommandArgument configArgument("config", "Configure flameshot."); - CommandArgument screenArgument("screen", "Capture a single screen."); + CommandArgument fullArgument(QStringLiteral("full"), QStringLiteral("Capture the entire desktop.")); + CommandArgument launcherArgument(QStringLiteral("launcher"), QStringLiteral("Open the capture launcher.")); + CommandArgument guiArgument(QStringLiteral("gui"), QStringLiteral("Start a manual capture in GUI mode.")); + CommandArgument configArgument(QStringLiteral("config"), QStringLiteral("Configure flameshot.")); + CommandArgument screenArgument(QStringLiteral("screen"), QStringLiteral("Capture a single screen.")); // Options CommandOption pathOption( {"p", "path"}, - "Path where the capture will be saved", - "path"); + QStringLiteral("Path where the capture will be saved"), + QStringLiteral("path")); CommandOption clipboardOption( {"c", "clipboard"}, - "Save the capture to the clipboard"); + QStringLiteral("Save the capture to the clipboard")); CommandOption delayOption( {"d", "delay"}, - "Delay time in milliseconds", - "milliseconds"); + QStringLiteral("Delay time in milliseconds"), + QStringLiteral("milliseconds")); CommandOption filenameOption( {"f", "filename"}, - "Set the filename pattern", - "pattern"); + QStringLiteral("Set the filename pattern"), + QStringLiteral("pattern")); CommandOption trayOption( {"t", "trayicon"}, - "Enable or disable the trayicon", - "bool"); + QStringLiteral("Enable or disable the trayicon"), + QStringLiteral("bool")); CommandOption autostartOption( {"a", "autostart"}, - "Enable or disable run at startup", - "bool"); + QStringLiteral("Enable or disable run at startup"), + QStringLiteral("bool")); CommandOption showHelpOption( {"s", "showhelp"}, - "Show the help message in the capture mode", - "bool"); + QStringLiteral("Show the help message in the capture mode"), + QStringLiteral("bool")); CommandOption mainColorOption( {"m", "maincolor"}, - "Define the main UI color", - "color-code"); + QStringLiteral("Define the main UI color"), + QStringLiteral("color-code")); CommandOption contrastColorOption( {"k", "contrastcolor"}, - "Define the contrast UI color", - "color-code"); + QStringLiteral("Define the contrast UI color"), + QStringLiteral("color-code")); CommandOption rawImageOption( {"r", "raw"}, - "Print raw PNG capture"); + QStringLiteral("Print raw PNG capture")); CommandOption screenNumberOption( {"n", "number"}, - "Define the screen to capture,\ndefault: screen containing the cursor", - "Screen number", "-1"); + QStringLiteral("Define the screen to capture,\ndefault: screen containing the cursor"), + QStringLiteral("Screen number"), QStringLiteral("-1")); // Add checkers - auto colorChecker = [&parser](const QString &colorCode) -> bool { + auto colorChecker = [](const QString &colorCode) -> bool { QColor parsedColor(colorCode); return parsedColor.isValid() && parsedColor.alphaF() == 1.0; }; @@ -156,15 +162,15 @@ "- Named colors like 'blue' or 'red'\n" "You may need to escape the '#' sign as in '\\#FFF'"; - const QString delayErr = "Invalid delay, it must be higher than 0"; - const QString numberErr = "Invalid screen number, it must be non negative"; - auto numericChecker = [&parser](const QString &delayValue) -> bool { + const QString delayErr = QStringLiteral("Invalid delay, it must be higher than 0"); + const QString numberErr = QStringLiteral("Invalid screen number, it must be non negative"); + auto numericChecker = [](const QString &delayValue) -> bool { int value = delayValue.toInt(); return value >= 0; }; - const QString pathErr = "Invalid path, it must be a real path in the system"; - auto pathChecker = [&parser, pathErr](const QString &pathValue) -> bool { + const QString pathErr = QStringLiteral("Invalid path, it must be a real path in the system"); + auto pathChecker = [pathErr](const QString &pathValue) -> bool { bool res = QDir(pathValue).exists(); if (!res) { SystemNotification().sendMessage(QObject::tr(pathErr.toLatin1().data())); @@ -172,9 +178,9 @@ return res; }; - const QString booleanErr = "Invalid value, it must be defined as 'true' or 'false'"; - auto booleanChecker = [&parser](const QString &value) -> bool { - return value == "true" || value == "false"; + const QString booleanErr = QStringLiteral("Invalid value, it must be defined as 'true' or 'false'"); + auto booleanChecker = [](const QString &value) -> bool { + return value == QLatin1String("true") || value == QLatin1String("false"); }; contrastColorOption.addChecker(colorChecker, colorErr); @@ -190,6 +196,7 @@ parser.AddArgument(guiArgument); parser.AddArgument(screenArgument); parser.AddArgument(fullArgument); + parser.AddArgument(launcherArgument); parser.AddArgument(configArgument); auto helpOption = parser.addHelpOption(); auto versionOption = parser.addVersionOption(); @@ -211,6 +218,16 @@ //-------------- if (parser.isSet(helpOption) || parser.isSet(versionOption)) { } + else if (parser.isSet(launcherArgument)) { // LAUNCHER + QDBusMessage m = QDBusMessage::createMethodCall(QStringLiteral("org.dharkael.Flameshot"), + QStringLiteral("/"), QLatin1String(""), QStringLiteral("openLauncher")); + QDBusConnection sessionBus = QDBusConnection::sessionBus(); + if (!sessionBus.isConnected()) { + SystemNotification().sendMessage( + QObject::tr("Unable to connect via DBus")); + } + sessionBus.call(m); + } else if (parser.isSet(guiArgument)) { // GUI QString pathValue = parser.value(pathOption); int delay = parser.value(delayOption).toInt(); @@ -220,8 +237,8 @@ uint id = req.id(); // Send message - QDBusMessage m = QDBusMessage::createMethodCall("org.dharkael.Flameshot", - "/", "", "graphicCapture"); + QDBusMessage m = QDBusMessage::createMethodCall(QStringLiteral("org.dharkael.Flameshot"), + QStringLiteral("/"), QLatin1String(""), QStringLiteral("graphicCapture")); m << pathValue << delay << id; QDBusConnection sessionBus = QDBusConnection::sessionBus(); dbusUtils.checkDBusConnection(sessionBus); @@ -235,7 +252,7 @@ &QCoreApplication::quit); t.start(); // wait - app.exec(); + return app.exec(); } } else if (parser.isSet(fullArgument)) { // FULL @@ -248,10 +265,10 @@ QTextStream out(stdout); out << "Invalid format, set where to save the content with one of " << "the following flags:\n " - << pathOption.dashedNames().join(", ") << "\n " - << rawImageOption.dashedNames().join(", ") << "\n " - << clipboardOption.dashedNames().join(", ") << "\n\n"; - parser.parse(QStringList() << argv[0] << "full" << "-h"); + << pathOption.dashedNames().join(QStringLiteral(", ")) << "\n " + << rawImageOption.dashedNames().join(QStringLiteral(", ")) << "\n " + << clipboardOption.dashedNames().join(QStringLiteral(", ")) << "\n\n"; + parser.parse(QStringList() << argv[0] << QStringLiteral("full") << QStringLiteral("-h")); goto finish; } @@ -266,8 +283,8 @@ DBusUtils dbusUtils; // Send message - QDBusMessage m = QDBusMessage::createMethodCall("org.dharkael.Flameshot", - "/", "", "fullScreen"); + QDBusMessage m = QDBusMessage::createMethodCall(QStringLiteral("org.dharkael.Flameshot"), + QStringLiteral("/"), QLatin1String(""), QStringLiteral("fullScreen")); m << pathValue << toClipboard << delay << id; QDBusConnection sessionBus = QDBusConnection::sessionBus(); dbusUtils.checkDBusConnection(sessionBus); @@ -282,12 +299,12 @@ &QCoreApplication::quit); t.start(); // wait - app.exec(); + return app.exec(); } } else if (parser.isSet(screenArgument)) { // SCREEN QString numberStr = parser.value(screenNumberOption); - int number = numberStr.startsWith("-") ? -1 : numberStr.toInt(); + int number = numberStr.startsWith(QLatin1String("-")) ? -1 : numberStr.toInt(); QString pathValue = parser.value(pathOption); int delay = parser.value(delayOption).toInt(); bool toClipboard = parser.isSet(clipboardOption); @@ -297,10 +314,10 @@ QTextStream out(stdout); out << "Invalid format, set where to save the content with one of " << "the following flags:\n " - << pathOption.dashedNames().join(", ") << "\n " - << rawImageOption.dashedNames().join(", ") << "\n " - << clipboardOption.dashedNames().join(", ") << "\n\n"; - parser.parse(QStringList() << argv[0] << "screen" << "-h"); + << pathOption.dashedNames().join(QStringLiteral(", ")) << "\n " + << rawImageOption.dashedNames().join(QStringLiteral(", ")) << "\n " + << clipboardOption.dashedNames().join(QStringLiteral(", ")) << "\n\n"; + parser.parse(QStringList() << argv[0] << QStringLiteral("screen") << QStringLiteral("-h")); goto finish; } @@ -316,8 +333,8 @@ DBusUtils dbusUtils; // Send message - QDBusMessage m = QDBusMessage::createMethodCall("org.dharkael.Flameshot", - "/", "", "captureScreen"); + QDBusMessage m = QDBusMessage::createMethodCall(QStringLiteral("org.dharkael.Flameshot"), + QStringLiteral("/"), QLatin1String(""), QStringLiteral("captureScreen")); m << number << pathValue << toClipboard << delay << id; QDBusConnection sessionBus = QDBusConnection::sessionBus(); dbusUtils.checkDBusConnection(sessionBus); @@ -332,7 +349,7 @@ &QCoreApplication::quit); t.start(); // wait - app.exec(); + return app.exec(); } } else if (parser.isSet(configArgument)) { // CONFIG @@ -346,11 +363,11 @@ mainColor || contrastColor); ConfigHandler config; if (autostart) { - QDBusMessage m = QDBusMessage::createMethodCall("org.dharkael.Flameshot", - "/", "", "autostartEnabled"); - if (parser.value(autostartOption) == "false") { + QDBusMessage m = QDBusMessage::createMethodCall(QStringLiteral("org.dharkael.Flameshot"), + QStringLiteral("/"), QLatin1String(""), QStringLiteral("autostartEnabled")); + if (parser.value(autostartOption) == QLatin1String("false")) { m << false; - } else if (parser.value(autostartOption) == "true") { + } else if (parser.value(autostartOption) == QLatin1String("true")) { m << true; } QDBusConnection sessionBus = QDBusConnection::sessionBus(); @@ -370,11 +387,11 @@ .arg(fh.parsedPattern()); } if (tray) { - QDBusMessage m = QDBusMessage::createMethodCall("org.dharkael.Flameshot", - "/", "", "trayIconEnabled"); - if (parser.value(trayOption) == "false") { + QDBusMessage m = QDBusMessage::createMethodCall(QStringLiteral("org.dharkael.Flameshot"), + QStringLiteral("/"), QLatin1String(""), QStringLiteral("trayIconEnabled")); + if (parser.value(trayOption) == QLatin1String("false")) { m << false; - } else if (parser.value(trayOption) == "true") { + } else if (parser.value(trayOption) == QLatin1String("true")) { m << true; } QDBusConnection sessionBus = QDBusConnection::sessionBus(); @@ -385,9 +402,9 @@ sessionBus.call(m); } if (help) { - if (parser.value(showHelpOption) == "false") { + if (parser.value(showHelpOption) == QLatin1String("false")) { config.setShowHelp(false); - } else if (parser.value(showHelpOption) == "true") { + } else if (parser.value(showHelpOption) == QLatin1String("true")) { config.setShowHelp(true); } } @@ -404,8 +421,8 @@ // Open gui when no options if (!someFlagSet) { - QDBusMessage m = QDBusMessage::createMethodCall("org.dharkael.Flameshot", - "/", "", "openConfig"); + QDBusMessage m = QDBusMessage::createMethodCall(QStringLiteral("org.dharkael.Flameshot"), + QStringLiteral("/"), QLatin1String(""), QStringLiteral("openConfig")); QDBusConnection sessionBus = QDBusConnection::sessionBus(); if (!sessionBus.isConnected()) { SystemNotification().sendMessage( diff -Nru flameshot-0.6.0/src/third-party/singleapplication/singleapplication.cpp flameshot-0.6.0+git20190714/src/third-party/singleapplication/singleapplication.cpp --- flameshot-0.6.0/src/third-party/singleapplication/singleapplication.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/third-party/singleapplication/singleapplication.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -107,7 +107,7 @@ #endif #ifdef Q_OS_UNIX QProcess process; - process.start( "whoami" ); + process.start( QStringLiteral("whoami") ); if( process.waitForFinished( timeout ) && process.exitCode() == QProcess::NormalExit) { appData.addData( process.readLine() ); diff -Nru flameshot-0.6.0/src/tools/abstractactiontool.cpp flameshot-0.6.0+git20190714/src/tools/abstractactiontool.cpp --- flameshot-0.6.0/src/tools/abstractactiontool.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/abstractactiontool.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/abstractactiontool.h flameshot-0.6.0+git20190714/src/tools/abstractactiontool.h --- flameshot-0.6.0/src/tools/abstractactiontool.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/abstractactiontool.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/abstractpathtool.cpp flameshot-0.6.0+git20190714/src/tools/abstractpathtool.cpp --- flameshot-0.6.0/src/tools/abstractpathtool.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/abstractpathtool.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/abstractpathtool.h flameshot-0.6.0+git20190714/src/tools/abstractpathtool.h --- flameshot-0.6.0/src/tools/abstractpathtool.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/abstractpathtool.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/abstracttwopointtool.cpp flameshot-0.6.0+git20190714/src/tools/abstracttwopointtool.cpp --- flameshot-0.6.0/src/tools/abstracttwopointtool.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/abstracttwopointtool.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -16,6 +16,29 @@ // along with Flameshot. If not, see . #include "abstracttwopointtool.h" +#include + +namespace { + +const double ADJ_UNIT = std::atan(1.0); +const int DIRS_NUMBER = 4; + +enum UNIT { + HORIZ_DIR = 0, + DIAG1_DIR = 1, + VERT_DIR = 2, + DIAG2_DIR = 3 +}; + +const double ADJ_DIAG_UNIT = 2 * ADJ_UNIT; +const int DIAG_DIRS_NUMBER = 2; + +enum DIAG_UNIT { + DIR1 = 0, + DIR2 = 1 +}; + +} AbstractTwoPointTool::AbstractTwoPointTool(QObject *parent) : CaptureTool(parent), m_thickness(0), m_padding(0) @@ -52,6 +75,10 @@ m_points.second = p; } +void AbstractTwoPointTool::drawMoveWithAdjustment(const QPoint &p) { + m_points.second = m_points.first + adjustedVector(p - m_points.first); +} + void AbstractTwoPointTool::colorChanged(const QColor &c) { m_color = c; } @@ -70,3 +97,39 @@ r += QMargins(val, val, val, val); return r.intersected(limits); } + +QPoint AbstractTwoPointTool::adjustedVector(QPoint v) const { + if (m_supportsOrthogonalAdj && m_supportsDiagonalAdj) { + int dir = ( static_cast(round(atan2(-v.y(), v.x()) / ADJ_UNIT)) + DIRS_NUMBER ) % DIRS_NUMBER; + if (dir == UNIT::HORIZ_DIR) { + v.setY(0); + } else if (dir == UNIT::VERT_DIR) { + v.setX(0); + } else if (dir == UNIT::DIAG1_DIR) { + int newX = (v.x() - v.y()) / 2; + int newY = -newX; + v.setX(newX); + v.setY(newY); + } else { + int newX = (v.x() + v.y()) / 2; + int newY = newX; + v.setX(newX); + v.setY(newY); + } + } else if (m_supportsDiagonalAdj) { + int dir = ( static_cast(round((atan2(-v.y(), v.x()) - ADJ_DIAG_UNIT / 2) / ADJ_DIAG_UNIT)) + + DIAG_DIRS_NUMBER ) % DIAG_DIRS_NUMBER; + if (dir == DIAG_UNIT::DIR1) { + int newX = (v.x() - v.y()) / 2; + int newY = -newX; + v.setX(newX); + v.setY(newY); + } else { + int newX = (v.x() + v.y()) / 2; + int newY = newX; + v.setX(newX); + v.setY(newY); + } + } + return v; +} diff -Nru flameshot-0.6.0/src/tools/abstracttwopointtool.h flameshot-0.6.0+git20190714/src/tools/abstracttwopointtool.h --- flameshot-0.6.0/src/tools/abstracttwopointtool.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/abstracttwopointtool.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -34,6 +34,7 @@ public slots: void drawEnd(const QPoint &p) override; void drawMove(const QPoint &p) override; + void drawMoveWithAdjustment(const QPoint &p) override; void colorChanged(const QColor &c) override; void thicknessChanged(const int th) override; @@ -48,4 +49,9 @@ // use m_padding to extend the area of the backup int m_padding; + bool m_supportsOrthogonalAdj = false; + bool m_supportsDiagonalAdj = false; + +private: + QPoint adjustedVector(QPoint v) const; }; diff -Nru flameshot-0.6.0/src/tools/arrow/arrowtool.cpp flameshot-0.6.0+git20190714/src/tools/arrow/arrowtool.cpp --- flameshot-0.6.0/src/tools/arrow/arrowtool.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/arrow/arrowtool.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -70,6 +70,8 @@ ArrowTool::ArrowTool(QObject *parent) : AbstractTwoPointTool(parent) { m_padding = ArrowWidth / 2; + m_supportsOrthogonalAdj = true; + m_supportsDiagonalAdj = true; } QIcon ArrowTool::icon(const QColor &background, bool inEditor) const { @@ -81,11 +83,11 @@ } QString ArrowTool::nameID() { - return ""; + return QLatin1String(""); } QString ArrowTool::description() const { - return tr("Sets the Arrow as the paint tool"); + return tr("Set the Arrow as the paint tool"); } CaptureTool* ArrowTool::copy(QObject *parent) { diff -Nru flameshot-0.6.0/src/tools/arrow/arrowtool.h flameshot-0.6.0+git20190714/src/tools/arrow/arrowtool.h --- flameshot-0.6.0/src/tools/arrow/arrowtool.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/arrow/arrowtool.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/blur/blurtool.cpp flameshot-0.6.0+git20190714/src/tools/blur/blurtool.cpp --- flameshot-0.6.0/src/tools/blur/blurtool.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/blur/blurtool.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -35,11 +35,11 @@ } QString BlurTool::nameID() { - return ""; + return QLatin1String(""); } QString BlurTool::description() const { - return tr("Sets the Blur as the paint tool"); + return tr("Set Blur as the paint tool"); } CaptureTool* BlurTool::copy(QObject *parent) { diff -Nru flameshot-0.6.0/src/tools/blur/blurtool.h flameshot-0.6.0+git20190714/src/tools/blur/blurtool.h --- flameshot-0.6.0/src/tools/blur/blurtool.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/blur/blurtool.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/capturecontext.cpp flameshot-0.6.0+git20190714/src/tools/capturecontext.cpp --- flameshot-0.6.0/src/tools/capturecontext.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/capturecontext.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/capturecontext.h flameshot-0.6.0+git20190714/src/tools/capturecontext.h --- flameshot-0.6.0/src/tools/capturecontext.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/capturecontext.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/capturetool.h flameshot-0.6.0+git20190714/src/tools/capturetool.h --- flameshot-0.6.0/src/tools/capturetool.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/capturetool.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -135,6 +135,11 @@ virtual void drawEnd(const QPoint &p) = 0; // Mouse pressed and moving, called once a pixel. virtual void drawMove(const QPoint &p) = 0; + // Called when drawMove is needed with an adjustment; + // should be overridden in case an adjustment is applicable. + virtual void drawMoveWithAdjustment(const QPoint &p) { + drawMove(p); + } // Called when the tool is activated. virtual void drawStart(const CaptureContext &context) = 0; // Called right after pressign the button which activates the tool. diff -Nru flameshot-0.6.0/src/tools/circle/circletool.cpp flameshot-0.6.0+git20190714/src/tools/circle/circletool.cpp --- flameshot-0.6.0/src/tools/circle/circletool.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/circle/circletool.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -23,7 +23,7 @@ } CircleTool::CircleTool(QObject *parent) : AbstractTwoPointTool(parent) { - + m_supportsDiagonalAdj = true; } QIcon CircleTool::icon(const QColor &background, bool inEditor) const { @@ -35,11 +35,11 @@ } QString CircleTool::nameID() { - return ""; + return QLatin1String(""); } QString CircleTool::description() const { - return tr("Sets the Circle as the paint tool"); + return tr("Set the Circle as the paint tool"); } CaptureTool* CircleTool::copy(QObject *parent) { diff -Nru flameshot-0.6.0/src/tools/circle/circletool.h flameshot-0.6.0+git20190714/src/tools/circle/circletool.h --- flameshot-0.6.0/src/tools/circle/circletool.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/circle/circletool.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/copy/copytool.cpp flameshot-0.6.0+git20190714/src/tools/copy/copytool.cpp --- flameshot-0.6.0/src/tools/copy/copytool.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/copy/copytool.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -36,11 +36,11 @@ } QString CopyTool::nameID() { - return ""; + return QLatin1String(""); } QString CopyTool::description() const { - return tr("Copies the selection into the clipboard"); + return tr("Copy the selection into the clipboard"); } CaptureTool* CopyTool::copy(QObject *parent) { diff -Nru flameshot-0.6.0/src/tools/copy/copytool.h flameshot-0.6.0+git20190714/src/tools/copy/copytool.h --- flameshot-0.6.0/src/tools/copy/copytool.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/copy/copytool.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/exit/exittool.cpp flameshot-0.6.0+git20190714/src/tools/exit/exittool.cpp --- flameshot-0.6.0/src/tools/exit/exittool.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/exit/exittool.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -35,7 +35,7 @@ } QString ExitTool::nameID() { - return ""; + return QLatin1String(""); } QString ExitTool::description() const { diff -Nru flameshot-0.6.0/src/tools/exit/exittool.h flameshot-0.6.0+git20190714/src/tools/exit/exittool.h --- flameshot-0.6.0/src/tools/exit/exittool.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/exit/exittool.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/imgur/imguruploader.cpp flameshot-0.6.0+git20190714/src/tools/imgur/imguruploader.cpp --- flameshot-0.6.0/src/tools/imgur/imguruploader.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/imgur/imguruploader.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -72,10 +72,10 @@ if (reply->error() == QNetworkReply::NoError) { QJsonDocument response = QJsonDocument::fromJson(reply->readAll()); QJsonObject json = response.object(); - QJsonObject data = json["data"].toObject(); - m_imageURL.setUrl(data["link"].toString()); - m_deleteImageURL.setUrl(QString("https://imgur.com/delete/%1").arg( - data["deletehash"].toString())); + QJsonObject data = json[QStringLiteral("data")].toObject(); + m_imageURL.setUrl(data[QStringLiteral("link")].toString()); + m_deleteImageURL.setUrl(QStringLiteral("https://imgur.com/delete/%1").arg( + data[QStringLiteral("deletehash")].toString())); onUploadOk(); } else { m_infoLabel->setText(reply->errorString()); @@ -101,16 +101,16 @@ m_pixmap.save(&buffer, "PNG"); QUrlQuery urlQuery; - urlQuery.addQueryItem("title", "flameshot_screenshot"); + urlQuery.addQueryItem(QStringLiteral("title"), QStringLiteral("flameshot_screenshot")); QString description = FileNameHandler().parsedPattern(); - urlQuery.addQueryItem("description", description); + urlQuery.addQueryItem(QStringLiteral("description"), description); - QUrl url("https://api.imgur.com/3/image"); + QUrl url(QStringLiteral("https://api.imgur.com/3/image")); url.setQuery(urlQuery); QNetworkRequest request(url); request.setHeader(QNetworkRequest::ContentTypeHeader, "application/application/x-www-form-urlencoded"); - request.setRawHeader("Authorization", QString("Client-ID %1").arg(IMGUR_CLIENT_ID).toUtf8()); + request.setRawHeader("Authorization", QStringLiteral("Client-ID %1").arg(IMGUR_CLIENT_ID).toUtf8()); m_NetworkAM->post(request, byteArray); } diff -Nru flameshot-0.6.0/src/tools/imgur/imguruploader.h flameshot-0.6.0+git20190714/src/tools/imgur/imguruploader.h --- flameshot-0.6.0/src/tools/imgur/imguruploader.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/imgur/imguruploader.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/imgur/imguruploadertool.cpp flameshot-0.6.0+git20190714/src/tools/imgur/imguruploadertool.cpp --- flameshot-0.6.0/src/tools/imgur/imguruploadertool.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/imgur/imguruploadertool.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -36,11 +36,11 @@ } QString ImgurUploaderTool::nameID() { - return ""; + return QLatin1String(""); } QString ImgurUploaderTool::description() const { - return tr("Uploads the selection to Imgur"); + return tr("Upload the selection to Imgur"); } QWidget* ImgurUploaderTool::widget() { diff -Nru flameshot-0.6.0/src/tools/imgur/imguruploadertool.h flameshot-0.6.0+git20190714/src/tools/imgur/imguruploadertool.h --- flameshot-0.6.0/src/tools/imgur/imguruploadertool.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/imgur/imguruploadertool.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/launcher/applaunchertool.cpp flameshot-0.6.0+git20190714/src/tools/launcher/applaunchertool.cpp --- flameshot-0.6.0/src/tools/launcher/applaunchertool.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/launcher/applaunchertool.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -35,7 +35,7 @@ } QString AppLauncher::nameID() { - return ""; + return QLatin1String(""); } QString AppLauncher::description() const { diff -Nru flameshot-0.6.0/src/tools/launcher/applaunchertool.h flameshot-0.6.0+git20190714/src/tools/launcher/applaunchertool.h --- flameshot-0.6.0/src/tools/launcher/applaunchertool.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/launcher/applaunchertool.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/launcher/applauncherwidget.cpp flameshot-0.6.0+git20190714/src/tools/launcher/applauncherwidget.cpp --- flameshot-0.6.0/src/tools/launcher/applauncherwidget.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/launcher/applauncherwidget.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -61,7 +61,7 @@ QDir appsDirLocal(dirLocal); m_parser.processDirectory(appsDirLocal); - QString dir = "/usr/share/applications/"; + QString dir = QStringLiteral("/usr/share/applications/"); QDir appsDir(dir); m_parser.processDirectory(appsDir); @@ -173,9 +173,9 @@ const QVector &appList = m_appsMap[cat]; addAppsToListWidget(itemsWidget, appList); - m_tabWidget->addTab(itemsWidget, QIcon::fromTheme(iconName), ""); + m_tabWidget->addTab(itemsWidget, QIcon::fromTheme(iconName), QLatin1String("")); m_tabWidget->setTabToolTip(m_tabWidget->count(), cat); - if (cat == "Graphics") { + if (cat == QLatin1String("Graphics")) { m_tabWidget->setCurrentIndex(m_tabWidget->count() -1); } } @@ -199,7 +199,7 @@ // Unify multimedia. QVector multimediaList; QStringList multimediaNames; - multimediaNames << "AudioVideo" << "Audio" << "Video"; + multimediaNames << QStringLiteral("AudioVideo") << QStringLiteral("Audio") << QStringLiteral("Video"); for (const QString &name : multimediaNames) { if(!m_appsMap.contains(name)) { continue; @@ -211,7 +211,7 @@ } m_appsMap.remove(name); } - m_appsMap.insert("Multimedia", multimediaList); + m_appsMap.insert(QStringLiteral("Multimedia"), multimediaList); } void AppLauncherWidget::configureListView(QListWidget *widget) { diff -Nru flameshot-0.6.0/src/tools/launcher/applauncherwidget.h flameshot-0.6.0+git20190714/src/tools/launcher/applauncherwidget.h --- flameshot-0.6.0/src/tools/launcher/applauncherwidget.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/launcher/applauncherwidget.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/launcher/launcheritemdelegate.cpp flameshot-0.6.0+git20190714/src/tools/launcher/launcheritemdelegate.cpp --- flameshot-0.6.0/src/tools/launcher/launcheritemdelegate.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/launcher/launcheritemdelegate.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/launcher/launcheritemdelegate.h flameshot-0.6.0+git20190714/src/tools/launcher/launcheritemdelegate.h --- flameshot-0.6.0/src/tools/launcher/launcheritemdelegate.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/launcher/launcheritemdelegate.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/launcher/openwithprogram.cpp flameshot-0.6.0+git20190714/src/tools/launcher/openwithprogram.cpp --- flameshot-0.6.0/src/tools/launcher/openwithprogram.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/launcher/openwithprogram.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/launcher/openwithprogram.h flameshot-0.6.0+git20190714/src/tools/launcher/openwithprogram.h --- flameshot-0.6.0/src/tools/launcher/openwithprogram.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/launcher/openwithprogram.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/launcher/terminallauncher.cpp flameshot-0.6.0+git20190714/src/tools/launcher/terminallauncher.cpp --- flameshot-0.6.0/src/tools/launcher/terminallauncher.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/launcher/terminallauncher.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/launcher/terminallauncher.h flameshot-0.6.0+git20190714/src/tools/launcher/terminallauncher.h --- flameshot-0.6.0/src/tools/launcher/terminallauncher.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/launcher/terminallauncher.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/line/linetool.cpp flameshot-0.6.0+git20190714/src/tools/line/linetool.cpp --- flameshot-0.6.0/src/tools/line/linetool.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/line/linetool.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -20,18 +20,13 @@ namespace { -#define ADJ_VALUE 13 #define PADDING_VALUE 2 -// Have to force horizontal position -bool needsAdjustment(const QPoint &p0, const QPoint &p1) { - return (p1.y() >= p0.y() - ADJ_VALUE) && (p1.y() <= p0.y() + ADJ_VALUE); -} - } LineTool::LineTool(QObject *parent) : AbstractTwoPointTool(parent) { - + m_supportsOrthogonalAdj = true; + m_supportsDiagonalAdj = true; } QIcon LineTool::icon(const QColor &background, bool inEditor) const { @@ -43,11 +38,11 @@ } QString LineTool::nameID() { - return ""; + return QLatin1String(""); } QString LineTool::description() const { - return tr("Sets the Line as the paint tool"); + return tr("Set the Line as the paint tool"); } CaptureTool* LineTool::copy(QObject *parent) { @@ -67,13 +62,6 @@ painter.drawLine(context.mousePos, context.mousePos); } -void LineTool::drawMove(const QPoint &p) { - m_points.second = p; - if (needsAdjustment(m_points.first, m_points.second)) { - m_points.second.setY(m_points.first.y()); - } -} - void LineTool::drawStart(const CaptureContext &context) { m_color = context.color; m_thickness = context.thickness + PADDING_VALUE; diff -Nru flameshot-0.6.0/src/tools/line/linetool.h flameshot-0.6.0+git20190714/src/tools/line/linetool.h --- flameshot-0.6.0/src/tools/line/linetool.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/line/linetool.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -35,7 +35,6 @@ void paintMousePreview(QPainter &painter, const CaptureContext &context) override; public slots: - void drawMove(const QPoint &p) override; void drawStart(const CaptureContext &context) override; void pressed(const CaptureContext &context) override; }; diff -Nru flameshot-0.6.0/src/tools/marker/markertool.cpp flameshot-0.6.0+git20190714/src/tools/marker/markertool.cpp --- flameshot-0.6.0/src/tools/marker/markertool.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/marker/markertool.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -20,18 +20,13 @@ namespace { -#define ADJ_VALUE 14 #define PADDING_VALUE 14 -// Have to force horizontal position -bool needsAdjustment(const QPoint &p0, const QPoint &p1) { - return (p1.y() >= p0.y() - ADJ_VALUE) && (p1.y() <= p0.y() + ADJ_VALUE); -} - } MarkerTool::MarkerTool(QObject *parent) : AbstractTwoPointTool(parent) { - + m_supportsOrthogonalAdj = true; + m_supportsDiagonalAdj = true; } QIcon MarkerTool::icon(const QColor &background, bool inEditor) const { @@ -43,11 +38,11 @@ } QString MarkerTool::nameID() { - return ""; + return QLatin1String(""); } QString MarkerTool::description() const { - return tr("Sets the Marker as the paint tool"); + return tr("Set the Marker as the paint tool"); } CaptureTool* MarkerTool::copy(QObject *parent) { @@ -58,24 +53,19 @@ if (recordUndo) { updateBackup(pixmap); } + painter.setCompositionMode(QPainter::CompositionMode_Multiply); painter.setOpacity(0.35); painter.setPen(QPen(m_color, m_thickness)); painter.drawLine(m_points.first, m_points.second); } void MarkerTool::paintMousePreview(QPainter &painter, const CaptureContext &context) { + painter.setCompositionMode(QPainter::CompositionMode_Multiply); painter.setOpacity(0.35); painter.setPen(QPen(context.color, PADDING_VALUE + context.thickness)); painter.drawLine(context.mousePos, context.mousePos); } -void MarkerTool::drawMove(const QPoint &p) { - m_points.second = p; - if (needsAdjustment(m_points.first, m_points.second)) { - m_points.second.setY(m_points.first.y()); - } -} - void MarkerTool::drawStart(const CaptureContext &context) { m_color = context.color; m_thickness = context.thickness + PADDING_VALUE; diff -Nru flameshot-0.6.0/src/tools/marker/markertool.h flameshot-0.6.0+git20190714/src/tools/marker/markertool.h --- flameshot-0.6.0/src/tools/marker/markertool.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/marker/markertool.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -35,7 +35,6 @@ void paintMousePreview(QPainter &painter, const CaptureContext &context) override; public slots: - void drawMove(const QPoint &p) override; void drawStart(const CaptureContext &context) override; void pressed(const CaptureContext &context) override; void thicknessChanged(const int th) override; diff -Nru flameshot-0.6.0/src/tools/move/movetool.cpp flameshot-0.6.0+git20190714/src/tools/move/movetool.cpp --- flameshot-0.6.0/src/tools/move/movetool.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/move/movetool.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -35,7 +35,7 @@ } QString MoveTool::nameID() { - return ""; + return QLatin1String(""); } QString MoveTool::description() const { diff -Nru flameshot-0.6.0/src/tools/move/movetool.h flameshot-0.6.0+git20190714/src/tools/move/movetool.h --- flameshot-0.6.0/src/tools/move/movetool.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/move/movetool.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/pencil/penciltool.cpp flameshot-0.6.0+git20190714/src/tools/pencil/penciltool.cpp --- flameshot-0.6.0/src/tools/pencil/penciltool.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/pencil/penciltool.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -31,11 +31,11 @@ } QString PencilTool::nameID() { - return ""; + return QLatin1String(""); } QString PencilTool::description() const { - return tr("Sets the Pencil as the paint tool"); + return tr("Set the Pencil as the paint tool"); } CaptureTool* PencilTool::copy(QObject *parent) { diff -Nru flameshot-0.6.0/src/tools/pencil/penciltool.h flameshot-0.6.0+git20190714/src/tools/pencil/penciltool.h --- flameshot-0.6.0/src/tools/pencil/penciltool.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/pencil/penciltool.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/pin/pintool.cpp flameshot-0.6.0+git20190714/src/tools/pin/pintool.cpp --- flameshot-0.6.0/src/tools/pin/pintool.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/pin/pintool.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -35,7 +35,7 @@ } QString PinTool::nameID() { - return ""; + return QLatin1String(""); } QString PinTool::description() const { @@ -45,11 +45,7 @@ QWidget* PinTool::widget() { PinWidget *w = new PinWidget(m_pixmap); const int &&m = w->margin(); -#if defined(Q_OS_LINUX) || defined(Q_OS_UNIX) - QRect adjusted_pos = m_geometry + QMargins(m,-m,-m,-m); -#else QRect adjusted_pos = m_geometry + QMargins(m, m, m, m); -#endif w->setGeometry(adjusted_pos); return w; } diff -Nru flameshot-0.6.0/src/tools/pin/pintool.h flameshot-0.6.0+git20190714/src/tools/pin/pintool.h --- flameshot-0.6.0/src/tools/pin/pintool.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/pin/pintool.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/pin/pinwidget.cpp flameshot-0.6.0+git20190714/src/tools/pin/pinwidget.cpp --- flameshot-0.6.0/src/tools/pin/pinwidget.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/pin/pinwidget.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -58,7 +58,7 @@ } void PinWidget::wheelEvent(QWheelEvent *e) { - int val = e->delta() > 0 ? 5 : -5; + int val = e->delta() > 0 ? 15 : -15; int newWidth = qBound(50, m_label->width() + val, maximumWidth()); int newHeight = qBound(50, m_label->height() + val, maximumHeight()); diff -Nru flameshot-0.6.0/src/tools/pin/pinwidget.h flameshot-0.6.0+git20190714/src/tools/pin/pinwidget.h --- flameshot-0.6.0/src/tools/pin/pinwidget.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/pin/pinwidget.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/rectangle/rectangletool.cpp flameshot-0.6.0+git20190714/src/tools/rectangle/rectangletool.cpp --- flameshot-0.6.0/src/tools/rectangle/rectangletool.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/rectangle/rectangletool.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -23,7 +23,7 @@ } RectangleTool::RectangleTool(QObject *parent) : AbstractTwoPointTool(parent) { - + m_supportsDiagonalAdj = true; } QIcon RectangleTool::icon(const QColor &background, bool inEditor) const { @@ -35,11 +35,11 @@ } QString RectangleTool::nameID() { - return ""; + return QLatin1String(""); } QString RectangleTool::description() const { - return tr("Sets the Rectangle as the paint tool"); + return tr("Set the Rectangle as the paint tool"); } CaptureTool* RectangleTool::copy(QObject *parent) { diff -Nru flameshot-0.6.0/src/tools/rectangle/rectangletool.h flameshot-0.6.0+git20190714/src/tools/rectangle/rectangletool.h --- flameshot-0.6.0/src/tools/rectangle/rectangletool.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/rectangle/rectangletool.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/redo/redotool.cpp flameshot-0.6.0+git20190714/src/tools/redo/redotool.cpp --- flameshot-0.6.0/src/tools/redo/redotool.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/redo/redotool.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -35,7 +35,7 @@ } QString RedoTool::nameID() { - return ""; + return QLatin1String(""); } QString RedoTool::description() const { diff -Nru flameshot-0.6.0/src/tools/redo/redotool.h flameshot-0.6.0+git20190714/src/tools/redo/redotool.h --- flameshot-0.6.0/src/tools/redo/redotool.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/redo/redotool.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/save/savetool.cpp flameshot-0.6.0+git20190714/src/tools/save/savetool.cpp --- flameshot-0.6.0/src/tools/save/savetool.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/save/savetool.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -36,7 +36,7 @@ } QString SaveTool::nameID() { - return ""; + return QLatin1String(""); } QString SaveTool::description() const { diff -Nru flameshot-0.6.0/src/tools/save/savetool.h flameshot-0.6.0+git20190714/src/tools/save/savetool.h --- flameshot-0.6.0/src/tools/save/savetool.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/save/savetool.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/selection/selectiontool.cpp flameshot-0.6.0+git20190714/src/tools/selection/selectiontool.cpp --- flameshot-0.6.0/src/tools/selection/selectiontool.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/selection/selectiontool.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -23,7 +23,7 @@ } SelectionTool::SelectionTool(QObject *parent) : AbstractTwoPointTool(parent) { - + m_supportsDiagonalAdj = true; } bool SelectionTool::closeOnButtonPressed() const { @@ -39,11 +39,11 @@ } QString SelectionTool::nameID() { - return ""; + return QLatin1String(""); } QString SelectionTool::description() const { - return tr("Sets the Selection as the paint tool"); + return tr("Set Selection as the paint tool"); } CaptureTool* SelectionTool::copy(QObject *parent) { diff -Nru flameshot-0.6.0/src/tools/selection/selectiontool.h flameshot-0.6.0+git20190714/src/tools/selection/selectiontool.h --- flameshot-0.6.0/src/tools/selection/selectiontool.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/selection/selectiontool.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/sizeindicator/sizeindicatortool.cpp flameshot-0.6.0+git20190714/src/tools/sizeindicator/sizeindicatortool.cpp --- flameshot-0.6.0/src/tools/sizeindicator/sizeindicatortool.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/sizeindicator/sizeindicatortool.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -35,11 +35,11 @@ } QString SizeIndicatorTool::nameID() { - return ""; + return QLatin1String(""); } QString SizeIndicatorTool::description() const { - return tr("Shows the dimensions of the selection (X Y)"); + return tr("Show the dimensions of the selection (X Y)"); } CaptureTool* SizeIndicatorTool::copy(QObject *parent) { diff -Nru flameshot-0.6.0/src/tools/sizeindicator/sizeindicatortool.h flameshot-0.6.0+git20190714/src/tools/sizeindicator/sizeindicatortool.h --- flameshot-0.6.0/src/tools/sizeindicator/sizeindicatortool.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/sizeindicator/sizeindicatortool.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/text/textconfig.cpp flameshot-0.6.0+git20190714/src/tools/text/textconfig.cpp --- flameshot-0.6.0/src/tools/text/textconfig.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/text/textconfig.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -42,28 +42,28 @@ PathInfo::blackIconPath(); m_strikeOutButton = new QPushButton( - QIcon(iconPrefix + "format_strikethrough.svg"), ""); + QIcon(iconPrefix + "format_strikethrough.svg"), QLatin1String("")); m_strikeOutButton->setCheckable(true); connect(m_strikeOutButton, &QPushButton::clicked, this, &TextConfig::fontStrikeOutChanged); m_strikeOutButton->setToolTip(tr("StrikeOut")); m_underlineButton = new QPushButton( - QIcon(iconPrefix + "format_underlined.svg"), ""); + QIcon(iconPrefix + "format_underlined.svg"), QLatin1String("")); m_underlineButton->setCheckable(true); connect(m_underlineButton, &QPushButton::clicked, this, &TextConfig::fontUnderlineChanged); m_underlineButton->setToolTip(tr("Underline")); m_weightButton = new QPushButton( - QIcon(iconPrefix + "format_bold.svg"), ""); + QIcon(iconPrefix + "format_bold.svg"), QLatin1String("")); m_weightButton->setCheckable(true); connect(m_weightButton, &QPushButton::clicked, this, &TextConfig::weightButtonPressed); m_weightButton->setToolTip(tr("Bold")); m_italicButton = new QPushButton( - QIcon(iconPrefix + "format_italic.svg"), ""); + QIcon(iconPrefix + "format_italic.svg"), QLatin1String("")); m_italicButton->setCheckable(true); connect(m_italicButton, &QPushButton::clicked, this, &TextConfig::fontItalicChanged); diff -Nru flameshot-0.6.0/src/tools/text/textconfig.h flameshot-0.6.0+git20190714/src/tools/text/textconfig.h --- flameshot-0.6.0/src/tools/text/textconfig.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/text/textconfig.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/text/texttool.cpp flameshot-0.6.0+git20190714/src/tools/text/texttool.cpp --- flameshot-0.6.0/src/tools/text/texttool.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/text/texttool.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -51,7 +51,7 @@ } QString TextTool::nameID() { - return ""; + return QLatin1String(""); } QString TextTool::description() const { diff -Nru flameshot-0.6.0/src/tools/text/texttool.h flameshot-0.6.0+git20190714/src/tools/text/texttool.h --- flameshot-0.6.0/src/tools/text/texttool.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/text/texttool.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/text/textwidget.cpp flameshot-0.6.0+git20190714/src/tools/text/textwidget.cpp --- flameshot-0.6.0/src/tools/text/textwidget.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/text/textwidget.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -18,7 +18,7 @@ #include "textwidget.h" TextWidget::TextWidget(QWidget *parent) : QTextEdit(parent) { - setStyleSheet("TextWidget { background: transparent; }"); + setStyleSheet(QStringLiteral("TextWidget { background: transparent; }")); connect(this, &TextWidget::textChanged, this, &TextWidget::adjustSize); connect(this, &TextWidget::textChanged, @@ -61,7 +61,7 @@ } void TextWidget::setTextColor(const QColor &c) { - QString s("TextWidget { background: transparent; color: %1; }"); + QString s(QStringLiteral("TextWidget { background: transparent; color: %1; }")); setStyleSheet(s.arg(c.name())); } diff -Nru flameshot-0.6.0/src/tools/text/textwidget.h flameshot-0.6.0+git20190714/src/tools/text/textwidget.h --- flameshot-0.6.0/src/tools/text/textwidget.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/text/textwidget.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/toolfactory.cpp flameshot-0.6.0+git20190714/src/tools/toolfactory.cpp --- flameshot-0.6.0/src/tools/toolfactory.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/toolfactory.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/toolfactory.h flameshot-0.6.0+git20190714/src/tools/toolfactory.h --- flameshot-0.6.0/src/tools/toolfactory.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/toolfactory.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/tools/undo/undotool.cpp flameshot-0.6.0+git20190714/src/tools/undo/undotool.cpp --- flameshot-0.6.0/src/tools/undo/undotool.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/undo/undotool.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -35,7 +35,7 @@ } QString UndoTool::nameID() { - return ""; + return QLatin1String(""); } QString UndoTool::description() const { diff -Nru flameshot-0.6.0/src/tools/undo/undotool.h flameshot-0.6.0+git20190714/src/tools/undo/undotool.h --- flameshot-0.6.0/src/tools/undo/undotool.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/tools/undo/undotool.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/utils/colorutils.cpp flameshot-0.6.0+git20190714/src/utils/colorutils.cpp --- flameshot-0.6.0/src/utils/colorutils.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/utils/colorutils.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/utils/colorutils.h flameshot-0.6.0+git20190714/src/utils/colorutils.h --- flameshot-0.6.0/src/utils/colorutils.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/utils/colorutils.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/utils/confighandler.cpp flameshot-0.6.0+git20190714/src/utils/confighandler.cpp --- flameshot-0.6.0/src/utils/confighandler.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/utils/confighandler.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -27,13 +27,13 @@ QVector ConfigHandler::getButtons() { QVector buttons; - if (m_settings.contains("buttons")) { + if (m_settings.contains(QStringLiteral("buttons"))) { // TODO: remove toList in v1.0 QVector buttonsInt = - m_settings.value("buttons").value >().toVector(); + m_settings.value(QStringLiteral("buttons")).value >().toVector(); bool modified = normalizeButtons(buttonsInt); if (modified) { - m_settings.setValue("buttons", QVariant::fromValue(buttonsInt.toList())); + m_settings.setValue(QStringLiteral("buttons"), QVariant::fromValue(buttonsInt.toList())); } buttons = fromIntToButton(buttonsInt); } else { @@ -54,7 +54,9 @@ << CaptureButton::TYPE_SAVE << CaptureButton::TYPE_EXIT << CaptureButton::TYPE_IMAGEUPLOADER - << CaptureButton::TYPE_OPEN_APP; + << CaptureButton::TYPE_OPEN_APP + << CaptureButton::TYPE_PIN + << CaptureButton::TYPE_TEXT; } using bt = CaptureButton::ButtonType; @@ -69,7 +71,7 @@ QVector l = fromButtonToInt(buttons); normalizeButtons(l); // TODO: remove toList in v1.0 - m_settings.setValue("buttons", QVariant::fromValue(l.toList())); + m_settings.setValue(QStringLiteral("buttons"), QVariant::fromValue(l.toList())); } QVector ConfigHandler::getUserColors() { @@ -86,8 +88,8 @@ Qt::darkMagenta }; - if (m_settings.contains("userColors")) { - for (const QString &hex : m_settings.value("userColors").toStringList()) { + if (m_settings.contains(QStringLiteral("userColors"))) { + for (const QString &hex : m_settings.value(QStringLiteral("userColors")).toStringList()) { if (QColor::isValidColor(hex)) { colors.append(QColor(hex)); } @@ -110,22 +112,22 @@ hexColors.append(color.name()); } - m_settings.setValue("userColors", QVariant::fromValue(hexColors)); + m_settings.setValue(QStringLiteral("userColors"), QVariant::fromValue(hexColors)); } QString ConfigHandler::savePathValue() { - return m_settings.value("savePath").toString(); + return m_settings.value(QStringLiteral("savePath")).toString(); } void ConfigHandler::setSavePath(const QString &savePath) { - m_settings.setValue("savePath", savePath); + m_settings.setValue(QStringLiteral("savePath"), savePath); } QColor ConfigHandler::uiMainColorValue() { QColor res = QColor(116, 0, 150); - if (m_settings.contains("uiColor")) { - QString hex = m_settings.value("uiColor").toString(); + if (m_settings.contains(QStringLiteral("uiColor"))) { + QString hex = m_settings.value(QStringLiteral("uiColor")).toString(); if (QColor::isValidColor(hex)) { res = QColor(hex); @@ -135,14 +137,14 @@ } void ConfigHandler::setUIMainColor(const QColor &c) { - m_settings.setValue("uiColor", c.name()); + m_settings.setValue(QStringLiteral("uiColor"), c.name()); } QColor ConfigHandler::uiContrastColorValue() { QColor res = QColor(86, 0, 120); - if (m_settings.contains("contastUiColor")) { - QString hex = m_settings.value("contastUiColor").toString(); + if (m_settings.contains(QStringLiteral("contastUiColor"))) { + QString hex = m_settings.value(QStringLiteral("contastUiColor")).toString(); if (QColor::isValidColor(hex)) { res = QColor(hex); @@ -153,14 +155,14 @@ } void ConfigHandler::setUIContrastColor(const QColor &c) { - m_settings.setValue("contastUiColor", c.name()); + m_settings.setValue(QStringLiteral("contastUiColor"), c.name()); } QColor ConfigHandler::drawColorValue() { QColor res(Qt::red); - if (m_settings.contains("drawColor")) { - QString hex = m_settings.value("drawColor").toString(); + if (m_settings.contains(QStringLiteral("drawColor"))) { + QString hex = m_settings.value(QStringLiteral("drawColor")).toString(); if (QColor::isValidColor(hex)) { res = QColor(hex); @@ -171,75 +173,90 @@ } void ConfigHandler::setDrawColor(const QColor &c) { - m_settings.setValue("drawColor", c.name()); + m_settings.setValue(QStringLiteral("drawColor"), c.name()); } bool ConfigHandler::showHelpValue() { bool res = true; - if (m_settings.contains("showHelp")) { - res = m_settings.value("showHelp").toBool(); + if (m_settings.contains(QStringLiteral("showHelp"))) { + res = m_settings.value(QStringLiteral("showHelp")).toBool(); } return res; } void ConfigHandler::setShowHelp(const bool showHelp) { - m_settings.setValue("showHelp", showHelp); + m_settings.setValue(QStringLiteral("showHelp"), showHelp); } bool ConfigHandler::desktopNotificationValue() { bool res = true; - if (m_settings.contains("showDesktopNotification")) { - res = m_settings.value("showDesktopNotification").toBool(); + if (m_settings.contains(QStringLiteral("showDesktopNotification"))) { + res = m_settings.value(QStringLiteral("showDesktopNotification")).toBool(); } return res; } void ConfigHandler::setDesktopNotification(const bool showDesktopNotification) { - m_settings.setValue("showDesktopNotification", showDesktopNotification); + m_settings.setValue(QStringLiteral("showDesktopNotification"), showDesktopNotification); } QString ConfigHandler::filenamePatternValue() { - return m_settings.value("filenamePattern").toString(); + return m_settings.value(QStringLiteral("filenamePattern")).toString(); } void ConfigHandler::setFilenamePattern(const QString &pattern) { - return m_settings.setValue("filenamePattern", pattern); + return m_settings.setValue(QStringLiteral("filenamePattern"), pattern); } bool ConfigHandler::disabledTrayIconValue() { bool res = false; - if (m_settings.contains("disabledTrayIcon")) { - res = m_settings.value("disabledTrayIcon").toBool(); + if (m_settings.contains(QStringLiteral("disabledTrayIcon"))) { + res = m_settings.value(QStringLiteral("disabledTrayIcon")).toBool(); } return res; } void ConfigHandler::setDisabledTrayIcon(const bool disabledTrayIcon) { - m_settings.setValue("disabledTrayIcon", disabledTrayIcon); + m_settings.setValue(QStringLiteral("disabledTrayIcon"), disabledTrayIcon); } int ConfigHandler::drawThicknessValue() { int res = 0; - if (m_settings.contains("drawThickness")) { - res = m_settings.value("drawThickness").toInt(); + if (m_settings.contains(QStringLiteral("drawThickness"))) { + res = m_settings.value(QStringLiteral("drawThickness")).toInt(); } return res; } void ConfigHandler::setdrawThickness(const int thickness) { - m_settings.setValue("drawThickness", thickness); + m_settings.setValue(QStringLiteral("drawThickness"), thickness); } bool ConfigHandler::keepOpenAppLauncherValue() { - return m_settings.value("keepOpenAppLauncher").toBool(); + return m_settings.value(QStringLiteral("keepOpenAppLauncher")).toBool(); } void ConfigHandler::setKeepOpenAppLauncher(const bool keepOpen) { - m_settings.setValue("keepOpenAppLauncher", keepOpen); + m_settings.setValue(QStringLiteral("keepOpenAppLauncher"), keepOpen); } bool ConfigHandler::startupLaunchValue() { bool res = false; + + if (m_settings.contains(QStringLiteral("startupLaunch"))) { + res = m_settings.value(QStringLiteral("startupLaunch")).toBool(); + } + + if (res != verifyLaunchFile()) { + setStartupLaunch(res); + } + + return res; +} + +bool ConfigHandler::verifyLaunchFile() { + bool res = false; + #if defined(Q_OS_LINUX) || defined(Q_OS_UNIX) QString path = QDir::homePath() + "/.config/autostart/Flameshot.desktop"; res = QFile(path).exists(); @@ -255,8 +272,13 @@ void ConfigHandler::setStartupLaunch(const bool start) { #if defined(Q_OS_LINUX) || defined(Q_OS_UNIX) - QString path = QDir::homePath() + "/.config/autostart/Flameshot.desktop"; - QFile file(path); + QString path = QDir::homePath() + "/.config/autostart/"; + QDir autostartDir(path); + if (!autostartDir.exists()) { + autostartDir.mkpath("."); + } + + QFile file(path + "Flameshot.desktop"); if (start) { if (file.open(QIODevice::WriteOnly)) { QByteArray data("[Desktop Entry]\nName=flameshot\nIcon=flameshot" @@ -279,19 +301,28 @@ bootUpSettings.remove("Flameshot"); } #endif + m_settings.setValue(QStringLiteral("startupLaunch"), start); } int ConfigHandler::contrastOpacityValue() { int opacity = 190; - if (m_settings.contains("contrastOpacity")) { - opacity = m_settings.value("contrastOpacity").toInt(); + if (m_settings.contains(QStringLiteral("contrastOpacity"))) { + opacity = m_settings.value(QStringLiteral("contrastOpacity")).toInt(); opacity = qBound(0, opacity, 255); } return opacity; } void ConfigHandler::setContrastOpacity(const int transparency) { - m_settings.setValue("contrastOpacity", transparency); + m_settings.setValue(QStringLiteral("contrastOpacity"), transparency); +} + +bool ConfigHandler::closeAfterScreenshotValue() { + return m_settings.value(QStringLiteral("closeAfterScreenshot")).toBool(); +} + +void ConfigHandler::setCloseAfterScreenshot(const bool close) { + m_settings.setValue(QStringLiteral("closeAfterScreenshot"), close); } void ConfigHandler::setDefaults() { @@ -305,7 +336,7 @@ buttons << static_cast(t); } // TODO: remove toList in v1.0 - m_settings.setValue("buttons", QVariant::fromValue(buttons.toList())); + m_settings.setValue(QStringLiteral("buttons"), QVariant::fromValue(buttons.toList())); } QString ConfigHandler::configFilePath() const { diff -Nru flameshot-0.6.0/src/utils/confighandler.h flameshot-0.6.0+git20190714/src/utils/confighandler.h --- flameshot-0.6.0/src/utils/confighandler.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/utils/confighandler.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -61,12 +61,17 @@ bool keepOpenAppLauncherValue(); void setKeepOpenAppLauncher(const bool); + bool verifyLaunchFile(); bool startupLaunchValue(); void setStartupLaunch(const bool); int contrastOpacityValue(); void setContrastOpacity(const int); + bool closeAfterScreenshotValue(); + void setCloseAfterScreenshot(const bool); + + void setDefaults(); void setAllTheButtons(); diff -Nru flameshot-0.6.0/src/utils/dbusutils.cpp flameshot-0.6.0+git20190714/src/utils/dbusutils.cpp --- flameshot-0.6.0/src/utils/dbusutils.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/utils/dbusutils.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -27,13 +27,13 @@ void DBusUtils::connectPrintCapture(QDBusConnection &session, uint id) { m_id = id; // captureTaken - session.connect("org.dharkael.Flameshot", - "/", "", "captureTaken", + session.connect(QStringLiteral("org.dharkael.Flameshot"), + QStringLiteral("/"), QLatin1String(""), QStringLiteral("captureTaken"), this, SLOT(captureTaken(uint, QByteArray))); // captureFailed - session.connect("org.dharkael.Flameshot", - "/", "", "captureFailed", + session.connect(QStringLiteral("org.dharkael.Flameshot"), + QStringLiteral("/"), QLatin1String(""), QStringLiteral("captureFailed"), this, SLOT(captureFailed(uint))); } @@ -41,7 +41,7 @@ void DBusUtils::checkDBusConnection(const QDBusConnection &connection) { if (!connection.isConnected()) { SystemNotification().sendMessage(tr("Unable to connect via DBus")); - qApp->exit(); + qApp->exit(1); } } @@ -58,6 +58,6 @@ void DBusUtils::captureFailed(uint id) { if (m_id == id) { QTextStream(stdout) << "screenshot aborted\n"; - qApp->exit(); + qApp->exit(1); } } diff -Nru flameshot-0.6.0/src/utils/dbusutils.h flameshot-0.6.0+git20190714/src/utils/dbusutils.h --- flameshot-0.6.0/src/utils/dbusutils.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/utils/dbusutils.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/utils/desktopfileparse.cpp flameshot-0.6.0+git20190714/src/utils/desktopfileparse.cpp --- flameshot-0.6.0/src/utils/desktopfileparse.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/utils/desktopfileparse.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -30,7 +30,7 @@ m_localeNameShort = QStringLiteral("Name[%1]").arg(localeShort); m_localeDescriptionShort = QStringLiteral("Comment[%1]") .arg(localeShort); - m_defaultIcon = QIcon::fromTheme("application-x-executable"); + m_defaultIcon = QIcon::fromTheme(QStringLiteral("application-x-executable")); } DesktopAppData DesktopFileParser::parseDesktopFile( @@ -48,62 +48,62 @@ bool isApplication = false; QTextStream in(&file); // enter the desktop entry definition - while (!in.atEnd() && in.readLine() != "[Desktop Entry]") { + while (!in.atEnd() && in.readLine() != QLatin1String("[Desktop Entry]")) { } // start parsing while (!in.atEnd()) { QString line = in.readLine(); - if (line.startsWith("Icon")) { + if (line.startsWith(QLatin1String("Icon"))) { res.icon = QIcon::fromTheme( - line.mid(line.indexOf("=")+1).trimmed(), + line.mid(line.indexOf(QLatin1String("="))+1).trimmed(), m_defaultIcon); } - else if (!nameLocaleSet && line.startsWith("Name")) { + else if (!nameLocaleSet && line.startsWith(QLatin1String("Name"))) { if (line.startsWith(m_localeName) || line.startsWith(m_localeNameShort)) { - res.name = line.mid(line.indexOf("=")+1).trimmed(); + res.name = line.mid(line.indexOf(QLatin1String("="))+1).trimmed(); nameLocaleSet = true; - } else if (line.startsWith("Name=")) { - res.name = line.mid(line.indexOf("=")+1).trimmed(); + } else if (line.startsWith(QLatin1String("Name="))) { + res.name = line.mid(line.indexOf(QLatin1String("="))+1).trimmed(); } } - else if (!descriptionLocaleSet && line.startsWith("Comment")) { + else if (!descriptionLocaleSet && line.startsWith(QLatin1String("Comment"))) { if (line.startsWith(m_localeDescription) || line.startsWith(m_localeDescriptionShort)) { - res.description = line.mid(line.indexOf("=")+1).trimmed(); + res.description = line.mid(line.indexOf(QLatin1String("="))+1).trimmed(); descriptionLocaleSet = true; - } else if (line.startsWith("Comment=")) { - res.description = line.mid(line.indexOf("=")+1).trimmed(); + } else if (line.startsWith(QLatin1String("Comment="))) { + res.description = line.mid(line.indexOf(QLatin1String("="))+1).trimmed(); } } - else if (line.startsWith("Exec")) { - if (line.contains("%")) { - res.exec = line.mid(line.indexOf("=")+1) + else if (line.startsWith(QLatin1String("Exec"))) { + if (line.contains(QLatin1String("%"))) { + res.exec = line.mid(line.indexOf(QLatin1String("="))+1) .trimmed(); } else { ok = false; break; } } - else if (line.startsWith("Type")) { - if (line.contains("Application")) { + else if (line.startsWith(QLatin1String("Type"))) { + if (line.contains(QLatin1String("Application"))) { isApplication = true; } } - else if (line.startsWith("Categories")) { - res.categories = line.mid(line.indexOf("=")+1).split(";"); + else if (line.startsWith(QLatin1String("Categories"))) { + res.categories = line.mid(line.indexOf(QLatin1String("="))+1).split(QStringLiteral(";")); } - else if (line == "NoDisplay=true") { + else if (line == QLatin1String("NoDisplay=true")) { ok = false; break; } - else if (line == "Terminal=true") { + else if (line == QLatin1String("Terminal=true")) { res.showInTerminal = true; } // ignore the other entries - else if (line.startsWith("[")) { + else if (line.startsWith(QLatin1String("["))) { break; } } diff -Nru flameshot-0.6.0/src/utils/desktopfileparse.h flameshot-0.6.0+git20190714/src/utils/desktopfileparse.h --- flameshot-0.6.0/src/utils/desktopfileparse.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/utils/desktopfileparse.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/utils/desktopinfo.cpp flameshot-0.6.0+git20190714/src/utils/desktopinfo.cpp --- flameshot-0.6.0/src/utils/desktopinfo.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/utils/desktopinfo.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -20,26 +20,26 @@ DesktopInfo::DesktopInfo() { auto e = QProcessEnvironment::systemEnvironment(); - XDG_CURRENT_DESKTOP = e.value("XDG_CURRENT_DESKTOP"); - XDG_SESSION_TYPE = e.value("XDG_SESSION_TYPE"); - WAYLAND_DISPLAY = e.value("WAYLAND_DISPLAY"); - KDE_FULL_SESSION = e.value("KDE_FULL_SESSION"); - GNOME_DESKTOP_SESSION_ID = e.value("GNOME_DESKTOP_SESSION_ID"); - DESKTOP_SESSION = e.value("DESKTOP_SESSION"); + XDG_CURRENT_DESKTOP = e.value(QStringLiteral("XDG_CURRENT_DESKTOP")); + XDG_SESSION_TYPE = e.value(QStringLiteral("XDG_SESSION_TYPE")); + WAYLAND_DISPLAY = e.value(QStringLiteral("WAYLAND_DISPLAY")); + KDE_FULL_SESSION = e.value(QStringLiteral("KDE_FULL_SESSION")); + GNOME_DESKTOP_SESSION_ID = e.value(QStringLiteral("GNOME_DESKTOP_SESSION_ID")); + DESKTOP_SESSION = e.value(QStringLiteral("DESKTOP_SESSION")); } bool DesktopInfo::waylandDectected() { - return XDG_SESSION_TYPE == "wayland" || - WAYLAND_DISPLAY.contains("wayland", Qt::CaseInsensitive); + return XDG_SESSION_TYPE == QLatin1String("wayland") || + WAYLAND_DISPLAY.contains(QLatin1String("wayland"), Qt::CaseInsensitive); } DesktopInfo::WM DesktopInfo::windowManager() { DesktopInfo::WM res = DesktopInfo::OTHER; - if (XDG_CURRENT_DESKTOP.contains("GNOME", Qt::CaseInsensitive) || + if (XDG_CURRENT_DESKTOP.contains(QLatin1String("GNOME"), Qt::CaseInsensitive) || !GNOME_DESKTOP_SESSION_ID.isEmpty()) { res = DesktopInfo::GNOME; - } else if (!KDE_FULL_SESSION.isEmpty() || DESKTOP_SESSION == "kde-plasma") { + } else if (!KDE_FULL_SESSION.isEmpty() || DESKTOP_SESSION == QLatin1String("kde-plasma")) { res = DesktopInfo::KDE; } return res; diff -Nru flameshot-0.6.0/src/utils/desktopinfo.h flameshot-0.6.0+git20190714/src/utils/desktopinfo.h --- flameshot-0.6.0/src/utils/desktopinfo.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/utils/desktopinfo.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/utils/filenamehandler.cpp flameshot-0.6.0+git20190714/src/utils/filenamehandler.cpp --- flameshot-0.6.0/src/utils/filenamehandler.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/utils/filenamehandler.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -33,7 +33,7 @@ QString FileNameHandler::parseFilename(const QString &name) { QString res = name; if (name.isEmpty()) { - res = "%F_%H-%M"; + res = QLatin1String("%F_%H-%M"); } std::time_t t = std::time(NULL); @@ -45,7 +45,7 @@ free(tempData); // add the parsed pattern in a correct format for the filesystem - res = res.replace("/", "⁄").replace(":", "-"); + res = res.replace(QLatin1String("/"), QStringLiteral("⁄")).replace(QLatin1String(":"), QLatin1String("-")); return res; } @@ -87,14 +87,14 @@ void FileNameHandler::fixPath(QString &directory, QString &filename) { // add '/' at the end of the directory - if (!directory.endsWith("/")) { - directory += "/"; + if (!directory.endsWith(QLatin1String("/"))) { + directory += QLatin1String("/"); } // add numeration in case of repeated filename in the directory // find unused name adding _n where n is a number QFileInfo checkFile(directory + filename + ".png"); if (checkFile.exists()) { - filename += "_"; + filename += QLatin1String("_"); int i = 1; while (true) { checkFile.setFile( diff -Nru flameshot-0.6.0/src/utils/filenamehandler.h flameshot-0.6.0+git20190714/src/utils/filenamehandler.h --- flameshot-0.6.0/src/utils/filenamehandler.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/utils/filenamehandler.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/utils/globalvalues.cpp flameshot-0.6.0+git20190714/src/utils/globalvalues.cpp --- flameshot-0.6.0/src/utils/globalvalues.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/utils/globalvalues.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/utils/globalvalues.h flameshot-0.6.0+git20190714/src/utils/globalvalues.h --- flameshot-0.6.0/src/utils/globalvalues.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/utils/globalvalues.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -15,10 +15,7 @@ // You should have received a copy of the GNU General Public License // along with Flameshot. If not, see . -#define pragma once - -#include -#include "src/widgets/capture/capturebutton.h" +#pragma once namespace GlobalValues { diff -Nru flameshot-0.6.0/src/utils/pathinfo.cpp flameshot-0.6.0+git20190714/src/utils/pathinfo.cpp --- flameshot-0.6.0/src/utils/pathinfo.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/utils/pathinfo.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -21,11 +21,11 @@ #include const QString PathInfo::whiteIconPath() { - return ":/img/material/white/"; + return QStringLiteral(":/img/material/white/"); } const QString PathInfo::blackIconPath() { - return ":/img/material/black/"; + return QStringLiteral(":/img/material/black/"); } QStringList PathInfo::translationsPaths() { @@ -34,10 +34,10 @@ QString trPath = QDir::toNativeSeparators(binaryPath + "/translations") ; #if defined(Q_OS_LINUX) || defined(Q_OS_UNIX) return QStringList() - << QString(APP_PREFIX) + "/share/flameshot/translations" + << QStringLiteral(APP_PREFIX) + "/share/flameshot/translations" << trPath - << "/usr/share/flameshot/translations" - << "/usr/local/share/flameshot/translations"; + << QStringLiteral("/usr/share/flameshot/translations") + << QStringLiteral("/usr/local/share/flameshot/translations"); #elif defined(Q_OS_WIN) return QStringList() << trPath; diff -Nru flameshot-0.6.0/src/utils/pathinfo.h flameshot-0.6.0+git20190714/src/utils/pathinfo.h --- flameshot-0.6.0/src/utils/pathinfo.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/utils/pathinfo.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/utils/screengrabber.cpp flameshot-0.6.0+git20190714/src/utils/screengrabber.cpp --- flameshot-0.6.0/src/utils/screengrabber.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/utils/screengrabber.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -47,9 +47,11 @@ QDBusInterface gnomeInterface(QStringLiteral("org.gnome.Shell"), QStringLiteral("/org/gnome/Shell/Screenshot"), QStringLiteral("org.gnome.Shell.Screenshot")); - QDBusReply reply = gnomeInterface.call("Screenshot", false, false, path); + QDBusReply reply = gnomeInterface.call(QStringLiteral("Screenshot"), false, false, path); if (reply.value()) { res = QPixmap(path); + QFile dbusResult(path); + dbusResult.remove(); } else { ok = false; } @@ -59,8 +61,12 @@ QDBusInterface kwinInterface(QStringLiteral("org.kde.KWin"), QStringLiteral("/Screenshot"), QStringLiteral("org.kde.kwin.Screenshot")); - QDBusReply reply = kwinInterface.call("screenshotFullscreen"); + QDBusReply reply = kwinInterface.call(QStringLiteral("screenshotFullscreen")); res = QPixmap(reply.value()); + if (!res.isNull()) { + QFile dbusResult(reply.value()); + dbusResult.remove(); + } break; } default: ok = false; diff -Nru flameshot-0.6.0/src/utils/screengrabber.h flameshot-0.6.0+git20190714/src/utils/screengrabber.h --- flameshot-0.6.0/src/utils/screengrabber.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/utils/screengrabber.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/utils/screenshotsaver.cpp flameshot-0.6.0+git20190714/src/utils/screenshotsaver.cpp --- flameshot-0.6.0/src/utils/screenshotsaver.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/utils/screenshotsaver.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -38,18 +38,20 @@ const QString &path) { QString completePath = FileNameHandler().generateAbsolutePath(path); - completePath += ".png"; + completePath += QLatin1String(".png"); bool ok = capture.save(completePath); QString saveMessage; + QString notificationPath = completePath; if (ok) { ConfigHandler().setSavePath(path); saveMessage = QObject::tr("Capture saved as ") + completePath; } else { saveMessage = QObject::tr("Error trying to save as ") + completePath; + notificationPath = ""; } - SystemNotification().sendMessage(saveMessage); + SystemNotification().sendMessage(saveMessage, notificationPath); return ok; } @@ -60,23 +62,27 @@ QString savePath = QFileDialog::getSaveFileName( nullptr, QString(), - FileNameHandler().absoluteSavePath() + ".png"); + FileNameHandler().absoluteSavePath() + ".png", + QLatin1String("Portable Network Graphic file (PNG) (*.png);;BMP file (*.bmp);;JPEG file (*.jpg)")); if (savePath.isNull()) { break; } - if (!savePath.endsWith(".png")) { - savePath += ".png"; - } + if (!savePath.endsWith(QLatin1String(".png"), Qt::CaseInsensitive) && + !savePath.endsWith(QLatin1String(".bmp"), Qt::CaseInsensitive) && + !savePath.endsWith(QLatin1String(".jpg"), Qt::CaseInsensitive)) { + + savePath += QLatin1String(".png"); + } ok = capture.save(savePath); if (ok) { - QString pathNoFile = savePath.left(savePath.lastIndexOf("/")); + QString pathNoFile = savePath.left(savePath.lastIndexOf(QLatin1String("/"))); ConfigHandler().setSavePath(pathNoFile); QString msg = QObject::tr("Capture saved as ") + savePath; - SystemNotification().sendMessage(msg); + SystemNotification().sendMessage(msg, savePath); } else { QString msg = QObject::tr("Error trying to save as ") + savePath; QMessageBox saveErrBox( diff -Nru flameshot-0.6.0/src/utils/screenshotsaver.h flameshot-0.6.0+git20190714/src/utils/screenshotsaver.h --- flameshot-0.6.0/src/utils/screenshotsaver.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/utils/screenshotsaver.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/utils/systemnotification.cpp flameshot-0.6.0+git20190714/src/utils/systemnotification.cpp --- flameshot-0.6.0/src/utils/systemnotification.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/utils/systemnotification.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,6 +1,7 @@ #include "systemnotification.h" #include "src/utils/confighandler.h" #include +#include #ifndef Q_OS_WIN #include @@ -24,13 +25,14 @@ } #endif -void SystemNotification::sendMessage(const QString &text) { - sendMessage(text, tr("Flameshot Info")); +void SystemNotification::sendMessage(const QString &text, const QString &savePath) { + sendMessage(text, tr("Flameshot Info"), savePath); } void SystemNotification::sendMessage( const QString &text, const QString &title, + const QString &savePath, const int timeout) { if(!ConfigHandler().desktopNotificationValue()) { @@ -39,15 +41,21 @@ #ifndef Q_OS_WIN QList args; + QVariantMap hintsMap; + if (!savePath.isEmpty()) { + QUrl fullPath = QUrl::fromLocalFile(savePath); + // allows the notification to be dragged and dropped + hintsMap[QStringLiteral("x-kde-urls")] = QStringList({fullPath.toString()}); + } args << (qAppName()) //appname << static_cast(0) //id << "flameshot" //icon << title //summary << text //body << QStringList() //actions - << QVariantMap() //hints + << hintsMap //hints << timeout; //timeout - m_interface->callWithArgumentList(QDBus::AutoDetect, "Notify", args); + m_interface->callWithArgumentList(QDBus::AutoDetect, QStringLiteral("Notify"), args); #else auto c = Controller::getInstance(); c->sendTrayNotification(text, title, timeout); diff -Nru flameshot-0.6.0/src/utils/systemnotification.h flameshot-0.6.0+git20190714/src/utils/systemnotification.h --- flameshot-0.6.0/src/utils/systemnotification.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/utils/systemnotification.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -26,10 +26,12 @@ public: explicit SystemNotification(QObject *parent = nullptr); - void sendMessage(const QString &text); + void sendMessage(const QString &text, + const QString &savePath = {}); void sendMessage(const QString &text, const QString &title, + const QString &savePath, const int timeout = 5000); private: diff -Nru flameshot-0.6.0/src/widgets/capture/buttonhandler.cpp flameshot-0.6.0+git20190714/src/widgets/capture/buttonhandler.cpp --- flameshot-0.6.0/src/widgets/capture/buttonhandler.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/capture/buttonhandler.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -167,7 +167,7 @@ } } -// horizontalPoints is an auxiliar method for the button position computation. +// horizontalPoints is an auxiliary method for the button position computation. // starts from a known center and keeps adding elements horizontally // and returns the computed positions. QVector ButtonHandler::horizontalPoints( @@ -193,7 +193,7 @@ return res; } -// verticalPoints is an auxiliar method for the button position computation. +// verticalPoints is an auxiliary method for the button position computation. // starts from a known center and keeps adding elements vertically // and returns the computed positions. QVector ButtonHandler::verticalPoints( @@ -252,7 +252,7 @@ pointB.setX(pointA.x()); m_blockedLeft = !(m_screenRegions.contains(pointA) && m_screenRegions.contains(pointB)); - // Botton + // Bottom pointA = QPoint(m_selection.left(), m_selection.bottom() + EXTENSION); pointB = QPoint(m_selection.right(), @@ -264,7 +264,7 @@ pointB.setY(pointA.y()); m_blockedTop = !(m_screenRegions.contains(pointA) && m_screenRegions.contains(pointB)); - // Auxiliar + // Auxiliary m_oneHorizontalBlocked = (!m_blockedRight && m_blockedLeft) || (m_blockedRight && !m_blockedLeft); m_horizontalyBlocked = (m_blockedRight && m_blockedLeft); diff -Nru flameshot-0.6.0/src/widgets/capture/buttonhandler.h flameshot-0.6.0+git20190714/src/widgets/capture/buttonhandler.h --- flameshot-0.6.0/src/widgets/capture/buttonhandler.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/capture/buttonhandler.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/widgets/capture/capturebutton.cpp flameshot-0.6.0+git20190714/src/widgets/capture/capturebutton.cpp --- flameshot-0.6.0/src/widgets/capture/capturebutton.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/capture/capturebutton.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -129,7 +129,7 @@ if(!isVisible()) { show(); m_emergeAnimation->start(); - connect(m_emergeAnimation, &QPropertyAnimation::finished, this, [this](){ + connect(m_emergeAnimation, &QPropertyAnimation::finished, this, [](){ }); } } diff -Nru flameshot-0.6.0/src/widgets/capture/capturebutton.h flameshot-0.6.0+git20190714/src/widgets/capture/capturebutton.h --- flameshot-0.6.0/src/widgets/capture/capturebutton.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/capture/capturebutton.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -27,7 +27,6 @@ class CaptureButton : public QPushButton { Q_OBJECT - Q_ENUMS(ButtonType) public: // Don't forget to add the new types to CaptureButton::iterableButtonTypes @@ -54,6 +53,12 @@ TYPE_TEXT = 18, }; +#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) + Q_ENUMS(ButtonType) +#else + Q_ENUM(ButtonType) +#endif + CaptureButton() = delete; explicit CaptureButton(const ButtonType, QWidget *parent = nullptr); diff -Nru flameshot-0.6.0/src/widgets/capture/capturewidget.cpp flameshot-0.6.0+git20190714/src/widgets/capture/capturewidget.cpp --- flameshot-0.6.0/src/widgets/capture/capturewidget.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/capture/capturewidget.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -23,7 +23,7 @@ #include "capturewidget.h" #include "src/widgets/capture/hovereventfilter.h" -#include "src/widgets/panel/colorpickerwidget.h" +#include "src/widgets/panel/sidepanelwidget.h" #include "src/utils/colorutils.h" #include "src/utils/globalvalues.h" #include "src/widgets/capture/notifierbox.h" @@ -52,7 +52,7 @@ bool fullScreen, QWidget *parent) : QWidget(parent), m_mouseIsClicked(false), m_rightClick(false), m_newSelection(false), m_grabbing(false), m_captureDone(false), - m_previewEnabled(true), m_activeButton(nullptr), + m_previewEnabled(true), m_adjustmentButtonPressed(false), m_activeButton(nullptr), m_activeTool(nullptr), m_toolWidget(nullptr), m_mouseOverHandle(SelectionWidget::NO_SIDE), m_id(id) { @@ -186,12 +186,12 @@ return m_context.selectedScreenshotArea(); } -void CaptureWidget::close() { +void CaptureWidget::deleteToolwidgetOrClose() { if (m_toolWidget) { m_toolWidget->deleteLater(); m_toolWidget = nullptr; } else { - QWidget::close(); + close(); } } @@ -398,7 +398,11 @@ } } else if (m_mouseIsClicked && m_activeTool) { // drawing with a tool - m_activeTool->drawMove(e->pos()); + if (m_adjustmentButtonPressed) { + m_activeTool->drawMoveWithAdjustment(e->pos()); + } else { + m_activeTool->drawMove(e->pos()); + } update(); // Hides the buttons under the mouse. If the mouse leaves, it shows them. if (m_buttonHandler->buttonsAreInside()) { @@ -471,11 +475,15 @@ } else if (e->key() == Qt::Key_Up && m_selection->geometry().top() > rect().top()) { m_selection->move(QPoint(m_selection->x(), m_selection->y() -1)); + QRect newGeometry = m_selection->geometry().intersected(rect()); + m_context.selection = extendedRect(&newGeometry); m_buttonHandler->updatePosition(m_selection->geometry()); update(); } else if (e->key() == Qt::Key_Down && m_selection->geometry().bottom() < rect().bottom()) { m_selection->move(QPoint(m_selection->x(), m_selection->y() +1)); + QRect newGeometry = m_selection->geometry().intersected(rect()); + m_context.selection = extendedRect(&newGeometry); m_buttonHandler->updatePosition(m_selection->geometry()); update(); } else if (e->key() == Qt::Key_Left @@ -486,8 +494,18 @@ } else if (e->key() == Qt::Key_Right && m_selection->geometry().right() < rect().right()) { m_selection->move(QPoint(m_selection->x() +1, m_selection->y())); + QRect newGeometry = m_selection->geometry().intersected(rect()); + m_context.selection = extendedRect(&newGeometry); m_buttonHandler->updatePosition(m_selection->geometry()); update(); + } else if (e->key() == Qt::Key_Control) { + m_adjustmentButtonPressed = true; + } +} + +void CaptureWidget::keyReleaseEvent(QKeyEvent *e) { + if (e->key() == Qt::Key_Control) { + m_adjustmentButtonPressed = false; } } @@ -541,16 +559,21 @@ panelRect.setWidth(m_colorPicker->width() * 3); m_panel->setGeometry(panelRect); - ColorPickerWidget *colorPicker = - new ColorPickerWidget(&m_context.screenshot); - connect(colorPicker, &ColorPickerWidget::colorChanged, + SidePanelWidget *sidePanel = + new SidePanelWidget(&m_context.screenshot); + connect(sidePanel, &SidePanelWidget::colorChanged, this, &CaptureWidget::setDrawColor); + connect(sidePanel, &SidePanelWidget::thicknessChanged, + this, &CaptureWidget::setDrawThickness); connect(this, &CaptureWidget::colorChanged, - colorPicker, &ColorPickerWidget::updateColor); - connect(colorPicker, &ColorPickerWidget::togglePanel, + sidePanel, &SidePanelWidget::updateColor); + connect(this, &CaptureWidget::thicknessChanged, + sidePanel, &SidePanelWidget::updateThickness); + connect(sidePanel, &SidePanelWidget::togglePanel, m_panel, &UtilityPanel::toggle); - colorPicker->colorChanged(m_context.color); - m_panel->pushWidget(colorPicker); + sidePanel->colorChanged(m_context.color); + sidePanel->thicknessChanged(m_context.thickness); + m_panel->pushWidget(sidePanel); m_panel->pushWidget(new QUndoView(&m_undoStack, this)); } @@ -692,9 +715,18 @@ emit colorChanged(c); } +void CaptureWidget::setDrawThickness(const int &t) +{ + m_context.thickness = qBound(0, t, 100); + ConfigHandler().setdrawThickness(m_context.thickness); + emit thicknessChanged(m_context.thickness); +} + void CaptureWidget::leftResize() { if (m_selection->isVisible() && m_selection->geometry().right() > m_selection->geometry().left()) { m_selection->setGeometry(m_selection->geometry() + QMargins(0, 0, -1, 0)); + QRect newGeometry = m_selection->geometry().intersected(rect()); + m_context.selection = extendedRect(&newGeometry); m_buttonHandler->updatePosition(m_selection->geometry()); updateSizeIndicator(); update(); @@ -704,6 +736,8 @@ void CaptureWidget::rightResize() { if (m_selection->isVisible() && m_selection->geometry().right() < rect().right()) { m_selection->setGeometry(m_selection->geometry() + QMargins(0, 0, 1, 0)); + QRect newGeometry = m_selection->geometry().intersected(rect()); + m_context.selection = extendedRect(&newGeometry); m_buttonHandler->updatePosition(m_selection->geometry()); updateSizeIndicator(); update(); @@ -713,6 +747,8 @@ void CaptureWidget::upResize() { if (m_selection->isVisible() && m_selection->geometry().bottom() > m_selection->geometry().top()) { m_selection->setGeometry(m_selection->geometry() + QMargins(0, 0, 0, -1)); + QRect newGeometry = m_selection->geometry().intersected(rect()); + m_context.selection = extendedRect(&newGeometry); m_buttonHandler->updatePosition(m_selection->geometry()); updateSizeIndicator(); update(); @@ -722,6 +758,8 @@ void CaptureWidget::downResize() { if (m_selection->isVisible() && m_selection->geometry().bottom() < rect().bottom()) { m_selection->setGeometry(m_selection->geometry() + QMargins(0, 0, 0, 1)); + QRect newGeometry = m_selection->geometry().intersected(rect()); + m_context.selection = extendedRect(&newGeometry); m_buttonHandler->updatePosition(m_selection->geometry()); updateSizeIndicator(); update(); @@ -739,8 +777,9 @@ new QShortcut(QKeySequence(Qt::SHIFT + Qt::Key_Up), this, SLOT(upResize())); new QShortcut(QKeySequence(Qt::SHIFT + Qt::Key_Down), this, SLOT(downResize())); new QShortcut(Qt::Key_Space, this, SLOT(togglePanel())); - new QShortcut(Qt::Key_Escape, this, SLOT(close())); + new QShortcut(Qt::Key_Escape, this, SLOT(deleteToolwidgetOrClose())); new QShortcut(Qt::Key_Return, this, SLOT(copyScreenshot())); + new QShortcut(Qt::Key_Enter, this, SLOT(copyScreenshot())); } void CaptureWidget::updateSizeIndicator() { diff -Nru flameshot-0.6.0/src/widgets/capture/capturewidget.h flameshot-0.6.0+git20190714/src/widgets/capture/capturewidget.h --- flameshot-0.6.0/src/widgets/capture/capturewidget.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/capture/capturewidget.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -14,10 +14,10 @@ // // You should have received a copy of the GNU General Public License // along with Flameshot. If not, see . - + // Based on Lightscreen areadialog.h, Copyright 2017 Christian Kaiser // released under the GNU GPL2 - + // Based on KDE's KSnapshot regiongrabber.cpp, revision 796531, Copyright 2007 Luca Gugelmann // released under the GNU LGPL @@ -61,7 +61,7 @@ QPixmap pixmap(); public slots: - void close(); + void deleteToolwidgetOrClose(); signals: void captureTaken(uint id, QPixmap p); @@ -89,6 +89,7 @@ void processTool(CaptureTool *t); void handleButtonSignal(CaptureTool::Request r); void setDrawColor(const QColor &c); + void setDrawThickness(const int &t); protected: void paintEvent(QPaintEvent *); @@ -96,6 +97,7 @@ void mouseMoveEvent(QMouseEvent *); void mouseReleaseEvent(QMouseEvent *); void keyPressEvent(QKeyEvent *); + void keyReleaseEvent(QKeyEvent *); void wheelEvent(QWheelEvent *); void resizeEvent(QResizeEvent *); void moveEvent(QMoveEvent *); @@ -118,6 +120,7 @@ bool m_showInitialMsg; bool m_captureDone; bool m_previewEnabled; + bool m_adjustmentButtonPressed; private: void initContext(const QString &savePath, bool fullscreen); diff -Nru flameshot-0.6.0/src/widgets/capture/colorpicker.cpp flameshot-0.6.0+git20190714/src/widgets/capture/colorpicker.cpp --- flameshot-0.6.0/src/widgets/capture/colorpicker.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/capture/colorpicker.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +/// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/widgets/capture/colorpicker.h flameshot-0.6.0+git20190714/src/widgets/capture/colorpicker.h --- flameshot-0.6.0/src/widgets/capture/colorpicker.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/capture/colorpicker.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/widgets/capture/hovereventfilter.cpp flameshot-0.6.0+git20190714/src/widgets/capture/hovereventfilter.cpp --- flameshot-0.6.0/src/widgets/capture/hovereventfilter.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/capture/hovereventfilter.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/widgets/capture/hovereventfilter.h flameshot-0.6.0+git20190714/src/widgets/capture/hovereventfilter.h --- flameshot-0.6.0/src/widgets/capture/hovereventfilter.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/capture/hovereventfilter.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/widgets/capture/modificationcommand.cpp flameshot-0.6.0+git20190714/src/widgets/capture/modificationcommand.cpp --- flameshot-0.6.0/src/widgets/capture/modificationcommand.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/capture/modificationcommand.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/widgets/capture/modificationcommand.h flameshot-0.6.0+git20190714/src/widgets/capture/modificationcommand.h --- flameshot-0.6.0/src/widgets/capture/modificationcommand.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/capture/modificationcommand.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/widgets/capture/notifierbox.cpp flameshot-0.6.0+git20190714/src/widgets/capture/notifierbox.cpp --- flameshot-0.6.0/src/widgets/capture/notifierbox.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/capture/notifierbox.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -63,5 +63,5 @@ void NotifierBox::showColor(const QColor &color) { Q_UNUSED(color); - m_message = ""; + m_message = QLatin1String(""); } diff -Nru flameshot-0.6.0/src/widgets/capture/notifierbox.h flameshot-0.6.0+git20190714/src/widgets/capture/notifierbox.h --- flameshot-0.6.0/src/widgets/capture/notifierbox.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/capture/notifierbox.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/widgets/capture/selectionwidget.cpp flameshot-0.6.0+git20190714/src/widgets/capture/selectionwidget.cpp --- flameshot-0.6.0/src/widgets/capture/selectionwidget.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/capture/selectionwidget.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/widgets/capture/selectionwidget.h flameshot-0.6.0+git20190714/src/widgets/capture/selectionwidget.h --- flameshot-0.6.0/src/widgets/capture/selectionwidget.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/capture/selectionwidget.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/widgets/capturelauncher.cpp flameshot-0.6.0+git20190714/src/widgets/capturelauncher.cpp --- flameshot-0.6.0/src/widgets/capturelauncher.cpp 1970-01-01 00:00:00.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/capturelauncher.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -0,0 +1,142 @@ +// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// +// This file is part of Flameshot. +// +// Flameshot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Flameshot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Flameshot. If not, see . + +#include "capturelauncher.h" +#include "src/core/controller.h" +#include "src/widgets/imagelabel.h" +#include "src/widgets/notificationwidget.h" +#include "src/utils/screengrabber.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// https://github.com/KDE/spectacle/blob/941c1a517be82bed25d1254ebd735c29b0d2951c/src/Gui/KSWidget.cpp +// https://github.com/KDE/spectacle/blob/941c1a517be82bed25d1254ebd735c29b0d2951c/src/Gui/KSMainWindow.cpp + +CaptureLauncher::CaptureLauncher(QWidget *parent) : + QWidget(parent), m_id(0) +{ + setAttribute(Qt::WA_DeleteOnClose); + connect(Controller::getInstance(), &Controller::captureTaken, + this, &CaptureLauncher::captureTaken); + connect(Controller::getInstance(), &Controller::captureFailed, + this, &CaptureLauncher::captureFailed); + + m_imageLabel = new ImageLabel(this); + bool ok; + m_imageLabel->setScreenshot(ScreenGrabber().grabEntireDesktop(ok)); + if (!ok) { + + } + m_imageLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + connect(m_imageLabel, &ImageLabel::dragInitiated, + this, &CaptureLauncher::startDrag); + + QGridLayout *layout = new QGridLayout(this); + layout->addWidget(m_imageLabel, 0, 0); + + m_CaptureModeLabel = new QLabel(tr("Capture Mode")); + + m_captureType = new QComboBox(); + m_captureType->setMinimumWidth(240); + // TODO remember number + m_captureType->insertItem(1, tr("Rectangular Region"), CaptureRequest::GRAPHICAL_MODE); + m_captureType->insertItem(2, tr("Full Screen (All Monitors)"), CaptureRequest::FULLSCREEN_MODE); + //m_captureType->insertItem(3, tr("Single Screen"), CaptureRequest::SCREEN_MODE); + + m_delaySpinBox = new QSpinBox(); + m_delaySpinBox->setSingleStep(1.0); + m_delaySpinBox->setMinimum(0.0); + m_delaySpinBox->setMaximum(999.0); + m_delaySpinBox->setSpecialValueText(tr("No Delay")); + m_delaySpinBox->setMinimumWidth(160); + // with QT 5.7 qOverload(&QSpinBox::valueChanged), + connect(m_delaySpinBox, + static_cast(&QSpinBox::valueChanged), + this, [this](int val) + { + QString sufix = val == 1 ?tr(" second") : tr(" seconds"); + this->m_delaySpinBox->setSuffix(sufix); + }); + + m_launchButton = new QPushButton(tr("Take new screenshot")); + m_launchButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + connect(m_launchButton, &QPushButton::pressed, + this, &CaptureLauncher::startCapture); + m_launchButton->setFocus(); + + QFormLayout *captureModeForm = new QFormLayout; + captureModeForm->addRow(tr("Area:"), m_captureType); + captureModeForm->addRow(tr("Delay:"), m_delaySpinBox); + captureModeForm->setContentsMargins(24, 0, 0, 0); + + m_mainLayout = new QVBoxLayout(); + m_mainLayout->addStretch(1); + m_mainLayout->addWidget(m_CaptureModeLabel); + m_mainLayout->addLayout(captureModeForm); + m_mainLayout->addStretch(10); + m_mainLayout->addWidget(m_launchButton, 1 , Qt::AlignCenter); + m_mainLayout->setContentsMargins(10, 0, 0, 10); + layout->addLayout(m_mainLayout, 0 ,1); + layout->setColumnMinimumWidth(0, 320); + layout->setColumnMinimumWidth(1, 320); + +} + +// HACK: https://github.com/KDE/spectacle/blob/fa1e780b8bf3df3ac36c410b9ece4ace041f401b/src/Gui/KSMainWindow.cpp#L70 +void CaptureLauncher::startCapture() { + hide(); + auto mode = static_cast( + m_captureType->currentData().toInt()); + CaptureRequest req(mode, 600 + m_delaySpinBox->value() * 1000); + m_id = req.id(); + Controller::getInstance()->requestCapture(req); +} + +void CaptureLauncher::startDrag() { + QDrag *dragHandler = new QDrag(this); + QMimeData *mimeData = new QMimeData; + mimeData->setImageData(m_imageLabel->pixmap()); + dragHandler->setMimeData(mimeData); + + dragHandler->setPixmap(m_imageLabel->pixmap() + ->scaled(256, 256, Qt::KeepAspectRatioByExpanding, + Qt::SmoothTransformation)); + dragHandler->exec(); +} + +void CaptureLauncher::captureTaken(uint id, QPixmap p) { + if (id == m_id) { + m_id = 0; + m_imageLabel->setScreenshot(p); + show(); + } +} + +void CaptureLauncher::captureFailed(uint id) { + if (id == m_id) { + m_id = 0; + show(); + } +} diff -Nru flameshot-0.6.0/src/widgets/capturelauncher.h flameshot-0.6.0+git20190714/src/widgets/capturelauncher.h --- flameshot-0.6.0/src/widgets/capturelauncher.h 1970-01-01 00:00:00.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/capturelauncher.h 2019-07-14 16:21:21.000000000 +0000 @@ -0,0 +1,51 @@ +// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// +// This file is part of Flameshot. +// +// Flameshot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Flameshot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Flameshot. If not, see . + +#pragma once + +#include + +class QCheckBox; +class QPushButton; +class QVBoxLayout; +class QComboBox; +class QSpinBox; +class QLabel; +class ImageLabel; + +class CaptureLauncher : public QWidget +{ + Q_OBJECT +public: + explicit CaptureLauncher(QWidget *parent = nullptr); + +private slots: + void startCapture(); + void startDrag(); + void captureTaken(uint id, QPixmap p); + void captureFailed(uint id); + +private: + + QSpinBox *m_delaySpinBox; + QComboBox *m_captureType; + QVBoxLayout *m_mainLayout; + QPushButton *m_launchButton; + QLabel *m_CaptureModeLabel; + ImageLabel *m_imageLabel; + uint m_id; +}; diff -Nru flameshot-0.6.0/src/widgets/imagelabel.cpp flameshot-0.6.0+git20190714/src/widgets/imagelabel.cpp --- flameshot-0.6.0/src/widgets/imagelabel.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/imagelabel.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/widgets/imagelabel.h flameshot-0.6.0+git20190714/src/widgets/imagelabel.h --- flameshot-0.6.0/src/widgets/imagelabel.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/imagelabel.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/widgets/infowindow.cpp flameshot-0.6.0+git20190714/src/widgets/infowindow.cpp --- flameshot-0.6.0/src/widgets/infowindow.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/infowindow.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -23,6 +23,13 @@ #include #include +#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) +#include +#include +#include +#include +#endif + // InfoWindow show basic information about the usage of Flameshot InfoWindow::InfoWindow(QWidget *parent) : QWidget(parent) { @@ -30,6 +37,13 @@ setWindowIcon(QIcon(":img/app/flameshot.svg")); setWindowTitle(tr("About")); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) + QRect position = frameGeometry(); + QScreen *screen = QGuiApplication::screenAt(QCursor::pos()); + position.moveCenter(screen->availableGeometry().center()); + move(position.topLeft()); +#endif + m_layout = new QVBoxLayout(this); m_layout->setAlignment(Qt::AlignHCenter); initLabels(); @@ -45,6 +59,7 @@ "CTRL + C", "CTRL + S", "CTRL + Z", + QT_TR_NOOP("SPACEBAR"), QT_TR_NOOP("Right Click"), QT_TR_NOOP("Mouse Wheel") }; @@ -56,6 +71,7 @@ QT_TR_NOOP("Copy to clipboard"), QT_TR_NOOP("Save selection as a file"), QT_TR_NOOP("Undo the last modification"), + QT_TR_NOOP("Toggle visibility of sidebar with options of the selected tool"), QT_TR_NOOP("Show color picker"), QT_TR_NOOP("Change the tool's thickness") }; @@ -107,7 +123,7 @@ QLabel *licenseTitleLabel = new QLabel(tr("License"), this); licenseTitleLabel->setAlignment(Qt::AlignHCenter); m_layout->addWidget(licenseTitleLabel); - QLabel *licenseLabel = new QLabel("GPLv3+", this); + QLabel *licenseLabel = new QLabel(QStringLiteral("GPLv3+"), this); licenseLabel->setAlignment(Qt::AlignHCenter); m_layout->addWidget(licenseLabel); m_layout->addStretch(); @@ -115,7 +131,7 @@ QLabel *versionTitleLabel = new QLabel(tr("Version"), this); versionTitleLabel->setAlignment(Qt::AlignHCenter); m_layout->addWidget(versionTitleLabel); - QString versionMsg = "Flameshot " + QString(APP_VERSION) + "\nCompiled with Qt " + QString versionMsg = "Flameshot " + QStringLiteral(APP_VERSION) + "\nCompiled with Qt " + QT_VERSION_STR; QLabel *versionLabel = new QLabel(versionMsg, this); versionLabel->setAlignment(Qt::AlignHCenter); diff -Nru flameshot-0.6.0/src/widgets/infowindow.h flameshot-0.6.0+git20190714/src/widgets/infowindow.h --- flameshot-0.6.0/src/widgets/infowindow.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/infowindow.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/widgets/loadspinner.cpp flameshot-0.6.0+git20190714/src/widgets/loadspinner.cpp --- flameshot-0.6.0/src/widgets/loadspinner.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/loadspinner.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -32,7 +32,7 @@ updateFrame(); // init timer m_timer = new QTimer(this); - connect(m_timer, SIGNAL(timeout()), this, SLOT(rotate())); + connect(m_timer, &QTimer::timeout, this, &LoadSpinner::rotate); m_timer->setInterval(30); } diff -Nru flameshot-0.6.0/src/widgets/loadspinner.h flameshot-0.6.0+git20190714/src/widgets/loadspinner.h --- flameshot-0.6.0/src/widgets/loadspinner.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/loadspinner.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/widgets/notificationwidget.cpp flameshot-0.6.0+git20190714/src/widgets/notificationwidget.cpp --- flameshot-0.6.0/src/widgets/notificationwidget.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/notificationwidget.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/widgets/notificationwidget.h flameshot-0.6.0+git20190714/src/widgets/notificationwidget.h --- flameshot-0.6.0/src/widgets/notificationwidget.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/notificationwidget.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // diff -Nru flameshot-0.6.0/src/widgets/panel/colorpickerwidget.cpp flameshot-0.6.0+git20190714/src/widgets/panel/colorpickerwidget.cpp --- flameshot-0.6.0/src/widgets/panel/colorpickerwidget.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/panel/colorpickerwidget.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,168 +0,0 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors -// -// This file is part of Flameshot. -// -// Flameshot is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Flameshot is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Flameshot. If not, see . - -#include "colorpickerwidget.h" -#include "src/utils/pathinfo.h" -#include "src/utils/colorutils.h" -#include -#include -#include -#include -#include - -class QColorPickingEventFilter : public QObject { -public: - - explicit QColorPickingEventFilter( - ColorPickerWidget *pw, QObject *parent = 0) : - QObject(parent), m_pw(pw) {} - - bool eventFilter(QObject *, QEvent *event) override { - event->accept(); - switch (event->type()) { - case QEvent::MouseMove: - return m_pw->handleMouseMove(static_cast(event)); - case QEvent::MouseButtonPress: - return m_pw->handleMouseButtonPressed( - static_cast(event)); - case QEvent::KeyPress: - return m_pw->handleKeyPress(static_cast(event)); - default: - break; - } - return false; - } - -private: - ColorPickerWidget *m_pw; -}; - -//////////////////////// - -ColorPickerWidget::ColorPickerWidget(QPixmap *p, QWidget *parent) : - QWidget(parent), m_pixmap(p), m_eventFilter(nullptr) -{ - m_layout = new QVBoxLayout(this); - - QFormLayout *colorForm = new QFormLayout(); - m_colorLabel = new QLabel(); - m_colorLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - colorForm->addRow(tr("Active color:"), m_colorLabel); - m_layout->addLayout(colorForm); - - QColor background = this->palette().background().color(); - bool isDark = ColorUtils::colorIsDark(background); - QString modifier = isDark ? PathInfo::whiteIconPath() : - PathInfo::blackIconPath(); - QIcon grabIcon(modifier + "colorize.svg"); - m_colorGrabButton = new QPushButton(grabIcon, ""); - updateGrabButton(false); - connect(m_colorGrabButton, &QPushButton::pressed, - this, &ColorPickerWidget::colorGrabberActivated); - m_layout->addWidget(m_colorGrabButton); - - m_colorWheel = new color_widgets::ColorWheel(this); - m_colorWheel->setColor(m_color); - connect(m_colorWheel, &color_widgets::ColorWheel::mouseReleaseOnColor, this, - &ColorPickerWidget::colorChanged); - connect(m_colorWheel, &color_widgets::ColorWheel::colorChanged, this, - &ColorPickerWidget::updateColorNoWheel); - m_layout->addWidget(m_colorWheel); -} - -void ColorPickerWidget::updateColor(const QColor &c) { - m_color = c; - m_colorLabel->setStyleSheet( - QString("QLabel { background-color : %1; }").arg(c.name())); - m_colorWheel->setColor(m_color); -} - -void ColorPickerWidget::updateColorNoWheel(const QColor &c) { - m_color = c; - m_colorLabel->setStyleSheet( - QString("QLabel { background-color : %1; }").arg(c.name())); -} - -void ColorPickerWidget::colorGrabberActivated() { - grabKeyboard(); - grabMouse(Qt::CrossCursor); - setMouseTracking(true); - m_colorBackup = m_color; - if (!m_eventFilter) { - m_eventFilter = new QColorPickingEventFilter(this, this); - } - installEventFilter(m_eventFilter); - updateGrabButton(true); -} - -void ColorPickerWidget::releaseColorGrab() { - setMouseTracking(false); - removeEventFilter(m_eventFilter); - releaseMouse(); - releaseKeyboard(); - setFocus(); - updateGrabButton(false); -} - -QColor ColorPickerWidget::grabPixmapColor(const QPoint &p) { - QColor c; - if (m_pixmap) { - QPixmap pixel = m_pixmap->copy(QRect(p, p)); - c = pixel.toImage().pixel(0,0); - } - return c; -} - -bool ColorPickerWidget::handleKeyPress(QKeyEvent *e) { - if (e->key() == Qt::Key_Space) { - emit togglePanel(); - } else if (e->key() == Qt::Key_Escape) { - releaseColorGrab(); - updateColor(m_colorBackup); - } else if (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) { - updateColor(grabPixmapColor(QCursor::pos())); - releaseColorGrab(); - emit colorChanged(m_color); - } - return true; -} - -bool ColorPickerWidget::handleMouseButtonPressed(QMouseEvent *e) { - if (m_colorGrabButton->geometry().contains(e->pos()) || - e->button() == Qt::RightButton) - { - updateColorNoWheel(m_colorBackup); - } else if (e->button() == Qt::LeftButton) { - updateColor(grabPixmapColor(QCursor::pos())); - } - releaseColorGrab(); - emit colorChanged(m_color); - return true; -} - -bool ColorPickerWidget::handleMouseMove(QMouseEvent *e) { - updateColorNoWheel(grabPixmapColor(e->globalPos())); - return true; -} - -void ColorPickerWidget::updateGrabButton(const bool activated) { - if (activated) { - m_colorGrabButton->setText(tr("Press ESC to cancel")); - } else { - m_colorGrabButton->setText(tr("Grab Color")); - } -} diff -Nru flameshot-0.6.0/src/widgets/panel/colorpickerwidget.h flameshot-0.6.0+git20190714/src/widgets/panel/colorpickerwidget.h --- flameshot-0.6.0/src/widgets/panel/colorpickerwidget.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/panel/colorpickerwidget.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors -// -// This file is part of Flameshot. -// -// Flameshot is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Flameshot is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Flameshot. If not, see . - -#pragma once - -#include -#include "color_wheel.hpp" - -class QVBoxLayout; -class QPushButton; -class QLabel; -class QColorPickingEventFilter; - -class ColorPickerWidget : public QWidget { - Q_OBJECT - - friend class QColorPickingEventFilter; -public: - explicit ColorPickerWidget(QPixmap *p, QWidget *parent = nullptr); - -signals: - void colorChanged(const QColor &c); - void togglePanel(); - -public slots: - void updateColor(const QColor &c); - -private slots: - void updateColorNoWheel(const QColor &c); - -private slots: - void colorGrabberActivated(); - void releaseColorGrab(); - -private: - QColor grabPixmapColor(const QPoint &p); - - bool handleKeyPress(QKeyEvent *e); - bool handleMouseButtonPressed(QMouseEvent *e); - bool handleMouseMove(QMouseEvent *e); - - void updateGrabButton(const bool activated); - - QVBoxLayout *m_layout; - QPushButton *m_colorGrabButton; - color_widgets::ColorWheel *m_colorWheel; - QLabel *m_colorLabel; - QPixmap *m_pixmap; - QColor m_colorBackup; - QColor m_color; - QColorPickingEventFilter *m_eventFilter; - -}; diff -Nru flameshot-0.6.0/src/widgets/panel/sidepanelwidget.cpp flameshot-0.6.0+git20190714/src/widgets/panel/sidepanelwidget.cpp --- flameshot-0.6.0/src/widgets/panel/sidepanelwidget.cpp 1970-01-01 00:00:00.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/panel/sidepanelwidget.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -0,0 +1,188 @@ +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors +// +// This file is part of Flameshot. +// +// Flameshot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Flameshot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Flameshot. If not, see . + +#include "sidepanelwidget.h" +#include "src/utils/pathinfo.h" +#include "src/utils/colorutils.h" +#include +#include +#include +#include +#include +#include + +class QColorPickingEventFilter : public QObject { +public: + + explicit QColorPickingEventFilter( + SidePanelWidget *pw, QObject *parent = nullptr) : + QObject(parent), m_pw(pw) {} + + bool eventFilter(QObject *, QEvent *event) override { + event->accept(); + switch (event->type()) { + case QEvent::MouseMove: + return m_pw->handleMouseMove(static_cast(event)); + case QEvent::MouseButtonPress: + return m_pw->handleMouseButtonPressed( + static_cast(event)); + case QEvent::KeyPress: + return m_pw->handleKeyPress(static_cast(event)); + default: + break; + } + return false; + } + +private: + SidePanelWidget *m_pw; +}; + +//////////////////////// + +SidePanelWidget::SidePanelWidget(QPixmap *p, QWidget *parent) : + QWidget(parent), m_pixmap(p), m_eventFilter(nullptr) +{ + m_layout = new QVBoxLayout(this); + + QFormLayout *colorForm = new QFormLayout(); + m_thicknessSlider = new QSlider(Qt::Horizontal); + m_thicknessSlider->setValue(m_thickness); + m_colorLabel = new QLabel(); + m_colorLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + colorForm->addRow(tr("Active thickness:"), m_thicknessSlider); + colorForm->addRow(tr("Active color:"), m_colorLabel); + m_layout->addLayout(colorForm); + + connect(m_thicknessSlider, &QSlider::sliderReleased, + this, &SidePanelWidget::updateCurrentThickness); + connect(this, &SidePanelWidget::thicknessChanged, + this, &SidePanelWidget::updateThickness); + + QColor background = this->palette().background().color(); + bool isDark = ColorUtils::colorIsDark(background); + QString modifier = isDark ? PathInfo::whiteIconPath() : + PathInfo::blackIconPath(); + QIcon grabIcon(modifier + "colorize.svg"); + m_colorGrabButton = new QPushButton(grabIcon, QLatin1String("")); + updateGrabButton(false); + connect(m_colorGrabButton, &QPushButton::pressed, + this, &SidePanelWidget::colorGrabberActivated); + m_layout->addWidget(m_colorGrabButton); + + m_colorWheel = new color_widgets::ColorWheel(this); + m_colorWheel->setColor(m_color); + connect(m_colorWheel, &color_widgets::ColorWheel::mouseReleaseOnColor, this, + &SidePanelWidget::colorChanged); + connect(m_colorWheel, &color_widgets::ColorWheel::colorChanged, this, + &SidePanelWidget::updateColorNoWheel); + m_layout->addWidget(m_colorWheel); +} + +void SidePanelWidget::updateColor(const QColor &c) { + m_color = c; + m_colorLabel->setStyleSheet( + QStringLiteral("QLabel { background-color : %1; }").arg(c.name())); + m_colorWheel->setColor(m_color); +} + +void SidePanelWidget::updateThickness(const int &t) +{ + m_thickness = qBound(0, t, 100); + m_thicknessSlider->setValue(m_thickness); +} + +void SidePanelWidget::updateColorNoWheel(const QColor &c) { + m_color = c; + m_colorLabel->setStyleSheet( + QStringLiteral("QLabel { background-color : %1; }").arg(c.name())); +} + +void SidePanelWidget::updateCurrentThickness() +{ + emit thicknessChanged(m_thicknessSlider->value()); +} + +void SidePanelWidget::colorGrabberActivated() { + grabKeyboard(); + grabMouse(Qt::CrossCursor); + setMouseTracking(true); + m_colorBackup = m_color; + if (!m_eventFilter) { + m_eventFilter = new QColorPickingEventFilter(this, this); + } + installEventFilter(m_eventFilter); + updateGrabButton(true); +} + +void SidePanelWidget::releaseColorGrab() { + setMouseTracking(false); + removeEventFilter(m_eventFilter); + releaseMouse(); + releaseKeyboard(); + setFocus(); + updateGrabButton(false); +} + +QColor SidePanelWidget::grabPixmapColor(const QPoint &p) { + QColor c; + if (m_pixmap) { + QPixmap pixel = m_pixmap->copy(QRect(p, p)); + c = pixel.toImage().pixel(0,0); + } + return c; +} + +bool SidePanelWidget::handleKeyPress(QKeyEvent *e) { + if (e->key() == Qt::Key_Space) { + emit togglePanel(); + } else if (e->key() == Qt::Key_Escape) { + releaseColorGrab(); + updateColor(m_colorBackup); + } else if (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) { + updateColor(grabPixmapColor(QCursor::pos())); + releaseColorGrab(); + emit colorChanged(m_color); + } + return true; +} + +bool SidePanelWidget::handleMouseButtonPressed(QMouseEvent *e) { + if (m_colorGrabButton->geometry().contains(e->pos()) || + e->button() == Qt::RightButton) + { + updateColorNoWheel(m_colorBackup); + } else if (e->button() == Qt::LeftButton) { + updateColor(grabPixmapColor(QCursor::pos())); + } + releaseColorGrab(); + emit colorChanged(m_color); + return true; +} + +bool SidePanelWidget::handleMouseMove(QMouseEvent *e) { + updateColorNoWheel(grabPixmapColor(e->globalPos())); + return true; +} + +void SidePanelWidget::updateGrabButton(const bool activated) { + if (activated) { + m_colorGrabButton->setText(tr("Press ESC to cancel")); + } else { + m_colorGrabButton->setText(tr("Grab Color")); + } +} diff -Nru flameshot-0.6.0/src/widgets/panel/sidepanelwidget.h flameshot-0.6.0+git20190714/src/widgets/panel/sidepanelwidget.h --- flameshot-0.6.0/src/widgets/panel/sidepanelwidget.h 1970-01-01 00:00:00.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/panel/sidepanelwidget.h 2019-07-14 16:21:21.000000000 +0000 @@ -0,0 +1,73 @@ +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors +// +// This file is part of Flameshot. +// +// Flameshot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Flameshot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Flameshot. If not, see . + +#pragma once + +#include +#include "color_wheel.hpp" + +class QVBoxLayout; +class QPushButton; +class QLabel; +class QColorPickingEventFilter; +class QSlider; + +class SidePanelWidget : public QWidget { + Q_OBJECT + + friend class QColorPickingEventFilter; +public: + explicit SidePanelWidget(QPixmap *p, QWidget *parent = nullptr); + +signals: + void colorChanged(const QColor &c); + void thicknessChanged(const int &t); + void togglePanel(); + +public slots: + void updateColor(const QColor &c); + void updateThickness(const int &t); + +private slots: + void updateColorNoWheel(const QColor &c); + void updateCurrentThickness(); + +private slots: + void colorGrabberActivated(); + void releaseColorGrab(); + +private: + QColor grabPixmapColor(const QPoint &p); + + bool handleKeyPress(QKeyEvent *e); + bool handleMouseButtonPressed(QMouseEvent *e); + bool handleMouseMove(QMouseEvent *e); + + void updateGrabButton(const bool activated); + + QVBoxLayout *m_layout; + QPushButton *m_colorGrabButton; + color_widgets::ColorWheel *m_colorWheel; + QLabel *m_colorLabel; + QPixmap *m_pixmap; + QColor m_colorBackup; + QColor m_color; + QSlider *m_thicknessSlider; + int m_thickness; + QColorPickingEventFilter *m_eventFilter; + +}; diff -Nru flameshot-0.6.0/src/widgets/panel/utilitypanel.cpp flameshot-0.6.0+git20190714/src/widgets/panel/utilitypanel.cpp --- flameshot-0.6.0/src/widgets/panel/utilitypanel.cpp 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/panel/utilitypanel.cpp 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -15,12 +15,6 @@ // You should have received a copy of the GNU General Public License // along with Flameshot. If not, see . -// Based on Lightscreen areadialog.h, Copyright 2017 Christian Kaiser -// released under the GNU GPL2 - -// Based on KDE's KSnapshot regiongrabber.cpp, revision 796531, Copyright 2007 Luca Gugelmann -// released under the GNU LGPL - #include "utilitypanel.h" #include #include @@ -98,7 +92,7 @@ QColor bgColor = palette().background().color(); bgColor.setAlphaF(0.0); - m_internalPanel->setStyleSheet(QString("QScrollArea {background-color: %1}") + m_internalPanel->setStyleSheet(QStringLiteral("QScrollArea {background-color: %1}") .arg(bgColor.name())); m_internalPanel->hide(); } diff -Nru flameshot-0.6.0/src/widgets/panel/utilitypanel.h flameshot-0.6.0+git20190714/src/widgets/panel/utilitypanel.h --- flameshot-0.6.0/src/widgets/panel/utilitypanel.h 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/src/widgets/panel/utilitypanel.h 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2018 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -15,12 +15,6 @@ // You should have received a copy of the GNU General Public License // along with Flameshot. If not, see . -// Based on Lightscreen areadialog.h, Copyright 2017 Christian Kaiser -// released under the GNU GPL2 - -// Based on KDE's KSnapshot regiongrabber.cpp, revision 796531, Copyright 2007 Luca Gugelmann -// released under the GNU LGPL - #pragma once #include diff -Nru flameshot-0.6.0/translations/Internationalization_ca.ts flameshot-0.6.0+git20190714/translations/Internationalization_ca.ts --- flameshot-0.6.0/translations/Internationalization_ca.ts 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/translations/Internationalization_ca.ts 2019-07-14 16:21:21.000000000 +0000 @@ -57,7 +57,7 @@ - Sets the Arrow as the paint tool + Set the Arrow as the paint tool Estableix la fletxa com a eina de dibuix @@ -70,7 +70,7 @@ - Sets the Blur as the paint tool + Set Blur as the paint tool Estableix el desenfocament com a eina de dibuix @@ -101,29 +101,11 @@ - Sets the Circle as the paint tool + Set the Circle as the paint tool Estableix el cercle com a eina de dibuix - ColorPickerWidget - - - Active color: - - - - - Press ESC to cancel - - - - - Grab Color - - - - ConfigWindow @@ -178,7 +160,7 @@ - Copies the selection into the clipboard + Copy the selection into the clipboard @@ -402,94 +384,99 @@ - Uploads the selection to Imgur + Upload the selection to Imgur Puja la selecció a Imgur InfoWindow - + About Quant a - + Right Click Clic dret - + Mouse Wheel Roda del ratolí - + Move selection 1px Mou la selecció 1 px - + Resize selection 1px Redimensiona la selecció 1 px - + Quit capture Ix de la captura - + Copy to clipboard Copia al porta-retalls - + Save selection as a file Guarda la selecció com a fitxer - + Undo the last modification Desfés l'última modificació - + + Toggle visibility of sidebar with options of the selected tool + + + + Show color picker Mostra el selector de color - + Change the tool's thickness Canvia el gruix de l'eina - + Key Tecla - + Description Descripció - + <u><b>License</b></u> <u><b>Llicència</b></u> - + <u><b>Version</b></u> <u><b>Versió</b></u> - + <u><b>Shortcuts</b></u> <u><b>Dreceres</b></u> - + Available shortcuts in the screen capture mode. Dreceres disponibles en el mode de captura de pantalla. @@ -503,7 +490,7 @@ - Sets the Line as the paint tool + Set the Line as the paint tool Estableix la línia com a eina de dibuix @@ -516,7 +503,7 @@ - Sets the Marker as the paint tool + Set the Marker as the paint tool Estableix el marcador com a eina de dibuix @@ -542,7 +529,7 @@ - Sets the Pencil as the paint tool + Set the Pencil as the paint tool Estableix el llapis com a eina de dibuix @@ -611,7 +598,7 @@ - Sets the Rectangle as the paint tool + Set the Rectangle as the paint tool Estableix el rectangle com a eina de dibuix @@ -644,7 +631,7 @@ ScreenGrabber - + Unable to capture screen Imposible capturar la pantalla @@ -658,11 +645,34 @@ - Sets the Selection as the paint tool + Set Selection as the paint tool Estableix la selecció com a eina de dibuix + SidePanelWidget + + + Active thickness: + + + + + Active color: + + + + + Press ESC to cancel + + + + + Grab Color + + + + SizeIndicatorTool @@ -671,7 +681,7 @@ - Shows the dimensions of the selection (X Y) + Show the dimensions of the selection (X Y) Mostra les mides de la selecció (X Y) diff -Nru flameshot-0.6.0/translations/Internationalization_de_DE.ts flameshot-0.6.0+git20190714/translations/Internationalization_de_DE.ts --- flameshot-0.6.0/translations/Internationalization_de_DE.ts 1970-01-01 00:00:00.000000000 +0000 +++ flameshot-0.6.0+git20190714/translations/Internationalization_de_DE.ts 2019-07-14 16:21:21.000000000 +0000 @@ -0,0 +1,917 @@ + + + + + AppLauncher + + + App Launcher + Anwendungs Starter + + + + Choose an app to open the capture + Wähle eine Anwendung um die Auswahl zu öffnen + + + + AppLauncherWidget + + + Open With + Öffne mit + + + + Launch in terminal + Starte in der Konsole + + + + Keep open after selection + Nach Auswahl geöffnet lassen + + + + + Error + Fehler + + + + Unable to write in + Kein Schreibzugriff auf + + + + Unable to launch in terminal. + Kann im Terminal nicht geöffnet werden. + + + + ArrowTool + + + Arrow + Pfeil + + + + Set the Arrow as the paint tool + Wähle den Pfeil als Werkzeug + + + + BlurTool + + + Blur + Verwischen + + + + Set Blur as the paint tool + Wähle Verwischen als Werkzeug + + + + CaptureWidget + + + Unable to capture screen + Bereich kann nicht erfasst werden + + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + Wähle einen Bereich mit der Maus oder drücke ESC um zu beenden. +Drücke Eingabe um den Bereich aufzunehmen. +Drücke die rechte Maustacke um die Farbe auszuwählen. +Benutze das Mausrad um die Dicke des Werkzeugs auszuwählen. +Drücke die Leertaste um das Seitenmenü zu öffnen. + + + + CircleTool + + + Circle + Kreis + + + + Set the Circle as the paint tool + Wähle den Kreis als Werkzeug + + + + ConfigWindow + + + Configuration + Einstellungen + + + + Interface + Benutzeroberfläche + + + + Filename Editor + Dateinamen Editor + + + + General + Allgemein + + + + Controller + + + &Take Screenshot + &Bildschirmaufnahme anfertigen + + + + &Configuration + &Einstellungen + + + + &Information + &Informationen + + + + &Quit + &Beenden + + + + CopyTool + + + Copy + Kopieren + + + + Copy the selection into the clipboard + Auswahl in die Zwischenablage kopieren + + + + DBusUtils + + + Unable to connect via DBus + Kann nicht via DBus verbinden + + + + ExitTool + + + Exit + Beenden + + + + Leave the capture screen + Auswahl beenden + + + + FileNameEditor + + + Edit the name of your captures: + Bearbeite den Namen deiner Aufnahmen: + + + + Edit: + Bearbeite: + + + + Preview: + Vorschau: + + + + Save + Speichern + + + + Saves the pattern + Speichere die Vorlage + + + + Reset + Zurücksetzen + + + + Restores the saved pattern + Setzt die gespeicherte Vorlage zurück + + + + Clear + Löschen + + + + Deletes the name + Löscht den Namen + + + + GeneneralConf + + + + Import + Importieren + + + + + + Error + Fehler + + + + Unable to read file. + Datei kann nicht gelesen werden. + + + + + Unable to write file. + Datei kann nicht geschrieben werden. + + + + Save File + Datei speichern + + + + Confirm Reset + Zurücksetzen bestätigen + + + + Are you sure you want to reset the configuration? + Sind Sie sicher, dass sie die Konfiguration zurücksetzen wollen? + + + + Show help message + Hilfetext anzeigen + + + + Show the help message at the beginning in the capture mode. + Hilfetext am Start der Auswahl anzeigen. + + + + + Show desktop notifications + Zeige Desktopbenachrichtigungen + + + + Show tray icon + Zeige Taskleistensymbol + + + + Show the systemtray icon + Zeigt das Taskleistensymbol + + + + Configuration File + Konfigurationsdatei + + + + Export + Exportieren + + + + Reset + Zurücksetzen + + + + Launch at startup + Automatisch starten + + + + Launch Flameshot + Starte Flameshot + + + + ImgurUploader + + + Upload to Imgur + Zu Imgur hochladen + + + + Uploading Image + Bild hochladen + + + + Copy URL + URL kopieren + + + + Open URL + URL öffnen + + + + Delete image + Bild löschen + + + + Image to Clipboard. + Bild in Zwischenablage. + + + + + Unable to open the URL. + Kann URL nicht öffnen. + + + + URL copied to clipboard. + URL kopiert. + + + + Screenshot copied to clipboard. + Bildschirmaufnahme in Zwischenablage kopiert. + + + + ImgurUploaderTool + + + Image Uploader + Bild hochladen + + + + Upload the selection to Imgur + Auswahl zu Imgur hochladen + + + + InfoWindow + + + About + Über + + + + SPACEBAR + Leertaste + + + + Right Click + Rechtsklick + + + + Mouse Wheel + Mausrad + + + + Move selection 1px + Verschiebe Auswahl um 1px + + + + Resize selection 1px + Größenänderung um 1px + + + + Quit capture + Auswahl verlassen + + + + Copy to clipboard + In Zwischenablage kopieren + + + + Save selection as a file + Speichere Auswahl als Datei + + + + Undo the last modification + Letze Änderungen zurücksetzen + + + + Toggle visibility of sidebar with options of the selected tool + Öffne/Schließe Seitenauswahlmenü des gewählten Werkzeugs + + + + Show color picker + Zeige Farbauswahl + + + + Change the tool's thickness + Ändere die Dicke des Werkzeugs + + + + Available shortcuts in the screen capture mode. + Verfügbare Tastenkürzel im Aufnahmemodus. + + + + Key + Taste + + + + Description + Beschreibung + + + + <u><b>License</b></u> + <u><b>Lizenz</b></u> + + + + <u><b>Version</b></u> + <u><b>Version</b></u> + + + + <u><b>Shortcuts</b></u> + <u><b>Tastenkürzel</b></u> + + + + LineTool + + + Line + Linie + + + + Set the Line as the paint tool + Wähle Linie als Werkzeug + + + + MarkerTool + + + Marker + Markierer + + + + Set the Marker as the paint tool + Wähle den Markierer als Werkzeug + + + + MoveTool + + + Move + Bewege + + + + Move the selection area + Bewege den Auswahlbereich + + + + PencilTool + + + Pencil + Stift + + + + Set the Pencil as the paint tool + Wähle den Stift als Werkzeug + + + + PinTool + + + Pin Tool + Pinnwand Werkzeug + + + + Pin image on the desktop + Pinne Bild auf den Dekstop + + + + QObject + + + Save Error + Speicherfehler + + + + + Capture saved as + Aufnahme gespeichert als + + + + Capture saved to clipboard + Aufnahme in Zwischenablage gespeichert + + + + + Error trying to save as + Fehler beim Speichern unter + + + + + + + Unable to connect via DBus + Kann nicht via DBus verbinden + + + + Error + Fehler + + + + Unable to write in + Kein Schreibzugriff auf + + + + RectangleTool + + + Rectangle + Rechteck + + + + Set the Rectangle as the paint tool + Wähle ausgefülltes Rechteck als Werkzeug + + + + RedoTool + + + Redo + Wiederholen + + + + Redo the next modification + Wiederhole die nächste Veränderung + + + + SaveTool + + + Save + Speichern + + + + Save the capture + Speichere die Aufnahme + + + + ScreenGrabber + + + Unable to capture screen + Kann Bereich nicht aufnehmen + + + + SelectionTool + + + Rectangular Selection + Rechteckige Auswahl + + + + Set Selection as the paint tool + Wähle Rechteck als Werkzeug + + + + SidePanelWidget + + + Active thickness: + Aktuelle Dicke + + + + Active color: + Aktuelle Farbe: + + + + Press ESC to cancel + Drücke ESC für Abbruch + + + + Grab Color + Wähle Farbe + + + + SizeIndicatorTool + + + Selection Size Indicator + Auswahlgrößen Indentifikator + + + + Show the dimensions of the selection (X Y) + Zeige die Dimensionen der Auswahl (X Y) + + + + StrftimeChooserWidget + + + Century (00-99) + Jarhhundert (00-99) + + + + Year (00-99) + Jahr (00-99) + + + + Year (2000) + Jahr (2000) + + + + Month Name (jan) + Monatsname (Jan) + + + + Month Name (january) + Monatsname (Januar) + + + + Month (01-12) + Monat (01-12) + + + + Week Day (1-7) + Wochentag (1-7) + + + + Week (01-53) + Woche (01-53) + + + + Day Name (mon) + Tagesname (Mon) + + + + Day Name (monday) + Tagesname (Montag) + + + + Day (01-31) + Tag (01-31) + + + + Day of Month (1-31) + Tag des Monats (1-31) + + + + Day (001-366) + Tag (001-366) + + + + Time (%H-%M-%S) + Zeit (%H-%M-%S) + + + + Time (%H-%M) + Zeit (%H-%M) + + + + Hour (00-23) + Stunde (00-23) + + + + Hour (01-12) + Stunde (01-12) + + + + Minute (00-59) + Minute (00-59) + + + + Second (00-59) + Sekunde (00-59) + + + + Full Date (%m/%d/%y) + Komplettes Datum (%m/%d/%y) + + + + Full Date (%Y-%m-%d) + Komplettes Datum (%Y-%m-%d) + + + + SystemNotification + + + Flameshot Info + Flameshot Info + + + + TextConfig + + + StrikeOut + Durchstreichen + + + + Underline + Unterstrichen + + + + Bold + Fettdruck + + + + Italic + Kursiv + + + + TextTool + + + Text + Text + + + + Add text to your capture + Füge Text zur Auswahl hinzu + + + + UIcolorEditor + + + UI Color Editor + UI Farb Editor + + + + Change the color moving the selectors and see the changes in the preview buttons. + Ändere die Farbauswahl und betrachte die Vorschau in den Vorschau-Buttons. + + + + Select a Button to modify it + Wähle einen Button um ihn zu verändern + + + + Main Color + Hauptfarbe + + + + Click on this button to set the edition mode of the main color. + Wähle diesen Button um den Bearbeitungsmodus der Hauptfarbe zu wählen. + + + + Contrast Color + Kontrastfarbe + + + + Click on this button to set the edition mode of the contrast color. + Wähle diesen Button um den Bearbeitungsmodus der Kontrastfarbe zu wählen. + + + + UndoTool + + + Undo + Verwerfen + + + + Undo the last modification + Letzte Änderung verwerfen + + + + VisualsEditor + + + Opacity of area outside selection: + Deckkraft des Bereichs außerhalb der Auswahl: + + + + Button Selection + Button Auswahl + + + + Select All + Alle wählen + + + diff -Nru flameshot-0.6.0/translations/Internationalization_es.ts flameshot-0.6.0+git20190714/translations/Internationalization_es.ts --- flameshot-0.6.0/translations/Internationalization_es.ts 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/translations/Internationalization_es.ts 2019-07-14 16:21:21.000000000 +0000 @@ -57,7 +57,7 @@ - Sets the Arrow as the paint tool + Set the Arrow as the paint tool Establece la Flecha como herramienta de dibujo @@ -70,7 +70,7 @@ - Sets the Blur as the paint tool + Set Blur as the paint tool Establece el Desenfoque como herramienta de dibujo @@ -92,7 +92,7 @@ Presiona Enter para capturar la pantalla. Presion Click Derecho para mostrar el selector de color. Usa la rueda del ratón para cambiar el grosor de la herramienta. -Presiona Espacion para abrir el panel lateral. +Presiona Espacio para abrir el panel lateral. @@ -104,29 +104,11 @@ - Sets the Circle as the paint tool + Set the Circle as the paint tool Establece el Círculo como herramienta de dibujo - ColorPickerWidget - - - Active color: - Color activo: - - - - Press ESC to cancel - Presiona Esc para cancelar - - - - Grab Color - Tomar Color - - - ConfigWindow @@ -181,7 +163,7 @@ - Copies the selection into the clipboard + Copy the selection into the clipboard Copia la selección al portapapeles @@ -405,94 +387,99 @@ - Uploads the selection to Imgur + Upload the selection to Imgur Sube la selección a Imgur InfoWindow - + About Información - + Right Click Click Derecho - + Mouse Wheel Rueda del Ratón - + Move selection 1px Mueve la selección 1px - + Resize selection 1px Redimensiona la selección 1px - + Quit capture Salir de la captura - + Copy to clipboard Copiar al portapapeles - + Save selection as a file Guarda la selección como un archivo - + Undo the last modification Deshacer la última modificación - + + Toggle visibility of sidebar with options of the selected tool + + + + Show color picker Muestra el selector de color - + Change the tool's thickness Cambiar el grosor de la herramienta - + Available shortcuts in the screen capture mode. Atajos disponibles en el modo captura de pantalla. - + Key Tecla - + Description Descripción - + <u><b>License</b></u> <u><b>Licencia</b></u> - + <u><b>Version</b></u> <u><b>Versión</b></u> - + <u><b>Shortcuts</b></u> <u><b>Atajos</b></u> @@ -506,7 +493,7 @@ - Sets the Line as the paint tool + Set the Line as the paint tool Establece la Línea como herramienta de dibujo @@ -519,7 +506,7 @@ - Sets the Marker as the paint tool + Set the Marker as the paint tool Establece el Marcador como herramienta de dibujo @@ -545,7 +532,7 @@ - Sets the Pencil as the paint tool + Set the Pencil as the paint tool Establece el Lápiz como herramienta de dibujo @@ -614,7 +601,7 @@ - Sets the Rectangle as the paint tool + Set the Rectangle as the paint tool Establece el Rectángulo como herramienta de dibujo @@ -647,7 +634,7 @@ ScreenGrabber - + Unable to capture screen Imposible capturar la pantalla @@ -661,11 +648,34 @@ - Sets the Selection as the paint tool + Set Selection as the paint tool Establece la Selección como herramienta de dibujo + SidePanelWidget + + + Active thickness: + + + + + Active color: + Color activo: + + + + Press ESC to cancel + Presiona Esc para cancelar + + + + Grab Color + Tomar Color + + + SizeIndicatorTool @@ -674,7 +684,7 @@ - Shows the dimensions of the selection (X Y) + Show the dimensions of the selection (X Y) Muestra la dimensión de la selección (X Y) diff -Nru flameshot-0.6.0/translations/Internationalization_fr.ts flameshot-0.6.0+git20190714/translations/Internationalization_fr.ts --- flameshot-0.6.0/translations/Internationalization_fr.ts 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/translations/Internationalization_fr.ts 2019-07-14 16:21:21.000000000 +0000 @@ -57,7 +57,7 @@ - Sets the Arrow as the paint tool + Set the Arrow as the paint tool Sélectionner l'outil Flèche @@ -70,7 +70,7 @@ - Sets the Blur as the paint tool + Set Blur as the paint tool Sélectionner l'outil Flou @@ -88,7 +88,11 @@ Press Right Click to show the color picker. Use the Mouse Wheel to change the thickness of your tool. Press Space to open the side panel. - + Sélectionner une zone avec la souris ou appuyer sur Echap pour quitter +Appuyer sur Entrée pour capturer l'écran +Effectuer un clic droit pour afficher le sélecteur de couleurs. +Utiliser la molette de la souris pour changer l'épaisseur de l'outil. +Appuyer sur Espace pour ouvrir le panneau latéral. @@ -100,26 +104,26 @@ - Sets the Circle as the paint tool + Set the Circle as the paint tool Sélectionner l'outil Ellipse - ColorPickerWidget + SidePanelWidget - + Active color: - + Couleur actuelle: - + Press ESC to cancel - + Appuyer sur Echap pour annuler - + Grab Color - + Saisir la couleur @@ -177,8 +181,8 @@ - Copies the selection into the clipboard - + Copy the selection into the clipboard + Copier la sélection dans le presse-papier @@ -401,94 +405,99 @@ - Uploads the selection to Imgur + Upload the selection to Imgur Mettre en ligne la sélection vers Imgur InfoWindow - + About À propos - + Right Click Clic Droit - + Mouse Wheel Molette de la Souris - + Move selection 1px Déplacer la sélection 1px - + Resize selection 1px Redimensionner la sélection 1px - + Quit capture Quitter la capture d'écran - + Copy to clipboard Copier vers le Presse-papier - + Save selection as a file Sauvegarder la sélection vers un fichier - + Undo the last modification Annuler la dernière modification - + + Toggle visibility of sidebar with options of the selected tool + + + + Show color picker Afficher la palette de couleurs - + Change the tool's thickness Changer l'épaisseur des outils - + Available shortcuts in the screen capture mode. Raccourcis disponibles en mode capture d'écran. - + Key Clé - + Description Description - + <u><b>License</b></u> <u><b>Licences</b></u> - + <u><b>Version</b></u> <u><b>Version</b></u> - + <u><b>Shortcuts</b></u> <u><b>Raccourci</b></u> @@ -502,7 +511,7 @@ - Sets the Line as the paint tool + Set the Line as the paint tool Sélectionner l'outil Ligne @@ -515,7 +524,7 @@ - Sets the Marker as the paint tool + Set the Marker as the paint tool Sélectionner l'outil Surligneur @@ -541,7 +550,7 @@ - Sets the Pencil as the paint tool + Set the Pencil as the paint tool Sélectionner l'outil Crayon @@ -610,7 +619,7 @@ - Sets the Rectangle as the paint tool + Set the Rectangle as the paint tool Sélectionner l'outil Rectangle plein @@ -624,7 +633,7 @@ Redo the next modification - + Refaire la prochaine modification @@ -643,9 +652,9 @@ ScreenGrabber - + Unable to capture screen - Imposible de capturer l'écran + Imposible de capturer l'écran @@ -657,11 +666,34 @@ - Sets the Selection as the paint tool + Set Selection as the paint tool Sélectionner l'outil Rectangle + SidePanelWidget + + + Active thickness: + + + + + Active color: + + + + + Press ESC to cancel + + + + + Grab Color + + + + SizeIndicatorTool @@ -670,7 +702,7 @@ - Shows the dimensions of the selection (X Y) + Show the dimensions of the selection (X Y) Montre les dimmensions de la sélection (X Y) @@ -744,12 +776,12 @@ Time (%H-%M-%S) - + Heure (%H-%M-%S) Time (%H-%M) - + Heure (%H-%M) @@ -795,22 +827,22 @@ StrikeOut - + Rayer Underline - + Souligner Bold - + Gras Italic - + Italique @@ -818,12 +850,12 @@ Text - + Texte Add text to your capture - + Ajouter du texte à la capture diff -Nru flameshot-0.6.0/translations/Internationalization_hu.ts flameshot-0.6.0+git20190714/translations/Internationalization_hu.ts --- flameshot-0.6.0/translations/Internationalization_hu.ts 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/translations/Internationalization_hu.ts 2019-07-14 16:21:21.000000000 +0000 @@ -46,7 +46,7 @@ Nyíl - Sets the Arrow as the paint tool + Set the Arrow as the paint tool Beállítja a nyíl eszközt festő eszközként @@ -57,7 +57,7 @@ Homályosítás - Sets the Blur as the paint tool + Set Blur as the paint tool Beállítja a Homályosítás eszközt festő eszközként @@ -85,7 +85,7 @@ Kör - Sets the Circle as the paint tool + Set the Circle as the paint tool Beálítja a Kör eszközt festő eszközként @@ -318,7 +318,7 @@ Kép feltöltő - Uploads the selection to Imgur + Upload the selection to Imgur Feltölti a kiválasztott képet az Imgur -ra @@ -400,7 +400,7 @@ Vonal - Sets the Line as the paint tool + Set the Line as the paint tool Beállítja a Vonal eszközt festő eszközként @@ -411,7 +411,7 @@ Jelölő - Sets the Marker as the paint tool + Set the Marker as the paint tool Beállítja a Jelölő eszközt festő eszközként @@ -433,7 +433,7 @@ Ceruza - Sets the Pencil as the paint tool + Set the Pencil as the paint tool Beállítja a Ceruza eszközt festő eszközként @@ -476,7 +476,7 @@ Téglalap - Sets the Rectangle as the paint tool + Set the Rectangle as the paint tool Beállítja a Téglalap eszközt festő eszközként @@ -505,7 +505,7 @@ Téglalapos kijelölő - Sets the Selection as the paint tool + Set Selection as the paint tool Beállítja a Téglalapos kijelölő eszközt Festő eszközként @@ -516,7 +516,7 @@ Kiválasztott terület méretének indikátora - Shows the dimensions of the selection (X Y) + Show the dimensions of the selection (X Y) Mutatja a dimenzióját a kijelölésnek (X Y) diff -Nru flameshot-0.6.0/translations/Internationalization_ja.ts flameshot-0.6.0+git20190714/translations/Internationalization_ja.ts --- flameshot-0.6.0/translations/Internationalization_ja.ts 1970-01-01 00:00:00.000000000 +0000 +++ flameshot-0.6.0+git20190714/translations/Internationalization_ja.ts 2019-07-14 16:21:21.000000000 +0000 @@ -0,0 +1,912 @@ + + + + + AppLauncher + + + App Launcher + アプリケーションランチャー + + + + Choose an app to open the capture + キャプチャーを開くアプリケーションを選択する + + + + AppLauncherWidget + + + Open With + 次で開く + + + + Launch in terminal + 端末内で起動する + + + + Keep open after selection + 選択後も開いたままにする + + + + + Error + エラー + + + + Unable to launch in terminal. + 端末内で起動できません。 + + + + Unable to write in + 書き込めません: + + + + ArrowTool + + + Arrow + 矢印 + + + + Set the Arrow as the paint tool + ペイントツールとして「矢印」をセットする + + + + BlurTool + + + Blur + ぼかし + + + + Set Blur as the paint tool + ペイントツールとして「ぼかし」をセットする + + + + CaptureWidget + + + Unable to capture screen + 画面をキャプチャーできません + + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + マウスで領域を選択、Esc を押すと終了。 +Enter を押すと画面をキャプチャー。 +マウスの右ボタンでカラーピッカーを表示。 +マウスホイールでツールの太さ等を変更。 +スペースを押すとサイドパネルを開く。 + + + + CircleTool + + + Circle + 円形 + + + + Set the Circle as the paint tool + ペイントツールとして「円形」をセットする + + + + ConfigWindow + + + Configuration + 設定 + + + + Interface + インターフェース + + + + Filename Editor + ファイル名エディター + + + + General + 全般 + + + + Controller + + + &Take Screenshot + スクリーンショットを撮る(&T) + + + + &Configuration + 設定(&C) + + + + &Information + 情報(&I) + + + + &Quit + 終了(&Q) + + + + CopyTool + + + Copy + コピー + + + + Copy the selection into the clipboard + 選択範囲をクリップボードにコピーする + + + + DBusUtils + + + Unable to connect via DBus + DBus に接続できません + + + + ExitTool + + + Exit + 終了 + + + + Leave the capture screen + 画面キャプチャーを終了する + + + + FileNameEditor + + + Edit the name of your captures: + キャプチャー名の編集: + + + + Edit: + 編集: + + + + Preview: + プレビュー: + + + + Save + 保存 + + + + Saves the pattern + パターンを保存する + + + + Reset + リセット + + + + Restores the saved pattern + 保存されたパターンに戻す + + + + Clear + 消去 + + + + Deletes the name + 名前を削除する + + + + GeneneralConf + + + Show help message + ヘルプメッセージを表示する + + + + Show the help message at the beginning in the capture mode. + キャプチャーモード開始時にヘルプメッセージを表示する。 + + + + + Show desktop notifications + デスクトップの通知を表示する + + + + Show tray icon + トレイアイコンを表示する + + + + Show the systemtray icon + システムトレイアイコンを表示する + + + + + Import + インポート + + + + + + Error + エラー + + + + Unable to read file. + ファイルを読み込めません。 + + + + + Unable to write file. + ファイルに書き込めません。 + + + + Save File + ファイルを保存 + + + + Confirm Reset + リセットの確認 + + + + Are you sure you want to reset the configuration? + 設定をリセットしてもよろしいですか? + + + + Configuration File + 設定ファイル + + + + Export + エクスポート + + + + Reset + リセット + + + + Launch at startup + スタートアップ時に起動する + + + + Launch Flameshot + Flameshot を起動する + + + + ImgurUploader + + + Upload to Imgur + Imgur にアップロード + + + + Uploading Image + 画像をアップロード中 + + + + Copy URL + URL をコピー + + + + Open URL + URL を開く + + + + Delete image + 画像を削除 + + + + Image to Clipboard. + 画像をクリップボードへ。 + + + + + Unable to open the URL. + URL を開けません。 + + + + URL copied to clipboard. + URL をクリップボードにコピーしました。 + + + + Screenshot copied to clipboard. + スクリーンショットをクリップボードにコピーしました。 + + + + ImgurUploaderTool + + + Image Uploader + 画像アップローダー + + + + Upload the selection to Imgur + Imgur に選択範囲をアップロードする + + + + InfoWindow + + + About + このアプリケーションについて + + + + Right Click + 右クリック + + + + Mouse Wheel + マウスホイール + + + + Move selection 1px + 選択範囲を 1px 動かす + + + + Resize selection 1px + 選択範囲を 1px リサイズする + + + + Quit capture + キャプチャーを終了する + + + + Copy to clipboard + クリップボードにコピーする + + + + Save selection as a file + 選択範囲をファイルに保存する + + + + Undo the last modification + 最後の変更を元に戻す + + + + Toggle visibility of sidebar with options of the selected tool + + + + + Show color picker + カラーピッカーを表示する + + + + Change the tool's thickness + ツールの値 (太さや濃さ) を変更する + + + + Key + キー + + + + Description + 説明 + + + + <u><b>License</b></u> + <u><b>ライセンス</b></u> + + + + <u><b>Version</b></u> + <u><b>バージョン</b></u> + + + + <u><b>Shortcuts</b></u> + <u><b>ショートカット</b></u> + + + + Available shortcuts in the screen capture mode. + スクリーンキャプチャーモードで利用可能なショートカット。 + + + + LineTool + + + Line + 直線 + + + + Set the Line as the paint tool + ペイントツールとして「直線」をセットする + + + + MarkerTool + + + Marker + マーカー + + + + Set the Marker as the paint tool + ペイントツールとして「マーカー」をセットする + + + + MoveTool + + + Move + 移動 + + + + Move the selection area + 選択範囲を移動する + + + + PencilTool + + + Pencil + 鉛筆 + + + + Set the Pencil as the paint tool + ペイントツールとして「鉛筆」をセットする + + + + PinTool + + + Pin Tool + 固定ツール + + + + Pin image on the desktop + 選択範囲をデスクトップ上に配置する + + + + QObject + + + Save Error + 保存エラー + + + + + Capture saved as + キャプチャーを保存しました: + + + + Capture saved to clipboard + キャプチャーをクリップボードに保存しました + + + + + Error trying to save as + 保存時にエラーが発生しました: + + + + + + + Unable to connect via DBus + DBus に接続できません + + + + Error + エラー + + + + Unable to write in + 書き込めません: + + + + RectangleTool + + + Rectangle + 矩形 + + + + Set the Rectangle as the paint tool + ペイントツールとして「矩形」をセットする + + + + RedoTool + + + Redo + やり直し + + + + Redo the next modification + 次の変更にやり直す + + + + SaveTool + + + Save + 保存 + + + + Save the capture + キャプチャーを保存する + + + + ScreenGrabber + + + Unable to capture screen + 画面をキャプチャーできません + + + + SelectionTool + + + Rectangular Selection + 矩形選択 + + + + Set Selection as the paint tool + ペイントツールとして「矩形選択」をセットする + + + + SidePanelWidget + + + Active thickness: + + + + + Active color: + アクティブな色: + + + + Press ESC to cancel + ESC でキャンセル + + + + Grab Color + 色の取得 + + + + SizeIndicatorTool + + + Selection Size Indicator + 選択サイズインジケーター + + + + Show the dimensions of the selection (X Y) + 選択範囲の寸法 (X Y) を表示する + + + + StrftimeChooserWidget + + + Century (00-99) + 世紀 (00-99) + + + + Year (00-99) + 年 (00-99) + + + + Year (2000) + 年 (2000) + + + + Month Name (jan) + 月 (jan) + + + + Month Name (january) + 月 (january) + + + + Month (01-12) + 月 (01-12) + + + + Week Day (1-7) + 週日 (1-7) + + + + Week (01-53) + 週 (01-53) + + + + Day Name (mon) + 曜日 (月) + + + + Day Name (monday) + 曜日 (月曜日) + + + + Day (01-31) + 日 (01-31) + + + + Day of Month (1-31) + 日 (1-31) + + + + Day (001-366) + 日 (001-366) + + + + Time (%H-%M-%S) + 時刻 (%H-%M-%S) + + + + Time (%H-%M) + 時刻 (%H-%M) + + + + Hour (00-23) + 時 (00-23) + + + + Hour (01-12) + 時 (01-12) + + + + Minute (00-59) + 分 (00-59) + + + + Second (00-59) + 秒 (00-59) + + + + Full Date (%m/%d/%y) + 年月日 (%m/%d/%y) + + + + Full Date (%Y-%m-%d) + 年月日 (%Y-%m-%d) + + + + SystemNotification + + + Flameshot Info + Flameshot の情報 + + + + TextConfig + + + StrikeOut + 取り消し線 + + + + Underline + 下線 + + + + Bold + 太字 + + + + Italic + 斜体 + + + + TextTool + + + Text + テキスト + + + + Add text to your capture + キャプチャーにテキストを追加する + + + + UIcolorEditor + + + UI Color Editor + UI カラーエディター + + + + Change the color moving the selectors and see the changes in the preview buttons. + セレクターを動かして色を変更し、プレビューボタンの色がどう変化するか確認してください。 + + + + Select a Button to modify it + 変更するボタンを選択してください + + + + Main Color + メインカラー + + + + Click on this button to set the edition mode of the main color. + このボタンをクリックすると、メインカラーの編集モードをセットします。 + + + + Contrast Color + コントラストカラー + + + + Click on this button to set the edition mode of the contrast color. + このボタンをクリックすると、コントラストカラーの編集モードをセットします。 + + + + UndoTool + + + Undo + 元に戻す + + + + Undo the last modification + 最後の変更を元に戻す + + + + VisualsEditor + + + Opacity of area outside selection: + 選択範囲外の不透明度: + + + + Button Selection + ボタンの選択 + + + + Select All + すべて選択 + + + diff -Nru flameshot-0.6.0/translations/Internationalization_ka.ts flameshot-0.6.0+git20190714/translations/Internationalization_ka.ts --- flameshot-0.6.0/translations/Internationalization_ka.ts 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/translations/Internationalization_ka.ts 2019-07-14 16:21:21.000000000 +0000 @@ -57,7 +57,7 @@ - Sets the Arrow as the paint tool + Set the Arrow as the paint tool ისრის ხელსაწყოს არჩევა სახატავად @@ -70,7 +70,7 @@ - Sets the Blur as the paint tool + Set Blur as the paint tool გაბუნდოვნების ხელსაწყოს არჩევა სახატავად @@ -100,29 +100,11 @@ - Sets the Circle as the paint tool + Set the Circle as the paint tool წრის ხელსაწყოს არჩევა სახატავად - ColorPickerWidget - - - Active color: - - - - - Press ESC to cancel - - - - - Grab Color - - - - ConfigWindow @@ -177,7 +159,7 @@ - Copies the selection into the clipboard + Copy the selection into the clipboard @@ -401,94 +383,99 @@ - Uploads the selection to Imgur + Upload the selection to Imgur შერჩეულის Imgur-ზე ატვირთვა InfoWindow - + About პროგრამის შესახებ - + Right Click მაუსის მარჯვენა ღილაკი - + Mouse Wheel მაუსის გორგოლაჭი - + Move selection 1px შერჩეულის გადაადგილება 1px-ით - + Resize selection 1px შერჩეულის ზომის შეცვლა 1px-ით - + Quit capture გადაღებიდან გამოსვლა - + Copy to clipboard გაცვლის ბუფერში კოპირება - + Save selection as a file შერჩეულის ფაილად შენახვა - + Undo the last modification ბოლო ცვლილების გაუქმება - + + Toggle visibility of sidebar with options of the selected tool + + + + Show color picker ფერის შესარჩევის ჩვენება - + Change the tool's thickness ხელსაწყოს სისქის შეცვლა - + Available shortcuts in the screen capture mode. გადაღების რეჟიმში ხელმისაწვდომი მალსახმობები. - + Key კლავიში - + Description აღწერა - + <u><b>License</b></u> <u><b>ლიცენზია</b></u> - + <u><b>Version</b></u> <u><b>ვერსია</b></u> - + <u><b>Shortcuts</b></u> <u><b>მალსახმობები</b></u> @@ -502,7 +489,7 @@ - Sets the Line as the paint tool + Set the Line as the paint tool ხაზის ხელსაწყოს არჩევა სახატავად @@ -515,7 +502,7 @@ - Sets the Marker as the paint tool + Set the Marker as the paint tool მარკერის ხელსაწყოს არჩევა სახატავად @@ -541,7 +528,7 @@ - Sets the Pencil as the paint tool + Set the Pencil as the paint tool ფანქრის ხელსაწყოს არჩევა სახატავად @@ -610,7 +597,7 @@ - Sets the Rectangle as the paint tool + Set the Rectangle as the paint tool მართკუთხედის ხელსაწყოს არჩევა სახატავად @@ -643,7 +630,7 @@ ScreenGrabber - + Unable to capture screen ეკრანის გადაღება ვერ მოხერხდა @@ -657,11 +644,34 @@ - Sets the Selection as the paint tool + Set Selection as the paint tool შერჩევის ხელსაწყოს არჩევა სახატავად + SidePanelWidget + + + Active thickness: + + + + + Active color: + + + + + Press ESC to cancel + + + + + Grab Color + + + + SizeIndicatorTool @@ -670,7 +680,7 @@ - Shows the dimensions of the selection (X Y) + Show the dimensions of the selection (X Y) აჩვენებს შერჩეული არის განზომილებებს (X Y) diff -Nru flameshot-0.6.0/translations/Internationalization_nl.ts flameshot-0.6.0+git20190714/translations/Internationalization_nl.ts --- flameshot-0.6.0/translations/Internationalization_nl.ts 1970-01-01 00:00:00.000000000 +0000 +++ flameshot-0.6.0+git20190714/translations/Internationalization_nl.ts 2019-07-14 16:21:21.000000000 +0000 @@ -0,0 +1,913 @@ + + + + + AppLauncher + + + App Launcher + App-starter + + + + Choose an app to open the capture + Kies een app om de schermafdruk mee te openen + + + + AppLauncherWidget + + + Open With + Openen met + + + + Launch in terminal + Openen in terminalvenster + + + + Keep open after selection + Openhouden na selectie + + + + + Error + Fout + + + + Unable to write in + Kan niet schrijven naar + + + + Unable to launch in terminal. + Kan niet openen in terminalvenster. + + + + ArrowTool + + + Arrow + Cursor + + + + Set the Arrow as the paint tool + Cursor instellen als verfgereedschap + + + + BlurTool + + + Blur + Vervaging + + + + Set Blur as the paint tool + Vervaging instellen als verfgereedschap + + + + CaptureWidget + + + Unable to capture screen + Kan scherm niet vastleggen + + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + Selecteer een gebied met de cursor of druk op Esc om af te sluiten. +Druk op Enter om het scherm vast te leggen. +Klik met de rechtermuisknop om de kleurkiezer te tonen. +Gebruik het muiswiel om de gereedschapsdikte aan te passen. +Druk op spatie om het zijpaneel te openen. + + + + CircleTool + + + Circle + Cirkel + + + + Set the Circle as the paint tool + Cirkel instellen als verfgereedschap + + + + ConfigWindow + + + Configuration + Configuratie + + + + Interface + Uiterlijk + + + + Filename Editor + Bestandsnaambewerker + + + + General + Algemeen + + + + Controller + + + &Take Screenshot + Schermafdruk &maken + + + + &Configuration + &Configuratie + + + + &Information + &Informatie + + + + &Quit + &Afsluiten + + + + CopyTool + + + Copy + Kopiëren + + + + Copy the selection into the clipboard + Selectie kopiëren naar klembord + + + + DBusUtils + + + Unable to connect via DBus + Kan niet verbinden via DBus + + + + ExitTool + + + Exit + Afsluiten + + + + Leave the capture screen + Verlaat het vastlegscherm + + + + FileNameEditor + + + Edit the name of your captures: + Bewerk de naam van je schermafdrukken: + + + + Edit: + Bewerken: + + + + Preview: + Voorbeeld: + + + + Save + Opslaan + + + + Saves the pattern + Slaat het patroon op + + + + Reset + Standaardwaarden + + + + Restores the saved pattern + Herstelt het standaardpatroon + + + + Clear + Wissen + + + + Deletes the name + Wist de naam + + + + GeneneralConf + + + + Import + Importeren + + + + + + Error + Fout + + + + Unable to read file. + Kan bestand niet uitlezen. + + + + + Unable to write file. + Kan bestand niet wegschrijven. + + + + Save File + Bestand opslaan + + + + Confirm Reset + Herstellen bevestigen + + + + Are you sure you want to reset the configuration? + Weet je zeker dat je de standwaardwaarden van de configuratie wilt herstellen? + + + + Show help message + Uitleg tonen + + + + Show the help message at the beginning in the capture mode. + Toont een bericht met uitleg bij het openen van de vastlegmodus. + + + + + Show desktop notifications + Bureaubladmeldingen tonen + + + + Show tray icon + Systeemvakpictogram tonen + + + + Show the systemtray icon + Toont het systeemvakpictogram + + + + Configuration File + Configuratiebestand + + + + Export + Exporteren + + + + Reset + Standaardwaarden + + + + Launch at startup + Automatisch opstarten + + + + Launch Flameshot + Flameshot openen + + + + ImgurUploader + + + Upload to Imgur + Uploaden naar Imgur + + + + Uploading Image + Bezig met uploaden van afbeelding... + + + + Copy URL + URL kopiëren + + + + Open URL + URL openen + + + + Delete image + Afbeelding verwijderen + + + + Image to Clipboard. + Afbeelding naar klembord. + + + + + Unable to open the URL. + Kan URL niet openen. + + + + URL copied to clipboard. + URL gekopieerd naar klembord. + + + + Screenshot copied to clipboard. + Schermafdruk gekopieerd naar klembord. + + + + ImgurUploaderTool + + + Image Uploader + Afbeeldingsuploader + + + + Upload the selection to Imgur + Upload de selectie naar Imgur + + + + InfoWindow + + + About + Over + + + + Right Click + Rechtsklikken + + + + Mouse Wheel + Muiswiel + + + + Move selection 1px + Selectie 1px verplaatsen + + + + Resize selection 1px + Afmetingen van selectie 1px aanpassen + + + + Quit capture + Vastleggen afsluiten + + + + Copy to clipboard + Kopiëren naar klembord + + + + Save selection as a file + Selectie opslaan als bestand + + + + Undo the last modification + Laatste wijziging ongedaan maken + + + + Toggle visibility of sidebar with options of the selected tool + Zijbalk met gereedschapsopties tonen/verbergen + + + + Show color picker + Kleurkiezer tonen + + + + Change the tool's thickness + Wijzig de gereedschapsdikte + + + + Available shortcuts in the screen capture mode. + Beschikbare sneltoetsen in de vastlegmodus. + + + + Key + Toets + + + + Description + Omschrijving + + + + <u><b>License</b></u> + <u><b>Лиценца</b></u> + + + + <u><b>Version</b></u> + <u><b>Верзија</b></u> + + + + <u><b>Shortcuts</b></u> + <u><b>Пречице</b></u> + + + + LineTool + + + Line + Lijn + + + + Set the Line as the paint tool + Lijn instellen als verfgereedschap + + + + MarkerTool + + + Marker + Markeerstift + + + + Set the Marker as the paint tool + Markeerstift instellen als verfgereedschap + + + + MoveTool + + + Move + Verplaatsen + + + + Move the selection area + Selectiegebied verplaatsen + + + + PencilTool + + + Pencil + Potlood + + + + Set the Pencil as the paint tool + Potlood instellen als verfgereedschap + + + + PinTool + + + Pin Tool + Vastmaken + + + + Pin image on the desktop + Afbeelding vastmaken op bureaublad + + + + QObject + + + Save Error + Fout tijdens opslaan + + + + + Capture saved as + Schermafdruk opgeslagen als + + + + Capture saved to clipboard + Schermafdruk vastgelegd op klembord + + + + + Error trying to save as + Fout tijdens opslaan als + + + + + + + Unable to connect via DBus + Kan niet verbinden via DBus + + + + Error + Fout + + + + Unable to write in + Kan niet wegschrijven naar + + + + RectangleTool + + + Rectangle + Rechthoek + + + + Set the Rectangle as the paint tool + Rechthoek instellen als verfgereedschap + + + + RedoTool + + + Redo + Opnieuw + + + + Redo the next modification + Volgende wijziging opnieuw toepassen + + + + SaveTool + + + Save + Сачувај + Opslaan + + + + Save the capture + Schermafdruk opslaan + + + + ScreenGrabber + + + Unable to capture screen + Kan scherm niet vastleggen + + + + SelectionTool + + + Rectangular Selection + Rechthoekige selectie + + + + Set Selection as the paint tool + Selectie instellen als verfgereedschap + + + + SidePanelWidget + + + Active thickness: + Actieve dikte: + + + + Active color: + Actieve kleur: + + + + Press ESC to cancel + Druk op Esc om te annuleren + + + + Grab Color + Kleur opnemen + + + + SizeIndicatorTool + + + Selection Size Indicator + Grootteindicatie van selectie + + + + Show the dimensions of the selection (X Y) + Toon de afmetingen van de selectie (X Y) + + + + StrftimeChooserWidget + + + Century (00-99) + Eeuw (00-99) + + + + Year (00-99) + Jaar (00-99) + + + + Year (2000) + Jaar (2000) + + + + Month Name (jan) + Naam van de maand (јаn) + + + + Month Name (january) + Naam van de maand (јаnuari) + + + + Month (01-12) + Maand (01-12) + + + + Week Day (1-7) + Weekdag (1-7) + + + + Week (01-53) + Week (01-53) + + + + Day Name (mon) + Naam van de dag (ma) + + + + Day Name (monday) + Naam van de dag (maandag) + + + + Day (01-31) + Dag (01-31) + + + + Day of Month (1-31) + Dag van de maand (1-31) + + + + Day (001-366) + Dag (001-366) + + + + Time (%H-%M-%S) + Tijd (%H-%M-%S) + + + + Time (%H-%M) + Tijd (%H-%M) + + + + Hour (00-23) + Uur (00-23) + + + + Hour (01-12) + Uur (01-12) + + + + Minute (00-59) + Minuten (00-59) + + + + Second (00-59) + Seconden (00-59) + + + + Full Date (%m/%d/%y) + Volledige datum (%m/%d/%y) + + + + Full Date (%Y-%m-%d) + Volledige datum (%Y-%m-%d) + + + + SystemNotification + + + Flameshot Info + Flameshot-informatie + + + + TextConfig + + + StrikeOut + Doorhalen + + + + Underline + Onderstrepen + + + + Bold + Vetgedrukt + + + + Italic + Cursief + + + + TextTool + + + Text + Tekst + + + + Add text to your capture + Voeg tekst toe aan je schermafdruk + + + + UIcolorEditor + + + UI Color Editor + Kleurenschemabewerker + + + + Change the color moving the selectors and see the changes in the preview buttons. + Wijzig de kleur d.m.v. de selectie-indicators en bekijk de wijzigingen op de voorbeeldknoppen. + + + + Select a Button to modify it + Kies een te bewerken knop + + + + Main Color + Hoofdkleur + + + + Click on this button to set the edition mode of the main color. + Klik op deze knop om de hoofdkleur te bwerken. + + + + Contrast Color + Contrastkleur + + + + Click on this button to set the edition mode of the contrast color. + Klik op deze knop om de contrastkleur te bewerken. + + + + UndoTool + + + Undo + Ongedaan mken + + + + Undo the last modification + Laatste wijziging ongedaan maken + + + + VisualsEditor + + + Opacity of area outside selection: + Doorzichtigheid van gebied buiten selectie: + + + + Button Selection + Knopselectie + + + + Select All + Alles selecteren + + + diff -Nru flameshot-0.6.0/translations/Internationalization_pl.ts flameshot-0.6.0+git20190714/translations/Internationalization_pl.ts --- flameshot-0.6.0/translations/Internationalization_pl.ts 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/translations/Internationalization_pl.ts 2019-07-14 16:21:21.000000000 +0000 @@ -57,7 +57,7 @@ - Sets the Arrow as the paint tool + Set the Arrow as the paint tool Rysowanie strzałek @@ -70,7 +70,7 @@ - Sets the Blur as the paint tool + Set Blur as the paint tool Rozmywanie obszarów @@ -103,29 +103,11 @@ - Sets the Circle as the paint tool + Set the Circle as the paint tool Rysowanie okręgów i elips - ColorPickerWidget - - - Active color: - Aktywny kolor: - - - - Press ESC to cancel - Wciśnij ESC, aby anulować - - - - Grab Color - Pobierz kolor - - - ConfigWindow @@ -180,7 +162,7 @@ - Copies the selection into the clipboard + Copy the selection into the clipboard @@ -404,94 +386,99 @@ - Uploads the selection to Imgur + Upload the selection to Imgur Wyślij zaznaczenie do Imgur InfoWindow - + About O programie - + Right Click Prawy klik - + Mouse Wheel Kółko myszy - + Move selection 1px Przesuń zaznaczenie o 1px - + Resize selection 1px Zmień rozmiar zaznaczenia o 1px - + Quit capture Zakończ przechwytywanie - + Copy to clipboard Kopiuj do schowka - + Save selection as a file Zapisz zaznaczenie jako plik - + Undo the last modification Cofnij ostatnią modyfikację - + + Toggle visibility of sidebar with options of the selected tool + + + + Show color picker Pokaż próbnik kolorów - + Change the tool's thickness Zmień grubość narzędzia - + Available shortcuts in the screen capture mode. Dostępne skróty w trybie przechwytywania obrazu. - + Key Klawisz - + Description Działanie - + <u><b>License</b></u> <u><b>Licencja</b></u> - + <u><b>Version</b></u> <u><b>Wersja</b></u> - + <u><b>Shortcuts</b></u> <u><b>Skróty klawiszowe</b></u> @@ -505,7 +492,7 @@ - Sets the Line as the paint tool + Set the Line as the paint tool Ustawia linię jako narzędzie do rysowania @@ -518,7 +505,7 @@ - Sets the Marker as the paint tool + Set the Marker as the paint tool Ustawia Marker jako narzędzie rysowania @@ -544,7 +531,7 @@ - Sets the Pencil as the paint tool + Set the Pencil as the paint tool Ustawia ołówek jako narzędzie do rysowania @@ -613,7 +600,7 @@ - Sets the Rectangle as the paint tool + Set the Rectangle as the paint tool Ustawia prostokąt jako narzędzie do rysowania @@ -646,7 +633,7 @@ ScreenGrabber - + Unable to capture screen Nie można przechwycić ekranu @@ -660,11 +647,34 @@ - Sets the Selection as the paint tool + Set Selection as the paint tool Ustawia zaznaczenie prostokątne jako narzędzie do rysowania + SidePanelWidget + + + Active thickness: + + + + + Active color: + Aktywny kolor: + + + + Press ESC to cancel + Wciśnij ESC, aby anulować + + + + Grab Color + Pobierz kolor + + + SizeIndicatorTool @@ -673,7 +683,7 @@ - Shows the dimensions of the selection (X Y) + Show the dimensions of the selection (X Y) Pokazuje wymiary zaznaczenia (X Y) diff -Nru flameshot-0.6.0/translations/Internationalization_pt_br.ts flameshot-0.6.0+git20190714/translations/Internationalization_pt_br.ts --- flameshot-0.6.0/translations/Internationalization_pt_br.ts 1970-01-01 00:00:00.000000000 +0000 +++ flameshot-0.6.0+git20190714/translations/Internationalization_pt_br.ts 2019-07-14 16:21:21.000000000 +0000 @@ -0,0 +1,912 @@ + + + + + AppLauncher + + + App Launcher + App Launcher + + + + Choose an app to open the capture + Escolha uma aplicação para abrir a captura + + + + AppLauncherWidget + + + Open With + Abrir Com + + + + Launch in terminal + Abrir no terminal + + + + Keep open after selection + Manter aberto após seleção + + + + + Error + Erro + + + + Unable to write in + Não é possível escrever em + + + + Unable to launch in terminal. + Não foi possível abrir no terminal. + + + + ArrowTool + + + Arrow + Flecha + + + + Set the Arrow as the paint tool + Usa a Flecha como ferramenta de desenho + + + + BlurTool + + + Blur + Desfoque + + + + Set Blur as the paint tool + Usa o Desfoque como ferramenta de desenho + + + + CaptureWidget + + + Unable to capture screen + Não foi possível capturar a tela + + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + Selecione uma área com o mouse, ou precione Esc para sair. +Pressione Enter para capturar a tela. +Pressione o botão direito do mouse para abrir o seletor de cores. +Use a roda do mouse para aumentar a grossura do pincel. +Pressione espaço abrir o painel lateral. + + + + CircleTool + + + Circle + Círculo + + + + Set the Circle as the paint tool + Usa o Círculo como ferramenta de desenho + + + + ConfigWindow + + + Configuration + Configuração + + + + Interface + Interface + + + + Filename Editor + Editor de nome de arquivo + + + + General + Geral + + + + Controller + + + &Take Screenshot + &Tirar Screenshot + + + + &Configuration + &Configuração + + + + &Information + &Informações + + + + &Quit + &Sair + + + + CopyTool + + + Copy + Copiar + + + + Copy the selection into the clipboard + Copia a seleção para o clipboard + + + + DBusUtils + + + Unable to connect via DBus + Não foi possível conectar via DBus + + + + ExitTool + + + Exit + Sair + + + + Leave the capture screen + Sair da ferramenta de captura + + + + FileNameEditor + + + Edit the name of your captures: + Edite o nome das suas capturas: + + + + Edit: + Editar: + + + + Preview: + Preview: + + + + Save + Salvar + + + + Saves the pattern + Salva o padrão + + + + Reset + Reiniciar + + + + Restores the saved pattern + Restaura o padrão salvo + + + + Clear + Limpar + + + + Deletes the name + Deleta o nome + + + + GeneneralConf + + + + Import + Importar + + + + + + Error + Erro + + + + Unable to read file. + Não foi possível ler o arquivo. + + + + + Unable to write file. + Não foi possível escrever no arquivo. + + + + Save File + Salvar Arquivo + + + + Confirm Reset + Confirmar Reset + + + + Are you sure you want to reset the configuration? + Tem certeza que deseja resetar a configuração? + + + + Show help message + Mostrar mensagem de ajuda + + + + Show the help message at the beginning in the capture mode. + Mostrar mensagem de ajuda no início do modo de captura. + + + + + Show desktop notifications + Mostrar notificações de Desktop + + + + Show tray icon + Mostrar ícone de tray + + + + Show the systemtray icon + Mosrar ícone na barra de aplicações + + + + Configuration File + Arquivo de Configurações + + + + Export + Exportar + + + + Reset + Reset + + + + Launch at startup + Iniciar junto com o sistema + + + + Launch Flameshot + Iniciar Flameshot + + + + ImgurUploader + + + Upload to Imgur + Upload no Imgur + + + + Uploading Image + Upando Imagem + + + + Copy URL + Copiar URL + + + + Open URL + Abrir URL + + + + Delete image + Deletar imagem + + + + Image to Clipboard. + Imagem no Clipboard. + + + + + Unable to open the URL. + Não foi possível abrir a URL. + + + + URL copied to clipboard. + URL copiada para o clipboard. + + + + Screenshot copied to clipboard. + Screenshot copiada para o clipboard. + + + + ImgurUploaderTool + + + Image Uploader + Uploader de imagens + + + + Upload the selection to Imgur + Upa a seleção no Imgur + + + + InfoWindow + + + About + Sobre + + + + Right Click + Botão Direito + + + + Mouse Wheel + Roda do mouse + + + + Move selection 1px + Move a seleção em 1px + + + + Resize selection 1px + Redimensiona a seleção em 1px + + + + Quit capture + Sair da captura + + + + Copy to clipboard + Copiar ao clipboard + + + + Save selection as a file + Salva seleção em um arquivo + + + + Undo the last modification + Desfazer última modificação + + + + Toggle visibility of sidebar with options of the selected tool + + + + + Show color picker + Mostra seletor de cores + + + + Change the tool's thickness + Muda a grossura do pincel + + + + Available shortcuts in the screen capture mode. + Atalhos disponívels na tela de captura. + + + + Key + Tecla + + + + Description + Descrição + + + + <u><b>License</b></u> + <u><b>Licença</b></u> + + + + <u><b>Version</b></u> + <u><b>Versão</b></u> + + + + <u><b>Shortcuts</b></u> + <u><b>Atalhos</b></u> + + + + LineTool + + + Line + Linha + + + + Set the Line as the paint tool + Usa a Linha como ferramenta de desenho + + + + MarkerTool + + + Marker + Marcador + + + + Set the Marker as the paint tool + Usa o marcador como ferramenta de desenho + + + + MoveTool + + + Move + Mover + + + + Move the selection area + Move a área de seleção + + + + PencilTool + + + Pencil + Pincel + + + + Set the Pencil as the paint tool + Usa o Lápis como ferramenta de desenho + + + + PinTool + + + Pin Tool + Ferramenta de Pin + + + + Pin image on the desktop + Pinnar imagem no desktop + + + + QObject + + + Save Error + Salvar erro + + + + + Capture saved as + Captura salva como + + + + Capture saved to clipboard + Captura salva no clipboard + + + + + Error trying to save as + Erro tentando salvar como + + + + + + + Unable to connect via DBus + Não foi possível conectar via DBus + + + + Error + Erro + + + + Unable to write in + Não foi possível escrever em + + + + RectangleTool + + + Rectangle + Retângulo + + + + Set the Rectangle as the paint tool + Seta o Retângulo como ferramenta de desenho + + + + RedoTool + + + Redo + Refazer + + + + Redo the next modification + Refazer última modificação + + + + SaveTool + + + Save + Salvar + + + + Save the capture + Salva a captura + + + + ScreenGrabber + + + Unable to capture screen + Não foi possível capturar a tela + + + + SelectionTool + + + Rectangular Selection + Seleção Retangular + + + + Set Selection as the paint tool + Estabelece o Selecionador como ferramenta de desenho + + + + SidePanelWidget + + + Active thickness: + + + + + Active color: + Cor ativa: + + + + Press ESC to cancel + Presione Esc para cancelar + + + + Grab Color + Usar Cor + + + + SizeIndicatorTool + + + Selection Size Indicator + Indicador do Tamanho da Seleção + + + + Show the dimensions of the selection (X Y) + Mostra a dimensão da seleção (X Y) + + + + StrftimeChooserWidget + + + Century (00-99) + Século (00-99) + + + + Year (00-99) + Ano (00-99) + + + + Year (2000) + Ano (2000) + + + + Month Name (jan) + Nome do mês (jan) + + + + Month Name (january) + Nome do mês (janeiro) + + + + Month (01-12) + Mês (01-12) + + + + Week Day (1-7) + Dia da semana (1-7) + + + + Week (01-53) + Semana (01-53) + + + + Day Name (mon) + Nome do dia (seg) + + + + Day Name (monday) + Nome do dia (segunda) + + + + Day (01-31) + Dia (01-31) + + + + Day of Month (1-31) + Dia do Mês (1-31) + + + + Day (001-366) + Dia (001-366) + + + + Time (%H-%M-%S) + Tempo (%H-%M-%S) + + + + Time (%H-%M) + Tempo (%H-%M) + + + + Hour (00-23) + Hora (00-23) + + + + Hour (01-12) + Hora (01-12) + + + + Minute (00-59) + Minuto (00-59) + + + + Second (00-59) + Segundo (00-59) + + + + Full Date (%m/%d/%y) + Data Completa (%m/%d/%y) + + + + Full Date (%Y-%m-%d) + Data Completa (%Y-%m-%d) + + + + SystemNotification + + + Flameshot Info + Informações do Flameshot + + + + TextConfig + + + StrikeOut + Sobrescrito + + + + Underline + Sublinhado + + + + Bold + Negrito + + + + Italic + Itálico + + + + TextTool + + + Text + Texto + + + + Add text to your capture + Adicionar texto à captura + + + + UIcolorEditor + + + UI Color Editor + Interface de Edição de Cores + + + + Change the color moving the selectors and see the changes in the preview buttons. + Modifique a cor movendo os seletores e veja as mudanças nos botões de preview. + + + + Select a Button to modify it + Selecione um botão para modificá-lo + + + + Main Color + Cor Principal + + + + Click on this button to set the edition mode of the main color. + Clique neste botão para setar o modo de edição da cor principal. + + + + Contrast Color + Cor de Contraste + + + + Click on this button to set the edition mode of the contrast color. + Clique neste botão para setar o modo de edição da cor de contraste. + + + + UndoTool + + + Undo + Desfazer + + + + Undo the last modification + Desfaz a última modificação + + + + VisualsEditor + + + Opacity of area outside selection: + Opacidade da área de seleção: + + + + Button Selection + Botão de seleção + + + + Select All + Selecionar Todos + + + diff -Nru flameshot-0.6.0/translations/Internationalization_ru.ts flameshot-0.6.0+git20190714/translations/Internationalization_ru.ts --- flameshot-0.6.0/translations/Internationalization_ru.ts 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/translations/Internationalization_ru.ts 2019-07-14 16:21:21.000000000 +0000 @@ -57,7 +57,7 @@ - Sets the Arrow as the paint tool + Set the Arrow as the paint tool Выбрать Стрелку инструментом для рисования @@ -70,7 +70,7 @@ - Sets the Blur as the paint tool + Set Blur as the paint tool Выбрать Размытие инструментом для рисования @@ -88,7 +88,11 @@ Press Right Click to show the color picker. Use the Mouse Wheel to change the thickness of your tool. Press Space to open the side panel. - + Выберите область с помощью мыши или нажмите Esc чтобы выйти. +Нажмите Enter чтобы захватить экран. +Нажмите правую кнопку мыши чтобы показать выбор цвета. +Используйте колесо мыши чтобы выбрать толщину текущего инструмента. +Нажмите Пробел чтобы открыть боковую панель. @@ -100,29 +104,11 @@ - Sets the Circle as the paint tool + Set the Circle as the paint tool Выбрать Окружность инструментом для рисования - ColorPickerWidget - - - Active color: - - - - - Press ESC to cancel - - - - - Grab Color - - - - ConfigWindow @@ -150,7 +136,7 @@ &Take Screenshot - + &Сделать снимок @@ -177,8 +163,8 @@ - Copies the selection into the clipboard - + Copy the selection into the clipboard + Скопировать выделение в буфер обмена @@ -368,7 +354,7 @@ Delete image - + Удалить изображение @@ -401,94 +387,99 @@ - Uploads the selection to Imgur + Upload the selection to Imgur Загрузить выделение на Imgur InfoWindow - + About Информация - + Right Click - ПКМ + Правый клик - + Mouse Wheel Колесико мыши - + Move selection 1px Переместить выделение на 1px - + Resize selection 1px Изменить размер выделения на 1px - + Quit capture Выйти из захвата экрана - + Copy to clipboard Скопировать в буфер обмена - + Save selection as a file Сохранить выделение в файл - + Undo the last modification Отменить последнее изменение - + + Toggle visibility of sidebar with options of the selected tool + Показать боковую панель с настройками выбранного инструмента + + + Show color picker Показать выбор цвета - + Change the tool's thickness Изменить толщину инструмента - + Available shortcuts in the screen capture mode. Доступные горячие клавиши в режиме захвата экрана. - + Key Клавиша - + Description Описание - + <u><b>License</b></u> <u><b>Лицензия</b></u> - + <u><b>Version</b></u> <u><b>Версия</b></u> - + <u><b>Shortcuts</b></u> <u><b>Горячие клавиши</b></u> @@ -502,7 +493,7 @@ - Sets the Line as the paint tool + Set the Line as the paint tool Выбрать Линию инструментом для рисования @@ -515,7 +506,7 @@ - Sets the Marker as the paint tool + Set the Marker as the paint tool Выбрать Маркер инструментом для рисования @@ -541,7 +532,7 @@ - Sets the Pencil as the paint tool + Set the Pencil as the paint tool Выбрать Карандаш инструментом для рисования @@ -550,12 +541,12 @@ Pin Tool - + Булавка Pin image on the desktop - + Прикрепить изображение к рабочему столу @@ -569,12 +560,12 @@ Capture saved as - Сохранить снимок как + Снимок сохранён как Capture saved to clipboard - + Снимок сохранён в буфер обмена @@ -610,7 +601,7 @@ - Sets the Rectangle as the paint tool + Set the Rectangle as the paint tool Выбрать Прямоугольник инструментом для рисования @@ -619,12 +610,12 @@ Redo - + Повторить Redo the next modification - + Повторить последнее изменение @@ -643,9 +634,9 @@ ScreenGrabber - + Unable to capture screen - Не удалось захватить экран + Не удалось захватить экран @@ -657,11 +648,34 @@ - Sets the Selection as the paint tool + Set Selection as the paint tool Выбрать Прямоугольное выделение инструментом для рисования + SidePanelWidget + + + Active thickness: + Активная толщина: + + + + Active color: + Активный цвет: + + + + Press ESC to cancel + Нажмите Esc для отмены + + + + Grab Color + Захватить цвет с экрана + + + SizeIndicatorTool @@ -670,7 +684,7 @@ - Shows the dimensions of the selection (X Y) + Show the dimensions of the selection (X Y) Показывает размер выделения (X Y) @@ -744,12 +758,12 @@ Time (%H-%M-%S) - + Время (%H-%M-%S) Time (%H-%M) - + Время (%H-%M) @@ -787,7 +801,7 @@ Flameshot Info - + Flameshot Инфо @@ -795,22 +809,22 @@ StrikeOut - + Зачеркнутый Underline - + Подчеркнутый Bold - + Полужирный Italic - + Курсив @@ -818,12 +832,12 @@ Text - + Текст Add text to your capture - + Добавить текст на снимок diff -Nru flameshot-0.6.0/translations/Internationalization_sk.ts flameshot-0.6.0+git20190714/translations/Internationalization_sk.ts --- flameshot-0.6.0/translations/Internationalization_sk.ts 1970-01-01 00:00:00.000000000 +0000 +++ flameshot-0.6.0+git20190714/translations/Internationalization_sk.ts 2019-07-14 16:21:21.000000000 +0000 @@ -0,0 +1,981 @@ + + + + + AppLauncher + + + App Launcher + Spúšťač aplikácií + + + + Choose an app to open the capture + Vyberte aplikáciu na otvorenie snímky obrazovky + + + + AppLauncherWidget + + + Open With + Otvoriť s + + + + Launch in terminal + Otvoriť v termináli + + + + Keep open after selection + Nechať otvorené po výbere + + + + + Error + Chyba + + + + Unable to write in + Zlyhal zápis do + + + + Unable to launch in terminal. + Nepodarilo sa spustiť v termináli. + + + + ArrowTool + + + Arrow + Šípka + + + + Set the Arrow as the paint tool + Nastaviť Šípku ako nástroj pre úpravy + + + + BlurTool + + + Blur + Rozmazanie + + + + Set Blur as the paint tool + Nastaviť Rozmazanie ako nástroj pre úpravy + + + + CaptureLauncher + + + <b>Capture Mode</b> + <b>Režim zachytávania</b> + + + + Rectangular Region + Pravouhlá oblasť + + + + Full Screen (All Monitors) + Celá obrazovka (všetky monitory) + + + + No Delay + Bez oneskorenia + + + + second + sekunda + + + + seconds + sekundy + + + + Take new screenshot + Urobiť novú snímku + + + + Area: + Oblasť: + + + + Delay: + Oneskorenie: + + + + CaptureWidget + + + Unable to capture screen + Nepodarilo sa zachytiť obrazovku + + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + Vyberte oblasť snímania pomocou myši alebo stlačte Esc pre ukončenie. +Stlačte Enter pre zachytenie obrazovky. +Kliknite pravým tlačidlom pre zobrazenie nástroja pre výber farby. +Použite kolečko myši pre zmenu hrúbky vybraného nástroja. +Stlačte medzerník pre otvorenie postranného panelu. + + + + CircleTool + + + Circle + Kruh + + + + Set the Circle as the paint tool + + + + + ConfigWindow + + + Configuration + Konfigurácia + + + + Interface + Interfejs + + + + Filename Editor + Editor názvov súborov + + + + General + Všeobecné + + + + Controller + + + &Take Screenshot + &Vytvoriť snímku + + + + &Open Launcher + + + + + &Configuration + &Konfigurácia + + + + &Information + &Informácie + + + + &Quit + &Ukončiť + + + + CopyTool + + + Copy + Kopírovať + + + + Copy the selection into the clipboard + Kopírovať výber do schránky + + + + DBusUtils + + + Unable to connect via DBus + Nie je možné pripojiť sa prostredníctvom DBus + + + + ExitTool + + + Exit + Ukončiť + + + + Leave the capture screen + Opustiť obrazovku so zachytávaním obrazovky + + + + FileNameEditor + + + Edit the name of your captures: + Upraviť meno vašich snímok obrazovky: + + + + Edit: + Upraviť: + + + + Preview: + Náhľad: + + + + Save + Uložiť + + + + Saves the pattern + Uloží vzor + + + + Reset + Resetovať + + + + Restores the saved pattern + Vráti zmeny + + + + Clear + Vyčistiť + + + + Deletes the name + Vymaže meno + + + + GeneneralConf + + + + Import + Importovať + + + + + + Error + Chyba + + + + Unable to read file. + Zlyhalo čítanie súboru. + + + + + Unable to write file. + Zlyhal zápis do súboru. + + + + Save File + Uložiť súbor + + + + Confirm Reset + Potvrdiť Reset + + + + Are you sure you want to reset the configuration? + Naozaj si želáte resetovať aktuálnu konfiguráciu? + + + + Show help message + Zobraziť nápovedu + + + + Show the help message at the beginning in the capture mode. + Zobraziť nápovedu na začiatku počas režimu zachytávania obrazovky. + + + + + Show desktop notifications + Zobraziť systémové upozornenia + + + + Show tray icon + Zobraziť stavovú ikonu + + + + Show the systemtray icon + Zobraziť ikonu v stavovej oblasti + + + + Configuration File + Súbor s konfiguráciou + + + + Export + Exportovať + + + + Reset + Resetovať + + + + Launch at startup + Spúšťať pri štarte + + + + Launch Flameshot + Spustiť Flameshot + + + + Close after capture + Zavrieť po vytvorení snímky + + + + Close after taking a screenshot + Zatvoriť po vytvorení snímky obrazovky + + + + ImgurUploader + + + Upload to Imgur + Nahrať na Imgur + + + + Uploading Image + Nahrávam obrázok + + + + Copy URL + Kopírovať URL + + + + Open URL + Otvoriť URL + + + + Delete image + Vymazať obrázok + + + + Image to Clipboard. + Obrázok do schránky. + + + + + Unable to open the URL. + Nepodarilo sa otvoriť URL. + + + + URL copied to clipboard. + URL skopírovaná do schránky. + + + + Screenshot copied to clipboard. + Snímka obrazovky bola skopírovaná do schránky. + + + + ImgurUploaderTool + + + Image Uploader + Uploader obrázkov + + + + Upload the selection to Imgur + Nahrať výber na Imgur + + + + InfoWindow + + + About + O programe + + + + SPACEBAR + MEDZERNÍK + + + + Right Click + Kliknutie pravým tlačidlom + + + + Mouse Wheel + Kolečko myši + + + + Move selection 1px + Presunúť výber o 1 px + + + + Resize selection 1px + Zmeniť rozmery výberu o 1 px + + + + Quit capture + Ukončiť zachytávanie obrazovky + + + + Copy to clipboard + Kopírovať do schránky + + + + Save selection as a file + Zapísať výber do súboru + + + + Undo the last modification + Vrátiť poslednú úpravu + + + + Toggle visibility of sidebar with options of the selected tool + Prepnúť viditeľnosť bočnej lišty s možnosťami vybraného nástroja + + + + Show color picker + Zobraziť dialóg na výber farby + + + + Change the tool's thickness + Zmena hrúbky nástroja + + + + Available shortcuts in the screen capture mode. + Dostupné klávesové skratky v režime zachytávania obrazovky. + + + + Key + Kláves + + + + Description + Popis + + + + <u><b>License</b></u> + <u><b>Licencia</b></u> + + + + <u><b>Version</b></u> + <u><b>Verzia</b></u> + + + + <u><b>Shortcuts</b></u> + <u><b>Klávesové skratky</b></u> + + + + LineTool + + + Line + Čiara + + + + Set the Line as the paint tool + Nastaviť Čiaru ako nástroj pre úpravy + + + + MarkerTool + + + Marker + Fixka + + + + Set the Marker as the paint tool + Nastaviť Fixku ako nástroj pre úpravy + + + + MoveTool + + + Move + Presun + + + + Move the selection area + Presunúť oblasť výberu + + + + PencilTool + + + Pencil + Ceruzka + + + + Set the Pencil as the paint tool + Nastaviť Ceruzku ako nástroj pre úpravy + + + + PinTool + + + Pin Tool + Špendlík + + + + Pin image on the desktop + Pripnúť obrázok na plochu + + + + QObject + + + + + + + Unable to connect via DBus + Nie je možné pripojiť sa prostredníctvom DBus + + + + Error + Chyba + + + + Unable to write in + Zlyhal zápis do + + + + Capture saved to clipboard + Snímka uložená do schránky + + + + + Capture saved as + Snímka uložená ako + + + + + Error trying to save as + Chyba pri ukladaní do + + + + Save Error + Chyba pri ukladaní + + + + RectangleTool + + + Rectangle + Obdĺžnik + + + + Set the Rectangle as the paint tool + Nastaviť Obdĺžnik ako nástroj pre úpravy + + + + RedoTool + + + Redo + Znova + + + + Redo the next modification + Zopakovať úpravu + + + + SaveTool + + + Save + Uložiť + + + + Save the capture + Uložiť snímku obrazovky + + + + ScreenGrabber + + + Unable to capture screen + Nepodarilo sa zachytiť obrazovku + + + + SelectionTool + + + Rectangular Selection + Obdĺžnikový výber + + + + Set Selection as the paint tool + Nastaviť Výber ako nástroj pre úpravy + + + + SidePanelWidget + + + Active thickness: + Aktívna hrúbka: + + + + Active color: + Aktívna farba: + + + + Press ESC to cancel + Stlačte ESC pre zrušenie + + + + Grab Color + Snímať farbu + + + + SizeIndicatorTool + + + Selection Size Indicator + Ukazovateľ veľkosti výberu + + + + Show the dimensions of the selection (X Y) + Zobraziť rozmery výberu (X Y) + + + + StrftimeChooserWidget + + + Century (00-99) + Storočie (00-99) + + + + Year (00-99) + Rok (00-99) + + + + Year (2000) + Rok (2000) + + + + Month Name (jan) + Meno mesiaca (jan) + + + + Month Name (january) + Meno mesiaca (január) + + + + Month (01-12) + Mesiac (01-12) + + + + Week Day (1-7) + Deň v týždni (1-7) + + + + Week (01-53) + Týždeň (01-53) + + + + Day Name (mon) + Meno dňa (pon) + + + + Day Name (monday) + Meno dňa (pondelok) + + + + Day (01-31) + Deň (01-31) + + + + Day of Month (1-31) + Deň v mesiaci (1-31) + + + + Day (001-366) + Deň (001-366) + + + + Time (%H-%M-%S) + Čas (%H-%M-%S) + + + + Time (%H-%M) + Čas (%H-%M) + + + + Hour (00-23) + Hodina (00-23) + + + + Hour (01-12) + Hodina (01-12) + + + + Minute (00-59) + Minúta (00-59) + + + + Second (00-59) + Sekunda (00-59) + + + + Full Date (%m/%d/%y) + Celý dátum (%m/%d/%y) + + + + Full Date (%Y-%m-%d) + Celý dátum (%Y-%m-%d) + + + + SystemNotification + + + Flameshot Info + Informácie o programe Flameshot + + + + TextConfig + + + StrikeOut + Preškrtnuté + + + + Underline + Podčiarknuté + + + + Bold + Tučné + + + + Italic + Kurzíva + + + + TextTool + + + Text + Text + + + + Add text to your capture + Pridať text do snímky + + + + UIcolorEditor + + + UI Color Editor + Editor farieb interfejsu + + + + Change the color moving the selectors and see the changes in the preview buttons. + Presunom bežcov nastavte farbu a sledujte tieto zmeny v náhľade. + + + + Select a Button to modify it + Kliknite na tlačidlo pre jeho úpravu + + + + Main Color + Hlavná farba + + + + Click on this button to set the edition mode of the main color. + Pre nastavenie hlavnej farby kliknite na toto tlačidlo. + + + + Contrast Color + Kontrastná farba + + + + Click on this button to set the edition mode of the contrast color. + Pre nastavenie kontrastnej farby kliknite na toto tlačidlo. + + + + UndoTool + + + Undo + Späť + + + + Undo the last modification + Vrátiť poslednú úpravu + + + + VisualsEditor + + + Opacity of area outside selection: + Priehľadnosť oblasti mimo výberu: + + + + Button Selection + Výber tlačidiel + + + + Select All + Vybrať všetky + + + diff -Nru flameshot-0.6.0/translations/Internationalization_sr.ts flameshot-0.6.0+git20190714/translations/Internationalization_sr.ts --- flameshot-0.6.0/translations/Internationalization_sr.ts 1970-01-01 00:00:00.000000000 +0000 +++ flameshot-0.6.0+git20190714/translations/Internationalization_sr.ts 2019-07-14 16:21:21.000000000 +0000 @@ -0,0 +1,913 @@ + + + + + AppLauncher + + + App Launcher + Покретач + + + + Choose an app to open the capture + Изаберите програм у ком желите да отворите снимак + + + + AppLauncherWidget + + + Open With + Отвори помоћу + + + + Launch in terminal + Покрени у терминалу + + + + Keep open after selection + Остави отворено након избора + + + + + Error + Грешка + + + + Unable to write in + Нисам успео да сачувам + + + + Unable to launch in terminal. + Нисам успео да покренем у терминалу. + + + + ArrowTool + + + Arrow + Стрелица + + + + Set the Arrow as the paint tool + Избор цртања стрелице + + + + BlurTool + + + Blur + Замућење + + + + Set Blur as the paint tool + Избор цртања замућене области + + + + CaptureWidget + + + Unable to capture screen + Нисам успео да снимим екран + + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + Изаберите област мишем или притисните Esc за излаз. +Притисните Enter за снимак целог екрана. +Десним кликом миша бирате боју. +Можете користити точкић миша за избор дебљине алатки. +Притисните размак на тастатури за приказ помоћног панела. + + + + CircleTool + + + Circle + Круг + + + + Set the Circle as the paint tool + Избор цртања круга + + + + ConfigWindow + + + Configuration + Подешавања + + + + Interface + Изглед + + + + Filename Editor + Избор имена датотеке + + + + General + Опште + + + + Controller + + + &Take Screenshot + &Направи снимак екрана + + + + &Configuration + &Подешавања + + + + &Information + Ин&формације + + + + &Quit + &Излаз + + + + CopyTool + + + Copy + Запамти + + + + Copy the selection into the clipboard + Копира избор у привремену оставу + + + + DBusUtils + + + Unable to connect via DBus + Нисам успео да се повежем кроз DBus + + + + ExitTool + + + Exit + Излаз + + + + Leave the capture screen + Напусти екран за снимање + + + + FileNameEditor + + + Edit the name of your captures: + Уређивање имена снимака: + + + + Edit: + Уређивање: + + + + Preview: + Преглед: + + + + Save + Сачувај + + + + Saves the pattern + Сачувај шаблон + + + + Reset + Ресетуј + + + + Restores the saved pattern + Поврати сачувани шаблон + + + + Clear + Очисти + + + + Deletes the name + Брише име + + + + GeneneralConf + + + + Import + Увоз + + + + + + Error + Грешка + + + + Unable to read file. + Нисам успео да прочитам датотеку. + + + + + Unable to write file. + Нисам успео да сачувам датотеку. + + + + Save File + Сачувај датотеку + + + + Confirm Reset + Потврда поништавања + + + + Are you sure you want to reset the configuration? + Да ли сте сигурни да желите да поништите сва прилагођена подешавања? + + + + Show help message + Приказуј поруку са упутством + + + + Show the help message at the beginning in the capture mode. + Приказуј поруку са кратким упутством на почетку снимања екрана. + + + + + Show desktop notifications + Користи системска обавештења + + + + Show tray icon + Иконица на системској полици + + + + Show the systemtray icon + Приказуј иконицу на системској полици + + + + Configuration File + Датотека са подешавањима + + + + Export + Извоз + + + + Reset + Поништи + + + + Launch at startup + Покрени на почетку + + + + Launch Flameshot + Покрени Flameshot + + + + ImgurUploader + + + Upload to Imgur + Објави на Imgur + + + + Uploading Image + Објављујем слику + + + + Copy URL + Запамти интернет адресу + + + + Open URL + Посети интернет адресу + + + + Delete image + Избриши слику + + + + Image to Clipboard. + Сачувај у привремену меморију. + + + + + Unable to open the URL. + Нисам успео да посетим интернет адресу. + + + + URL copied to clipboard. + Интернет адреса је сачувана у привременој меморији. + + + + Screenshot copied to clipboard. + Слика је сачувана у привременој меморији. + + + + ImgurUploaderTool + + + Image Uploader + Објављивање слике + + + + Upload the selection to Imgur + Објави избор на Imgur сајту + + + + InfoWindow + + + About + О програму + + + + Right Click + Десни клик + + + + Mouse Wheel + Точкић миша + + + + Move selection 1px + Помери избор за 1px + + + + Resize selection 1px + Увећај избор за 1px + + + + Quit capture + Излаз из снимача екрана + + + + Copy to clipboard + Запамти у привременој меморији + + + + Save selection as a file + Сачувај избор у датотеку + + + + Undo the last modification + Поништи последње измене + + + + Toggle visibility of sidebar with options of the selected tool + + + + + Show color picker + Прикажи избор боје + + + + Change the tool's thickness + Измени дебљину линије алата + + + + Available shortcuts in the screen capture mode. + Доступне пречице у моду снимка екрана. + + + + Key + Тастер + + + + Description + Опис + + + + <u><b>License</b></u> + <u><b>Лиценца</b></u> + + + + <u><b>Version</b></u> + <u><b>Верзија</b></u> + + + + <u><b>Shortcuts</b></u> + <u><b>Пречице</b></u> + + + + LineTool + + + Line + Линија + + + + Set the Line as the paint tool + Избор цртања линије + + + + MarkerTool + + + Marker + Маркер + + + + Set the Marker as the paint tool + Избор цртања маркером + + + + MoveTool + + + Move + Премештање + + + + Move the selection area + Премешта изабрану област + + + + PencilTool + + + Pencil + Оловка + + + + Set the Pencil as the paint tool + Избор цртања оловком + + + + PinTool + + + Pin Tool + Закачка + + + + Pin image on the desktop + Закачи слику за радну површину + + + + QObject + + + Save Error + Грешка приликом упусивања + + + + + Capture saved as + Сачувај снимак као + + + + Capture saved to clipboard + Снимак је сачуван у привремену меморију + + + + + Error trying to save as + Грешка приликом уписивања као + + + + + + + Unable to connect via DBus + Нисам успео да се повежем кроз DBus + + + + Error + Грешка + + + + Unable to write in + Нисам успео са сачувам + + + + RectangleTool + + + Rectangle + Правоугаоник + + + + Set the Rectangle as the paint tool + Избор цртања обојеног правоугаоника + + + + RedoTool + + + Redo + Понови + + + + Redo the next modification + Понови поништену измену + + + + SaveTool + + + Save + Сачувај + Сохранить + + + + Save the capture + Сачувај снимак + + + + ScreenGrabber + + + Unable to capture screen + Нисам успео да снимим екран + + + + SelectionTool + + + Rectangular Selection + Правоугаони оквир + + + + Set Selection as the paint tool + Избор цртања правоугаоног оквира + + + + SidePanelWidget + + + Active thickness: + + + + + Active color: + Активна боја: + + + + Press ESC to cancel + Притисните ESC за прекид + + + + Grab Color + Преузмите боју + + + + SizeIndicatorTool + + + Selection Size Indicator + Приказ величине избора + + + + Show the dimensions of the selection (X Y) + Приказује величину избора (X Y) + + + + StrftimeChooserWidget + + + Century (00-99) + Век (00-99) + + + + Year (00-99) + Година (00-99) + + + + Year (2000) + Година (2000) + + + + Month Name (jan) + Име месеца (јан) + + + + Month Name (january) + Име месеца (јануар) + + + + Month (01-12) + Месец (01-12) + + + + Week Day (1-7) + Дани у недељи (1-7) + + + + Week (01-53) + Недеља (01-53) + + + + Day Name (mon) + Дан у недељи (пон) + + + + Day Name (monday) + Дан у недељи (понедељак) + + + + Day (01-31) + Дан (01-31) + + + + Day of Month (1-31) + Дан месеца (1-31) + + + + Day (001-366) + Дан (001-366) + + + + Time (%H-%M-%S) + Време (%H-%M-%S) + + + + Time (%H-%M) + Време (%H-%M) + + + + Hour (00-23) + Сат (00-23) + + + + Hour (01-12) + Сат (01-12) + + + + Minute (00-59) + Минута (00-59) + + + + Second (00-59) + Секунда (00-59) + + + + Full Date (%m/%d/%y) + Комплетан датум (%m/%d/%y) + + + + Full Date (%Y-%m-%d) + Комплетан датум (%Y-%m-%d) + + + + SystemNotification + + + Flameshot Info + Информације о Flameshot-у + + + + TextConfig + + + StrikeOut + Прецртано + + + + Underline + Подвучено + + + + Bold + Задебљано + + + + Italic + Накошено + + + + TextTool + + + Text + Текст + + + + Add text to your capture + Додаје текст на снимак + + + + UIcolorEditor + + + UI Color Editor + Уређивање боје сучеља + + + + Change the color moving the selectors and see the changes in the preview buttons. + Измените боју померањем изборника и видите резултат у прегледу дугмића. + + + + Select a Button to modify it + Изаберите дугме да би га изменили + + + + Main Color + Основна боја + + + + Click on this button to set the edition mode of the main color. + Кликните на дугме да би прешли у режим уређивања основне боје. + + + + Contrast Color + Боја контраста + + + + Click on this button to set the edition mode of the contrast color. + Кликните на дугме да би прешли у режим уређивања боје контраста. + + + + UndoTool + + + Undo + Поништи + + + + Undo the last modification + Поништи последњу измену + + + + VisualsEditor + + + Opacity of area outside selection: + Провидност подручја ван избора: + + + + Button Selection + Избор дугмића + + + + Select All + Изабери све + + + diff -Nru flameshot-0.6.0/translations/Internationalization_tr.ts flameshot-0.6.0+git20190714/translations/Internationalization_tr.ts --- flameshot-0.6.0/translations/Internationalization_tr.ts 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/translations/Internationalization_tr.ts 2019-07-14 16:21:21.000000000 +0000 @@ -57,7 +57,7 @@ - Sets the Arrow as the paint tool + Set the Arrow as the paint tool Oku çizim aracı olarak ayarlar @@ -70,7 +70,7 @@ - Sets the Blur as the paint tool + Set Blur as the paint tool Bulnıklığı boyama aracı olarak ayarlar @@ -104,29 +104,11 @@ - Sets the Circle as the paint tool + Set the Circle as the paint tool Çemberi boyama aracı olarak ayarlar - ColorPickerWidget - - - Active color: - Aktif Renk: - - - - Press ESC to cancel - Çıkmak için ESC'ye tıklayın - - - - Grab Color - - - - ConfigWindow @@ -181,7 +163,7 @@ - Copies the selection into the clipboard + Copy the selection into the clipboard Seçimi panoya kopyalar @@ -405,94 +387,99 @@ - Uploads the selection to Imgur + Upload the selection to Imgur Seçimi Imgur'a yükler InfoWindow - + About Hakkında - + Right Click Sağ Tık - + Mouse Wheel Fare Tekerleği - + Move selection 1px 1px seçimini hareket ettir - + Resize selection 1px 1px seçimini yeniden boyutlandır - + Quit capture Çıkış - + Copy to clipboard Panoya kopyala - + Save selection as a file Seçimi dosya olarak kaydet - + Undo the last modification Son değişikliği geri al - + + Toggle visibility of sidebar with options of the selected tool + + + + Show color picker Renk seçici göster - + Change the tool's thickness Araç kalınlığını değiştirin - + Available shortcuts in the screen capture mode. Ekran yakalama modunda kullanılabilir kısayollar. - + Key Anahtar - + Description Tanım - + <u><b>License</b></u> <u><b>Lisans</b></u> - + <u><b>Version</b></u> <u><b>Sürüm</b></u> - + <u><b>Shortcuts</b></u> <u><b>Kısayollar</b></u> @@ -506,7 +493,7 @@ - Sets the Line as the paint tool + Set the Line as the paint tool Çizgiyi boyama aracı olarak ayarlar @@ -519,7 +506,7 @@ - Sets the Marker as the paint tool + Set the Marker as the paint tool İşaretleyiciyi boyama aracı olarak ayarlar @@ -545,7 +532,7 @@ - Sets the Pencil as the paint tool + Set the Pencil as the paint tool Kurşun Kalemi çizim aracı olarak ayarlar @@ -614,7 +601,7 @@ - Sets the Rectangle as the paint tool + Set the Rectangle as the paint tool Dikdörtgeni boyama aracı olarak ayarlar @@ -647,7 +634,7 @@ ScreenGrabber - + Unable to capture screen Ekran resmi alınamadı @@ -661,11 +648,34 @@ - Sets the Selection as the paint tool + Set Selection as the paint tool Seçimi boyama aracı olarak ayarlar + SidePanelWidget + + + Active thickness: + + + + + Active color: + Aktif Renk: + + + + Press ESC to cancel + Çıkmak için ESC'ye tıklayın + + + + Grab Color + + + + SizeIndicatorTool @@ -674,7 +684,7 @@ - Shows the dimensions of the selection (X Y) + Show the dimensions of the selection (X Y) Seçimin boyutlarını gösterir (X Y) diff -Nru flameshot-0.6.0/translations/Internationalization_uk.ts flameshot-0.6.0+git20190714/translations/Internationalization_uk.ts --- flameshot-0.6.0/translations/Internationalization_uk.ts 1970-01-01 00:00:00.000000000 +0000 +++ flameshot-0.6.0+git20190714/translations/Internationalization_uk.ts 2019-07-14 16:21:21.000000000 +0000 @@ -0,0 +1,912 @@ + + + + + AppLauncher + + + App Launcher + Запуск програми + + + + Choose an app to open the capture + Виберіть програму, щоб відкрити знімок + + + + AppLauncherWidget + + + Open With + Відкрити у + + + + Launch in terminal + Запустити у терміналі + + + + Keep open after selection + Не закривати після вибору + + + + + Error + Помилка + + + + Unable to write in + Не вдалось записати + + + + Unable to launch in terminal. + Не вдалось запустити у терміналі. + + + + ArrowTool + + + Arrow + Стрілка + + + + Set the Arrow as the paint tool + Вибрати стрілку інструментом малювання + + + + BlurTool + + + Blur + Розмиття + + + + Set Blur as the paint tool + Вибрати розмиття інструментом малювання + + + + CaptureWidget + + + Unable to capture screen + Не вдалось захопити екран + + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + Виберіть область мишкою або натисніть Esc для виходу. +Натисніть Enter щоб захопити екран. +Натисніть праву кнопку миші, щоб показати вибір кольору. +Використовуйте колесо миші для зміни товщини вибраного інструменту. +Натисніть Пробіл, щоб відкрити бічну панель. + + + + CircleTool + + + Circle + Коло + + + + Set the Circle as the paint tool + Вибрати коло інструментом малювання + + + + ConfigWindow + + + Configuration + Налаштування + + + + Interface + Інтерфейс + + + + Filename Editor + Редактор імені файлів + + + + General + Загальне + + + + Controller + + + &Take Screenshot + &Зробити знімок + + + + &Configuration + &Налаштування + + + + &Information + &Інформація + + + + &Quit + Ви&йти + + + + CopyTool + + + Copy + Копіювати + + + + Copy the selection into the clipboard + Копіювати вибране до буферу обміну + + + + DBusUtils + + + Unable to connect via DBus + Не вдалось підключитись через DBus + + + + ExitTool + + + Exit + Вийти + + + + Leave the capture screen + Вийти із захоплення екрану + + + + FileNameEditor + + + Edit the name of your captures: + Відредагуйте ім'я ваших знімків: + + + + Edit: + Шаблон: + + + + Preview: + Перегляд: + + + + Save + Зберегти + + + + Saves the pattern + Зберегти шаблон + + + + Reset + Скинути + + + + Restores the saved pattern + Відновлює збережений шаблон + + + + Clear + Очистити + + + + Deletes the name + Видаляє ім'я + + + + GeneneralConf + + + + Import + Імпорт + + + + + + Error + Помилка + + + + Unable to read file. + Не вдалось прочитати файл. + + + + + Unable to write file. + Не вдалось записати файл. + + + + Save File + Зберегти файл + + + + Confirm Reset + Підтвердити скидання + + + + Are you sure you want to reset the configuration? + Ви дійсно хочете скинути налаштування? + + + + Show help message + Показувати повідомлення довідки + + + + Show the help message at the beginning in the capture mode. + Показувати повідомлення довідки на початку режиму захоплення. + + + + + Show desktop notifications + Показувати повідомлення + + + + Show tray icon + Показувати значок на панелі + + + + Show the systemtray icon + Показувати значок на панелі повідомленнь + + + + Configuration File + Файл налаштувань + + + + Export + Експорт + + + + Reset + Скинути + + + + Launch at startup + Запускати при старті системи + + + + Launch Flameshot + Запускати Flameshot + + + + ImgurUploader + + + Upload to Imgur + Вивантажити до Imgur + + + + Uploading Image + Вивантаження зображення + + + + Copy URL + Скопіювати URL + + + + Open URL + Відкрити URL + + + + Delete image + Видалити зображення + + + + Image to Clipboard. + Зображення до буферу обміну. + + + + + Unable to open the URL. + Не вдалось відкрити URL. + + + + URL copied to clipboard. + URL скопійовано до буферу обміну. + + + + Screenshot copied to clipboard. + Знімок скопійовано до буферу обміну. + + + + ImgurUploaderTool + + + Image Uploader + Вивантаження зображень + + + + Upload the selection to Imgur + Вивантажити вибране до Imgur + + + + InfoWindow + + + About + Про... + + + + Right Click + Права кнопка миші + + + + Mouse Wheel + Колесо миші + + + + Move selection 1px + Перемістити виділення на 1px + + + + Resize selection 1px + Змінити розмір виділення на 1px + + + + Quit capture + Вийти із захоплення екрану + + + + Copy to clipboard + Копіювати до буферу обміну + + + + Save selection as a file + Зберегти вибране до файлу + + + + Undo the last modification + Скасувати останню зміну + + + + Toggle visibility of sidebar with options of the selected tool + Переключити видимість бічної панелі + + + + Show color picker + Показати вибір кольору + + + + Change the tool's thickness + Змінити товщину інструменту + + + + Available shortcuts in the screen capture mode. + Доступні комбінації клавіш у режимі захоплення екрану. + + + + Key + Клавіша + + + + Description + Опис + + + + <u><b>License</b></u> + <u><b>Ліцензія</b></u> + + + + <u><b>Version</b></u> + <u><b>Версія</b></u> + + + + <u><b>Shortcuts</b></u> + <u><b>Комбінації клавіш</b></u> + + + + LineTool + + + Line + Лінія + + + + Set the Line as the paint tool + Вибрати лінію інструментом малювання + + + + MarkerTool + + + Marker + Маркер + + + + Set the Marker as the paint tool + Вибрати маркер інструментом малювання + + + + MoveTool + + + Move + Переміщення + + + + Move the selection area + Перемістити вибір + + + + PencilTool + + + Pencil + Олівець + + + + Set the Pencil as the paint tool + Вибрати олівець інструментом малювання + + + + PinTool + + + Pin Tool + Прикріплення + + + + Pin image on the desktop + Прикріпити зображення до робочого столу + + + + QObject + + + Save Error + Помилка збереження + + + + + Capture saved as + Знімок збережено як + + + + Capture saved to clipboard + Знімок збережено до буферу обміну + + + + + Error trying to save as + Помилка під час збереження як + + + + + + + Unable to connect via DBus + Не вдалось підключитись через DBus + + + + Error + Помилка + + + + Unable to write in + Не вдалось зберегти + + + + RectangleTool + + + Rectangle + Прямокутник + + + + Set the Rectangle as the paint tool + Вибрати прямокутник інструментом малювання + + + + RedoTool + + + Redo + Повторити + + + + Redo the next modification + Повторити наступну зміну + + + + SaveTool + + + Save + Зберегти + + + + Save the capture + Зберегти знімок + + + + ScreenGrabber + + + Unable to capture screen + Не вдалось захопити екран + + + + SelectionTool + + + Rectangular Selection + Прямокутне виділення + + + + Set Selection as the paint tool + Вибрати прямокутне виділення інструментом малювання + + + + SidePanelWidget + + + Active thickness: + Активна товщина: + + + + Active color: + Активний колір: + + + + Press ESC to cancel + Натисніть Esc для скасування + + + + Grab Color + Визначити колір з екрану + + + + SizeIndicatorTool + + + Selection Size Indicator + Індикатор розміру виділення + + + + Show the dimensions of the selection (X Y) + Показує розмір виділення (X Y) + + + + StrftimeChooserWidget + + + Century (00-99) + Століття (00-99) + + + + Year (00-99) + Рік (00-99) + + + + Year (2000) + Рік (2000) + + + + Month Name (jan) + Назва місяця (січ) + + + + Month Name (january) + Назва місяця (січень) + + + + Month (01-12) + Місяць (01-12) + + + + Week Day (1-7) + День тижня (1-7) + + + + Week (01-53) + Тиждень (01-53) + + + + Day Name (mon) + Назва дня тижня (пн) + + + + Day Name (monday) + Назва дня тижня (понеділок) + + + + Day (01-31) + День (01-31) + + + + Day of Month (1-31) + День місяця (1-31) + + + + Day (001-366) + День (001-366) + + + + Time (%H-%M-%S) + Час (%H-%M-%S) + + + + Time (%H-%M) + Час (%H-%M) + + + + Hour (00-23) + Година (00-23) + + + + Hour (01-12) + Година (01-12) + + + + Minute (00-59) + Хвилина (00-59) + + + + Second (00-59) + Секунда (00-59) + + + + Full Date (%m/%d/%y) + Повна дата (%m/%d/%y) + + + + Full Date (%Y-%m-%d) + Повна дата (%Y-%m-%d) + + + + SystemNotification + + + Flameshot Info + Довідка Flameshot + + + + TextConfig + + + StrikeOut + Перекреслення + + + + Underline + Підкреслення + + + + Bold + Жирний + + + + Italic + Курсив + + + + TextTool + + + Text + Текст + + + + Add text to your capture + Додати текст на знімок + + + + UIcolorEditor + + + UI Color Editor + Редактор кольору інтерфейсу + + + + Change the color moving the selectors and see the changes in the preview buttons. + Змініть колір пересуваючи виділення та перегляньте зміни у кнопках перегляду. + + + + Select a Button to modify it + Виберіть кнопку, щоб змінити її + + + + Main Color + Основний колір + + + + Click on this button to set the edition mode of the main color. + Натисніть на цю кнопку, щоб включити режим редагування основного кольору. + + + + Contrast Color + Контрасний колір + + + + Click on this button to set the edition mode of the contrast color. + Натисніть на цю кнопку, щоб включити режим редагування контрасного кольору. + + + + UndoTool + + + Undo + Скасувати + + + + Undo the last modification + Скасувати останню зміну + + + + VisualsEditor + + + Opacity of area outside selection: + Нерозорість області за межами вибору: + + + + Button Selection + Вибір кнопок + + + + Select All + Вибрати все + + + diff -Nru flameshot-0.6.0/translations/Internationalization_zh_CN.ts flameshot-0.6.0+git20190714/translations/Internationalization_zh_CN.ts --- flameshot-0.6.0/translations/Internationalization_zh_CN.ts 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/translations/Internationalization_zh_CN.ts 2019-07-14 16:21:21.000000000 +0000 @@ -51,13 +51,13 @@ ArrowTool - + Arrow 箭头 - - Sets the Arrow as the paint tool + + Set the Arrow as the paint tool 选择箭头作为绘画工具 @@ -70,11 +70,59 @@ - Sets the Blur as the paint tool + Set Blur as the paint tool 选择模糊作为绘画工具 + CaptureLauncher + + + <b>Capture Mode</b> + <b>捕获模式</b> + + + + Rectangular Region + 方形区域 + + + + Full Screen (All Monitors) + 全屏(所有显示器) + + + + No Delay + 无延迟 + + + + second + + + + + seconds + + + + + Take new screenshot + 获取新屏幕截图 + + + + Area: + 区域: + + + + Delay: + 延迟: + + + CaptureWidget @@ -105,29 +153,11 @@ - Sets the Circle as the paint tool + Set the Circle as the paint tool 选择圆环作为绘画工具 - ColorPickerWidget - - - Active color: - 活动颜色: - - - - Press ESC to cancel - 按下 ESC 键以取消 - - - - Grab Color - 获取颜色 - - - ConfigWindow @@ -153,22 +183,27 @@ Controller - + &Take Screenshot 进行截图(&T) - + + &Open Launcher + 打开启动器(&O) + + + &Configuration 配置(&C) - + &Information 信息(&I) - + &Quit 退出(&Q) @@ -182,7 +217,7 @@ - Copies the selection into the clipboard + Copy the selection into the clipboard 复制选择到剪贴板 @@ -258,95 +293,105 @@ GeneneralConf - + Show help message 显示帮助文档 - + Show the help message at the beginning in the capture mode. 在捕获之前显示帮助信息。 - - + + Show desktop notifications 显示桌面通知 - + Show tray icon 显示托盘图标 - + Show the systemtray icon 显示任务栏图标 - - + + Import 导入 - - - + + + Error 错误 - + Unable to read file. 无法读取文件。 - - + + Unable to write file. 无法写入文件。 - + Save File 保存到文件 - + Confirm Reset 确定重置 - + Are you sure you want to reset the configuration? 你确定你想要重置配置? - + Configuration File 配置文件 - + Export 导出 - + Reset 重置 - + Launch at startup 开机时启动 - + Launch Flameshot 启动 Flameshot + + + Close after capture + 捕获后关闭 + + + + Close after taking a screenshot + 获取屏幕截图后关闭 + ImgurUploader @@ -406,94 +451,104 @@ - Uploads the selection to Imgur + Upload the selection to Imgur 上传选择到 Imgur InfoWindow - + About 关于 - + + SPACEBAR + 空格 + + + Right Click 右键 - + Mouse Wheel 鼠标滑轮 - + Move selection 1px 移动选择 1 px - + Resize selection 1px 调整选择大小 1 px - + Quit capture 退出捕获 - + Copy to clipboard 复制到剪贴板 - + Save selection as a file 将选择保存为文件 - + Undo the last modification 撤消上次修改 - + + Toggle visibility of sidebar with options of the selected tool + 切换侧边栏可见性 + + + Show color picker 显示颜色选择器 - + Change the tool's thickness 改变工具的厚度 - + Key - + Description 描述 - + <u><b>License</b></u> <u><b>许可证</b></u> - + <u><b>Version</b></u> <u><b>版本</b></u> - + <u><b>Shortcuts</b></u> <u><b>快捷键</b></u> - + Available shortcuts in the screen capture mode. 屏幕捕捉模式中的可用快捷键。 @@ -501,26 +556,26 @@ LineTool - + Line 直线 - - Sets the Line as the paint tool + + Set the Line as the paint tool 将直线线设置为绘画工具 MarkerTool - + Marker 标记 - - Sets the Marker as the paint tool + + Set the Marker as the paint tool 将标记设置为绘画工具 @@ -546,7 +601,7 @@ - Sets the Pencil as the paint tool + Set the Pencil as the paint tool 将铅笔设置为绘画工具 @@ -566,13 +621,13 @@ QObject - + Save Error 保存错误 - - + + Capture saved as 捕获已保存为 @@ -582,16 +637,17 @@ 捕获已保存至剪贴板 - - + + Error trying to save as 尝试另存为时出错 - - - - + + + + + Unable to connect via DBus 无法通过DBus进行连接 @@ -615,7 +671,7 @@ - Sets the Rectangle as the paint tool + Set the Rectangle as the paint tool 将实心矩形设置为绘画工具 @@ -648,7 +704,7 @@ ScreenGrabber - + Unable to capture screen 无法捕获屏幕 @@ -662,11 +718,34 @@ - Sets the Selection as the paint tool + Set Selection as the paint tool 将矩形选择设置为绘画工具 + SidePanelWidget + + + Active thickness: + 当前宽度: + + + + Active color: + 活动颜色: + + + + Press ESC to cancel + 按下 ESC 键以取消 + + + + Grab Color + 获取颜色 + + + SizeIndicatorTool @@ -675,7 +754,7 @@ - Shows the dimensions of the selection (X Y) + Show the dimensions of the selection (X Y) 显示选择的尺寸 (X Y) @@ -790,7 +869,7 @@ SystemNotification - + Flameshot Info Flameshot 消息 diff -Nru flameshot-0.6.0/translations/Internationalization_zh_TW.ts flameshot-0.6.0+git20190714/translations/Internationalization_zh_TW.ts --- flameshot-0.6.0/translations/Internationalization_zh_TW.ts 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/translations/Internationalization_zh_TW.ts 2019-07-14 16:21:21.000000000 +0000 @@ -57,7 +57,7 @@ - Sets the Arrow as the paint tool + Set the Arrow as the paint tool 選擇箭頭作為繪製工具 @@ -70,7 +70,7 @@ - Sets the Blur as the paint tool + Set Blur as the paint tool 選擇模糊作為繪製工具 @@ -100,29 +100,11 @@ - Sets the Circle as the paint tool + Set the Circle as the paint tool 選擇圈型作為繪畫工具 - ColorPickerWidget - - - Active color: - - - - - Press ESC to cancel - - - - - Grab Color - - - - ConfigWindow @@ -177,7 +159,7 @@ - Copies the selection into the clipboard + Copy the selection into the clipboard @@ -401,94 +383,99 @@ - Uploads the selection to Imgur + Upload the selection to Imgur 上傳到 Imgur InfoWindow - + About 關於 - + Right Click 右鍵 - + Mouse Wheel 滑鼠滑輪 - + Move selection 1px 移動 1px - + Resize selection 1px 調整大小 1px - + Quit capture 結束擷取 - + Copy to clipboard 複製到剪貼簿 - + Save selection as a file 將選擇範圍另存新檔 - + Undo the last modification 復原上次修改 - + + Toggle visibility of sidebar with options of the selected tool + + + + Show color picker 顯示顏色選擇器 - + Change the tool's thickness 改變工具的寬度 - + Key - + Description 描述 - + <u><b>License</b></u> <u><b>授權條款</b></u> - + <u><b>Version</b></u> <u><b>版本</b></u> - + <u><b>Shortcuts</b></u> <u><b>快速鍵</b></u> - + Available shortcuts in the screen capture mode. 螢幕擷取模式中的可用快速鍵 @@ -502,7 +489,7 @@ - Sets the Line as the paint tool + Set the Line as the paint tool 將直線線設定為繪畫工具 @@ -515,7 +502,7 @@ - Sets the Marker as the paint tool + Set the Marker as the paint tool 將標記設定為繪畫工具 @@ -541,7 +528,7 @@ - Sets the Pencil as the paint tool + Set the Pencil as the paint tool 將鉛筆設定為繪畫工具 @@ -610,7 +597,7 @@ - Sets the Rectangle as the paint tool + Set the Rectangle as the paint tool 將實心矩形設定為繪畫工具 @@ -643,7 +630,7 @@ ScreenGrabber - + Unable to capture screen 無法擷取螢幕 @@ -657,11 +644,34 @@ - Sets the Selection as the paint tool + Set Selection as the paint tool 將矩形選擇設定為繪畫工具 + SidePanelWidget + + + Active thickness: + + + + + Active color: + + + + + Press ESC to cancel + + + + + Grab Color + + + + SizeIndicatorTool @@ -670,7 +680,7 @@ - Shows the dimensions of the selection (X Y) + Show the dimensions of the selection (X Y) 顯示選擇的尺寸 (X Y) diff -Nru flameshot-0.6.0/travis/linux_after_success.sh flameshot-0.6.0+git20190714/travis/linux_after_success.sh --- flameshot-0.6.0/travis/linux_after_success.sh 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/travis/linux_after_success.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -#!/bin/bash -- - -set -e - -DIST_PATH=dist - -if [[ "${DIST}" == "trusty" ]]; then - travis_retry curl \ - --upload-file \ - "${DIST_PATH}"/flameshot_${ARCH}_${VERSION}.${EXTEN} \ - "https://transfer.sh/flameshot_${ARCH}_${VERSION}.${EXTEN}" -else - case "${OS}" in - "ubuntu"|"debian") - travis_retry curl \ - --upload-file \ - "${DIST_PATH}"/flameshot_${VERSION}-${DIST}-${ARCH}_${ARCH}.${EXTEN} \ - "https://transfer.sh/flameshot_${VERSION}-${DIST}-${ARCH}_${ARCH}.${EXTEN}" - ;; - "fedora") - travis_retry curl \ - --upload-file \ - "${DIST_PATH}"/flameshot_${VERSION}-fedora${DIST}-${ARCH}_${ARCH}.${EXTEN} \ - "https://transfer.sh/flameshot_${VERSION}-fedora${DIST}-${ARCH}_${ARCH}.${EXTEN}" - ;; - esac -fi diff -Nru flameshot-0.6.0/travis/linux_before_install.sh flameshot-0.6.0+git20190714/travis/linux_before_install.sh --- flameshot-0.6.0/travis/linux_before_install.sh 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/travis/linux_before_install.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -#!/bin/bash -- - -set -e - -if [[ "${DIST}" == "trusty" ]]; then - travis_retry sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test - travis_retry sudo add-apt-repository -y ppa:beineri/opt-qt532-trusty - travis_retry sudo apt-get -qq update - - # Get linuxdeployqt tool - travis_retry wget \ - -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" \ - -O linuxdeployqt - chmod +x linuxdeployqt -fi diff -Nru flameshot-0.6.0/travis/linux_install.sh flameshot-0.6.0+git20190714/travis/linux_install.sh --- flameshot-0.6.0/travis/linux_install.sh 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/travis/linux_install.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -#!/bin/bash -- - -set -e - -if [[ "${DIST}" == "trusty" ]]; then - travis_retry sudo apt-get install -qq build-essential git - - travis_retry sudo -E apt-get -yq \ - --no-install-suggests --no-install-recommends --force-yes \ - install openssl libssl-dev - - #travis_retry sudo -E apt-get -yq \ - # --no-install-suggests --no-install-recommends --force-yes \ - # install libgl1-mesa-dev - - travis_retry sudo -E apt-get -yq \ - --no-install-suggests --no-install-recommends --force-yes \ - install tree - - travis_retry sudo apt-get install -qq gcc-4.9 g++-4.9 - - # Install qt5.3.2 - travis_retry sudo apt-get -y install qt53base qt53tools qt53svg - - # Install fcitx-frontend-qt5 - travis_retry sudo apt-get -y install fcitx-frontend-qt5 -fi diff -Nru flameshot-0.6.0/travis/linux_script.sh flameshot-0.6.0+git20190714/travis/linux_script.sh --- flameshot-0.6.0/travis/linux_script.sh 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/travis/linux_script.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,131 +0,0 @@ -#!/bin/bash -- - -set -e - -DIST_PATH=dist - -if [[ ! -d "${DIST_PATH}" ]]; then - mkdir "${DIST_PATH}" -fi - -if [[ "${DIST}" == "trusty" ]]; then - project_dir="$(pwd)" - BUILD_DST_PATH=build-test - APPIMAGE_DST_PATH=build-appimage - - #source /opt/qt53/bin/qt53-env.sh - QT_BASE_DIR=/opt/qt53 - export QTDIR="${QT_BASE_DIR}" - export PATH="${QT_BASE_DIR}"/bin:"${PATH}" - export LD_LIBRARY_PATH="${QT_BASE_DIR}"/lib/x86_64-linux-gnu:"${QT_BASE_DIR}"/lib:"${LD_LIBRARY_PATH}" - export PKG_CONFIG_PATH="${QT_BASE_DIR}"/lib/pkgconfig:"${PKG_CONFIG_PATH}" - - qmake --version - export CC=gcc-4.9 CXX=g++-4.9 - - mkdir "${BUILD_DST_PATH}" - qmake QMAKE_CXX="${CXX}" QMAKE_CC="${CC}" QMAKE_LINK="${CXX}" DESTDIR="${BUILD_DST_PATH}" - # Building flameshot - make -j$(nproc) - # Running flameshot tests - make check -j$(nproc) - ls -alhR - - # - # Packaging AppImage using linuxdeployqt - # - mkdir -p "${APPIMAGE_DST_PATH}"/appdir/usr/bin - mkdir -p "${APPIMAGE_DST_PATH}"/appdir/usr/share/applications - mkdir -p "${APPIMAGE_DST_PATH}"/appdir/usr/share/dbus-1/interfaces - mkdir -p "${APPIMAGE_DST_PATH}"/appdir/usr/share/dbus-1/services - mkdir -p "${APPIMAGE_DST_PATH}"/appdir/usr/share/metainfo - mkdir -p "${APPIMAGE_DST_PATH}"/appdir/usr/share/bash-completion/completions - mkdir -p "${APPIMAGE_DST_PATH}"/appdir/usr/share/flameshot/translations - cp \ - "${BUILD_DST_PATH}"/flameshot \ - "${APPIMAGE_DST_PATH}"/appdir/usr/bin/ - cp \ - "${project_dir}"/dbus/org.dharkael.Flameshot.xml \ - "${APPIMAGE_DST_PATH}"/appdir/usr/share/dbus-1/interfaces/ - cp \ - "${project_dir}"/dbus/package/org.dharkael.Flameshot.service \ - "${APPIMAGE_DST_PATH}"/appdir/usr/share/dbus-1/services/ - cp \ - "${project_dir}"/docs/appdata/flameshot.appdata.xml \ - "${APPIMAGE_DST_PATH}"/appdir/usr/share/metainfo/ - cp \ - "${project_dir}"/docs/bash-completion/flameshot \ - "${APPIMAGE_DST_PATH}"/appdir/usr/share/bash-completion/completions/ - cp \ - "${project_dir}"/translations/*.qm \ - "${APPIMAGE_DST_PATH}"/appdir/usr/share/flameshot/translations/ - cp \ - "${project_dir}"/docs/desktopEntry/package/* \ - "${APPIMAGE_DST_PATH}"/appdir/usr/share/applications/ - cp \ - "${project_dir}"/img/app/flameshot.png \ - "${APPIMAGE_DST_PATH}"/appdir/ - ls -alhR "${APPIMAGE_DST_PATH}"/appdir - - # Copy other project files - cp "${project_dir}"/README.md "${APPIMAGE_DST_PATH}"/appdir/README.md - cp "${project_dir}"/LICENSE "${APPIMAGE_DST_PATH}"/appdir/LICENSE - echo "${VERSION}" > "${APPIMAGE_DST_PATH}"/appdir/version - echo "${TRAVIS_COMMIT}" >> "${APPIMAGE_DST_PATH}"/appdir/version - - # Configure env vars - unset QTDIR - unset QT_PLUGIN_PATH - unset LD_LIBRARY_PATH - tree "${APPIMAGE_DST_PATH}"/appdir - - # Packaging - # -verbose=2 - ./linuxdeployqt "${APPIMAGE_DST_PATH}"/appdir/usr/bin/flameshot -bundle-non-qt-libs - - rm -f "${APPIMAGE_DST_PATH}"/appdir/usr/lib/libatk-1.0.so.0 - cp \ - /usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so \ - "${APPIMAGE_DST_PATH}"/appdir/usr/plugins/platforminputcontexts/ - cd "${APPIMAGE_DST_PATH}"/appdir/usr/bin - ln -sf ../plugins/platforms/ . # An unknown bug - ln -sf ../share/flameshot/translations/ . # add translation soft link - cd "${project_dir}" - - # -verbose=2 - ./linuxdeployqt "${APPIMAGE_DST_PATH}"/appdir/usr/share/applications/flameshot.desktop -appimage - - ls -alhR -- *.AppImage - cp -- *.AppImage "${APPIMAGE_DST_PATH}"/ - - tree "${APPIMAGE_DST_PATH}"/ - - ls -l "${APPIMAGE_DST_PATH}"/*.AppImage - - # Rename AppImage and move AppImage to DIST_PATH - cd "${APPIMAGE_DST_PATH}" - mv Flameshot-${VERSION}-${ARCH}.AppImage flameshot_${ARCH}_${VERSION}.AppImage - cd .. - cp \ - "${APPIMAGE_DST_PATH}"/flameshot_${ARCH}_${VERSION}.AppImage \ - "${DIST_PATH}"/flameshot_${ARCH}_${VERSION}.${EXTEN} - pwd -else - travis_retry git clone https://github.com/packpack/packpack.git - travis_retry packpack/packpack - pwd && ls - - case "${OS}" in - "ubuntu"|"debian") - # copy deb to dist path for distribution - cp \ - build/flameshot_*_*.deb \ - "${DIST_PATH}"/flameshot_${VERSION}-${DIST}-${ARCH}_${ARCH}.${EXTEN} - ;; - "fedora") - cp \ - build/flameshot-${VERSION}-${RELEASE}.*.${ARCH}.rpm \ - "${DIST_PATH}"/flameshot_${VERSION}-fedora${DIST}-${ARCH}_${ARCH}.${EXTEN} - ;; - esac -fi diff -Nru flameshot-0.6.0/travis/osx_script.sh flameshot-0.6.0+git20190714/travis/osx_script.sh --- flameshot-0.6.0/travis/osx_script.sh 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/travis/osx_script.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ -#!/bin/bash -- - -set -e - -project_dir="$(pwd)" - -brew update > /dev/null -brew install qt -QTDIR=/usr/local/opt/qt -PATH="${QTDIR}"/bin:"${PATH}" -LDFLAGS=-L"${QTDIR}"/lib -CPPFLAGS=-I"${QTDIR}"/include - -# Build your app -cd "${project_dir}" -mkdir dist -mkdir build -cd build -qmake -version -qmake CONFIG-=debug CONFIG+=release CONFIG+=packaging ../flameshot.pro -make -j$(nproc) - -git clone https://github.com/aurelien-rainone/macdeployqtfix.git -pwd -ls - -ls /Users/travis/build/ZetaoYang/flameshot - -# Package DMG from build/flamshot.app directory -"${QTDIR}"/bin/macdeployqt flameshot.app -python \ - "${project_dir}"/build/macdeployqtfix/macdeployqtfix.py \ - flameshot.app/Contents/MacOS/flameshot \ - "${QTDIR}" - -cd "${project_dir}"/build -mkdir -p distrib/Flameshot -cd distrib/Flameshot -mv "${project_dir}"/build/flameshot.app "${project_dir}"/build/distrib/Flameshot/ -cp "${project_dir}"/LICENSE LICENSE -cp "${project_dir}"/README.md README.md -echo "${VERSION}" > version -echo "${TRAVIS_COMMIT}" >> version - -ln -s /Applications ./Applications - -cd .. -hdiutil create -srcfolder ./Flameshot -format UDBZ ./flameshot.dmg -mv flameshot.dmg flameshot_X64_${VERSION}.dmg -mv flameshot_X64_${VERSION}.dmg "${project_dir}"/dist/flameshot_X64_$VERSION.dmg -curl \ - --upload-file \ - flameshot_X64_$VERSION.dmg \ - "https://transfer.sh/flameshot_X64_$VERSION.dmg" -cd .. diff -Nru flameshot-0.6.0/.travis/linux_after_success.sh flameshot-0.6.0+git20190714/.travis/linux_after_success.sh --- flameshot-0.6.0/.travis/linux_after_success.sh 1970-01-01 00:00:00.000000000 +0000 +++ flameshot-0.6.0+git20190714/.travis/linux_after_success.sh 2019-07-14 16:21:21.000000000 +0000 @@ -0,0 +1,31 @@ +#!/bin/bash -- + +set -e + +DIST_PATH=dist + +if [[ "${EXTEN}" == "other" ]]; then + cp "${BUILD_DST_PATH}/flameshot" "${ROOT_PATH}/.travis/services/flameshot_${VERSION}_${ARCH}" + cd "${ROOT_PATH}/.travis/services" + TEMP_DOWNLOAD_URL=$(travis_retry bash \ + "${ROOT_PATH}/.travis/services/${UPLOAD_SERVICE}.sh" \ + flameshot_"${VERSION}_${ARCH}") +else + case "${OS}" in + "ubuntu"|"debian") + cp "${DIST_PATH}/flameshot_${VERSION}_${DIST}_${ARCH}.${EXTEN}" "${ROOT_PATH}/.travis/services/flameshot_${VERSION}_${DIST}_${ARCH}.${EXTEN}" + cd "${ROOT_PATH}/.travis/services" + TEMP_DOWNLOAD_URL=$(travis_retry bash \ + "${ROOT_PATH}/.travis/services/${UPLOAD_SERVICE}.sh" \ + "flameshot_${VERSION}_${DIST}_${ARCH}.${EXTEN}") + ;; + "fedora") + cp "${DIST_PATH}/flameshot_${VERSION}_fedora${DIST}_${ARCH}.${EXTEN}" "${ROOT_PATH}/.travis/services/flameshot_${VERSION}_fedora${DIST}_${ARCH}.${EXTEN}" + cd "${ROOT_PATH}/.travis/services" + TEMP_DOWNLOAD_URL=$(travis_retry bash \ + "${ROOT_PATH}/.travis/services/${UPLOAD_SERVICE}.sh" \ + "flameshot_${VERSION}_fedora${DIST}_${ARCH}.${EXTEN}") + ;; + esac +fi + diff -Nru flameshot-0.6.0/.travis/linux_before_install.sh flameshot-0.6.0+git20190714/.travis/linux_before_install.sh --- flameshot-0.6.0/.travis/linux_before_install.sh 1970-01-01 00:00:00.000000000 +0000 +++ flameshot-0.6.0+git20190714/.travis/linux_before_install.sh 2019-07-14 16:21:21.000000000 +0000 @@ -0,0 +1,7 @@ +#!/bin/bash -- + +set -e + +if [[ "${EXTEN}" == "other" ]]; then + travis_retry sudo apt update +fi diff -Nru flameshot-0.6.0/.travis/linux_install.sh flameshot-0.6.0+git20190714/.travis/linux_install.sh --- flameshot-0.6.0/.travis/linux_install.sh 1970-01-01 00:00:00.000000000 +0000 +++ flameshot-0.6.0+git20190714/.travis/linux_install.sh 2019-07-14 16:21:21.000000000 +0000 @@ -0,0 +1,15 @@ +#!/bin/bash -- + +set -e + +if [[ "${EXTEN}" == "other" ]]; then + # Compile-time + travis_retry sudo apt install -y gcc g++ build-essential qt5-default qt5-qmake qttools5-dev-tools + # Run-time + travis_retry sudo apt install -y libqt5dbus5 libqt5network5 libqt5core5a libqt5widgets5 libqt5gui5 libqt5svg5-dev + # Optional + travis_retry sudo apt install -y openssl ca-certificates + # Install fcitx-frontend-qt5 + travis_retry sudo apt install -y fcitx-frontend-qt5 + +fi diff -Nru flameshot-0.6.0/.travis/linux_script.sh flameshot-0.6.0+git20190714/.travis/linux_script.sh --- flameshot-0.6.0/.travis/linux_script.sh 1970-01-01 00:00:00.000000000 +0000 +++ flameshot-0.6.0+git20190714/.travis/linux_script.sh 2019-07-14 16:21:21.000000000 +0000 @@ -0,0 +1,42 @@ +#!/bin/bash -- + +set -e + +DIST_PATH=dist + +if [[ ! -d "${DIST_PATH}" ]]; then + mkdir "${DIST_PATH}" +fi + +if [[ "${EXTEN}" == "other" ]]; then + project_dir="$(pwd)" + BUILD_DST_PATH=build-test + + qmake --version + mkdir "${BUILD_DST_PATH}" + qmake -makefile DESTDIR="${BUILD_DST_PATH}" "${project_dir}"/flameshot.pro + # Building flameshot + make -j$(nproc) + # Running flameshot tests + make check -j$(nproc) + ls -alhR + +else + travis_retry git clone https://github.com/flameshotapp/packpack.git + travis_retry packpack/packpack + pwd && ls + + case "${OS}" in + "ubuntu"|"debian") + # copy deb to dist path for distribution + cp \ + build/flameshot_*_*.deb \ + "${DIST_PATH}"/flameshot_${VERSION}_${DIST}_${ARCH}.${EXTEN} + ;; + "fedora") + cp \ + build/flameshot-${VERSION}-${RELEASE}.*.${ARCH}.rpm \ + "${DIST_PATH}"/flameshot_${VERSION}_fedora${DIST}_${ARCH}.${EXTEN} + ;; + esac +fi diff -Nru flameshot-0.6.0/.travis/osx_script.sh flameshot-0.6.0+git20190714/.travis/osx_script.sh --- flameshot-0.6.0/.travis/osx_script.sh 1970-01-01 00:00:00.000000000 +0000 +++ flameshot-0.6.0+git20190714/.travis/osx_script.sh 2019-07-14 16:21:21.000000000 +0000 @@ -0,0 +1,55 @@ +#!/bin/bash -- + +set -e + +project_dir="$(pwd)" + +brew update > /dev/null +brew install qt +QTDIR=/usr/local/opt/qt +PATH="${QTDIR}"/bin:"${PATH}" +LDFLAGS=-L"${QTDIR}"/lib +CPPFLAGS=-I"${QTDIR}"/include + +# Build your app +cd "${project_dir}" +mkdir dist +mkdir build +cd build +qmake -version +qmake CONFIG-=debug CONFIG+=release CONFIG+=packaging ../flameshot.pro +make -j$(nproc) + +git clone https://github.com/aurelien-rainone/macdeployqtfix.git +pwd +ls + +ls /Users/travis/build/ZetaoYang/flameshot + +# Package DMG from build/flamshot.app directory +"${QTDIR}"/bin/macdeployqt flameshot.app +python \ + "${project_dir}"/build/macdeployqtfix/macdeployqtfix.py \ + flameshot.app/Contents/MacOS/flameshot \ + "${QTDIR}" + +cd "${project_dir}"/build +mkdir -p distrib/Flameshot +cd distrib/Flameshot +mv "${project_dir}"/build/flameshot.app "${project_dir}"/build/distrib/Flameshot/ +cp "${project_dir}"/LICENSE LICENSE +cp "${project_dir}"/README.md README.md +echo "${VERSION}" > version +echo "${TRAVIS_COMMIT}" >> version + +ln -s /Applications ./Applications + +cd .. +hdiutil create -srcfolder ./Flameshot -format UDBZ ./flameshot.dmg +mv flameshot.dmg flameshot_X64_${VERSION}.dmg +mv flameshot_X64_${VERSION}.dmg "${project_dir}"/dist/flameshot_X64_$VERSION.dmg +TEMP_DOWNLOAD_URL=$(curl \ + --upload-file \ + flameshot_X64_$VERSION.dmg \ + "https://transfer.sh/flameshot_X64_$VERSION.dmg") +cd .. diff -Nru flameshot-0.6.0/.travis/services/0x0.st.sh flameshot-0.6.0+git20190714/.travis/services/0x0.st.sh --- flameshot-0.6.0/.travis/services/0x0.st.sh 1970-01-01 00:00:00.000000000 +0000 +++ flameshot-0.6.0+git20190714/.travis/services/0x0.st.sh 2019-07-14 16:21:21.000000000 +0000 @@ -0,0 +1,25 @@ +#!/bin/sh +#=============================================================== +# File URLs are valid for at least 30 days and up to a year (see below). +# Shortened URLs do not expire. +# Maximum file size: 512.0 MiB +# Blocked file types: application/x-dosexec, application/x-executable +#=============================================================== + +URL="https://0x0.st" + +if [ $# -eq 0 ]; then + echo "Usage: 0x0.st FILE\n" + exit 1 +fi + +FILE=$1 + +if [ ! -f "$FILE" ]; then + echo "File ${FILE} not found" + exit 1 +fi + +RESPONSE=$(curl -# -F "file=@${FILE}" "${URL}") + +echo "${RESPONSE}" # to terminal diff -Nru flameshot-0.6.0/.travis/services/file.io.sh flameshot-0.6.0+git20190714/.travis/services/file.io.sh --- flameshot-0.6.0/.travis/services/file.io.sh 1970-01-01 00:00:00.000000000 +0000 +++ flameshot-0.6.0+git20190714/.travis/services/file.io.sh 2019-07-14 16:21:21.000000000 +0000 @@ -0,0 +1,26 @@ +#!/bin/sh + +#========================================== +# 100 uploads per day, 5GB file size limit for FREE plan. +#========================================== + +URL="https://file.io" +DEFAULT_EXPIRE="14d" # Default to 14 days + +if [ $# -eq 0 ]; then + echo "Usage: file.io FILE [DURATION]\n" + echo "Example: file.io path/to/my/file 1w\n" + exit 1 +fi + +FILE=$1 +EXPIRE=${2:-$DEFAULT_EXPIRE} + +if [ ! -f "$FILE" ]; then + echo "File ${FILE} not found" + exit 1 +fi + +RESPONSE=$(curl -# -F "file=@${FILE}" "${URL}/?expires=${EXPIRE}") + +echo "${RESPONSE}" # to terminal diff -Nru flameshot-0.6.0/.travis/services/transfer.sh.sh flameshot-0.6.0+git20190714/.travis/services/transfer.sh.sh --- flameshot-0.6.0/.travis/services/transfer.sh.sh 1970-01-01 00:00:00.000000000 +0000 +++ flameshot-0.6.0+git20190714/.travis/services/transfer.sh.sh 2019-07-14 16:21:21.000000000 +0000 @@ -0,0 +1,19 @@ +#!/bin/sh + +URL="https://transfer.sh" + +if [ $# -eq 0 ]; then + echo "Usage: transfer.sh FILE\n" + exit 1 +fi + +FILE=$1 + +if [ ! -f "$FILE" ]; then + echo "File ${FILE} not found" + exit 1 +fi + +RESPONSE=$(curl -# -F "file=@${FILE}" "${URL}") + +echo "${RESPONSE}" # to terminal \ No newline at end of file diff -Nru flameshot-0.6.0/.travis/services/transferwee.py flameshot-0.6.0+git20190714/.travis/services/transferwee.py --- flameshot-0.6.0/.travis/services/transferwee.py 1970-01-01 00:00:00.000000000 +0000 +++ flameshot-0.6.0+git20190714/.travis/services/transferwee.py 2019-07-14 16:21:21.000000000 +0000 @@ -0,0 +1,330 @@ +#!/usr/bin/env python3.7 + +# +# Copyright (c) 2018-2019 Leonardo Taccari +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + + +""" +Download/upload files via wetransfer.com + +transferwee is a script/module to download/upload files via wetransfer.com. + +It exposes `download' and `upload' subcommands, respectively used to download +files from a `we.tl' or `wetransfer.com/downloads' URLs and upload files that +will be shared via emails or link. +""" + + +from typing import List +import os.path +import urllib.parse +import zlib + +import requests + + +WETRANSFER_API_URL = 'https://wetransfer.com/api/v4/transfers' +WETRANSFER_DOWNLOAD_URL = WETRANSFER_API_URL + '/{transfer_id}/download' +WETRANSFER_UPLOAD_EMAIL_URL = WETRANSFER_API_URL + '/email' +WETRANSFER_UPLOAD_LINK_URL = WETRANSFER_API_URL + '/link' +WETRANSFER_FILES_URL = WETRANSFER_API_URL + '/{transfer_id}/files' +WETRANSFER_PART_PUT_URL = WETRANSFER_FILES_URL + '/{file_id}/part-put-url' +WETRANSFER_FINALIZE_MPP_URL = WETRANSFER_FILES_URL + '/{file_id}/finalize-mpp' +WETRANSFER_FINALIZE_URL = WETRANSFER_API_URL + '/{transfer_id}/finalize' + +WETRANSFER_DEFAULT_CHUNK_SIZE = 5242880 + + +def download_url(url: str) -> str: + """Given a wetransfer.com download URL download return the downloadable URL. + + The URL should be of the form `https://we.tl/' or + `https://wetransfer.com/downloads/'. If it is a short URL (i.e. `we.tl') + the redirect is followed in order to retrieve the corresponding + `wetransfer.com/downloads/' URL. + + The following type of URLs are supported: + - `https://we.tl/`: + received via link upload, via email to the sender and printed by + `upload` action + - `https://wetransfer.com//`: + directly not shared in any ways but the short URLs actually redirect to + them + - `https://wetransfer.com///`: + received via email by recipients when the files are shared via email + upload + + Return the download URL (AKA `direct_link') as a str or None if the URL + could not be parsed. + """ + # Follow the redirect if we have a short URL + if url.startswith('https://we.tl/'): + r = requests.head(url, allow_redirects=True) + url = r.url + + recipient_id = None + params = url.replace('https://wetransfer.com/downloads/', '').split('/') + + if len(params) == 2: + transfer_id, security_hash = params + elif len(params) == 3: + transfer_id, recipient_id, security_hash = params + else: + return None + + j = { + "security_hash": security_hash, + } + if recipient_id: + j["recipient_id"] = recipient_id + r = requests.post(WETRANSFER_DOWNLOAD_URL.format(transfer_id=transfer_id), + json=j) + + j = r.json() + return j.get('direct_link') + + +def download(url: str) -> None: + """Given a `we.tl/' or `wetransfer.com/downloads/' download it. + + First a direct link is retrieved (via download_url()), the filename will + be extracted to it and it will be fetched and stored on the current + working directory. + """ + dl_url = download_url(url) + file = urllib.parse.urlparse(dl_url).path.split('/')[-1] + + r = requests.get(dl_url, stream=True) + with open(file, 'wb') as f: + for chunk in r.iter_content(chunk_size=1024): + f.write(chunk) + + +def _file_name_and_size(file: str) -> dict: + """Given a file, prepare the "name" and "size" dictionary. + + Return a dictionary with "name" and "size" keys. + """ + filename = os.path.basename(file) + filesize = os.path.getsize(file) + + return { + "name": filename, + "size": filesize + } + + +def _prepare_email_upload(filenames: List[str], message: str, + sender: str, recipients: List[str]) -> str: + """Given a list of filenames, message a sender and recipients prepare for + the email upload. + + Return the parsed JSON response. + """ + j = { + "files": [_file_name_and_size(f) for f in filenames], + "from": sender, + "message": message, + "recipients": recipients, + "ui_language": "en", + } + + r = requests.post(WETRANSFER_UPLOAD_EMAIL_URL, json=j) + return r.json() + + +def _prepare_link_upload(filenames: List[str], message: str) -> str: + """Given a list of filenames and a message prepare for the link upload. + + Return the parsed JSON response. + """ + j = { + "files": [_file_name_and_size(f) for f in filenames], + "message": message, + "ui_language": "en", + } + + r = requests.post(WETRANSFER_UPLOAD_LINK_URL, json=j) + return r.json() + + +def _prepare_file_upload(transfer_id: str, file: str) -> str: + """Given a transfer_id and file prepare it for the upload. + + Return the parsed JSON response. + """ + j = _file_name_and_size(file) + r = requests.post(WETRANSFER_FILES_URL.format(transfer_id=transfer_id), + json=j) + return r.json() + + +def _upload_chunks(transfer_id: str, file_id: str, file: str, + default_chunk_size: int = WETRANSFER_DEFAULT_CHUNK_SIZE) -> str: + """Given a transfer_id, file_id and file upload it. + + Return the parsed JSON response. + """ + f = open(file, 'rb') + + chunk_number = 0 + while True: + chunk = f.read(default_chunk_size) + chunk_size = len(chunk) + if chunk_size == 0: + break + chunk_number += 1 + + j = { + "chunk_crc": zlib.crc32(chunk), + "chunk_number": chunk_number, + "chunk_size": chunk_size, + "retries": 0 + } + + r = requests.post( + WETRANSFER_PART_PUT_URL.format(transfer_id=transfer_id, + file_id=file_id), + json=j) + url = r.json().get('url') + r = requests.options(url, + headers={ + 'Origin': 'https://wetransfer.com', + 'Access-Control-Request-Method': 'PUT', + }) + r = requests.put(url, data=chunk) + + j = { + 'chunk_count': chunk_number + } + r = requests.put( + WETRANSFER_FINALIZE_MPP_URL.format(transfer_id=transfer_id, + file_id=file_id), + json=j) + + return r.json() + + +def _finalize_upload(transfer_id: str) -> str: + """Given a transfer_id finalize the upload. + + Return the parsed JSON response. + """ + r = requests.put(WETRANSFER_FINALIZE_URL.format(transfer_id=transfer_id)) + + return r.json() + + +def upload(files: List[str], message: str = '', sender: str = None, + recipients: List[str] = []) -> str: + """Given a list of files upload them and return the corresponding URL. + + Also accepts optional parameters: + - `message': message used as a description of the transfer + - `sender': email address used to receive an ACK if the upload is + successfull. For every download by the recipients an email + will be also sent + - `recipients': list of email addresses of recipients. When the upload + succeed every recipients will receive an email with a link + + If both sender and recipient parameters are passed the email upload will be + used. Otherwise, the link upload will be used. + + Return the short URL of the transfer on success. + """ + + # Check that all files exists + for f in files: + if not os.path.exists(f): + return None + + # Check that there are no duplicates filenames + # (despite possible different dirname()) + filenames = [os.path.basename(f) for f in files] + if len(files) != len(set(filenames)): + return None + + transfer_id = None + if sender and recipients: + # email upload + transfer_id = \ + _prepare_email_upload(filenames, message, sender, recipients)['id'] + else: + # link upload + transfer_id = _prepare_link_upload(filenames, message)['id'] + + for f in files: + file_id = _prepare_file_upload(transfer_id, os.path.basename(f))['id'] + _upload_chunks(transfer_id, file_id, f) + + return _finalize_upload(transfer_id)['shortened_url'] + + +if __name__ == '__main__': + import argparse + + ap = argparse.ArgumentParser( + prog='transferwee', + description='Download/upload files via wetransfer.com' + ) + sp = ap.add_subparsers(dest='action', help='action') + + # download subcommand + dp = sp.add_parser('download', help='download files') + dp.add_argument('-g', action='store_true', + help='only print the direct link (without downloading it)') + dp.add_argument('url', nargs='+', type=str, metavar='url', + help='URL (we.tl/... or wetransfer.com/downloads/...)') + + # upload subcommand + up = sp.add_parser('upload', help='upload files') + up.add_argument('-m', type=str, default='', metavar='message', + help='message description for the transfer') + up.add_argument('-f', type=str, metavar='from', help='sender email') + up.add_argument('-t', nargs='+', type=str, metavar='to', + help='recipient emails') + up.add_argument('files', nargs='+', type=str, metavar='file', + help='files to upload') + + args = ap.parse_args() + + if args.action == 'download': + if args.g: + for u in args.url: + print(download_url(u)) + else: + for u in args.url: + download(u) + exit(0) + + if args.action == 'upload': + print(upload(args.files, args.m, args.f, args.t)) + exit(0) + + # No action selected, print help message + ap.print_help() + exit(1) diff -Nru flameshot-0.6.0/.travis/services/wetransfer.com.sh flameshot-0.6.0+git20190714/.travis/services/wetransfer.com.sh --- flameshot-0.6.0/.travis/services/wetransfer.com.sh 1970-01-01 00:00:00.000000000 +0000 +++ flameshot-0.6.0+git20190714/.travis/services/wetransfer.com.sh 2019-07-14 16:21:21.000000000 +0000 @@ -0,0 +1,25 @@ +#!/bin/sh +#========================================================================================================================= +# WeTransfer is a service to send big or small files from A to B. +# It can transfer any type of file - such as presentations, photos, videos, music or documents - to friends and colleagues. +# You can send files up to 2 GB and they will be available for 7 days, with no registration. + +# API doc: https://developers.wetransfer.com/documentation +# Using transferwee.py: https://github.com/iamleot/transferwee +#========================================================================================================================= + +if [ $# -eq 0 ]; then + echo "Usage: python3 transferwee.py FILE\n" + exit 1 +fi + +FILE=$1 + +if [ ! -f "$FILE" ]; then + echo "File ${FILE} not found" + exit 1 +fi + +RESPONSE=$(python3 transferwee.py upload "${FILE}") + +echo "${RESPONSE}" # to terminal diff -Nru flameshot-0.6.0/.travis.yml flameshot-0.6.0+git20190714/.travis.yml --- flameshot-0.6.0/.travis.yml 2018-08-17 12:17:40.000000000 +0000 +++ flameshot-0.6.0+git20190714/.travis.yml 2019-07-14 16:21:21.000000000 +0000 @@ -1,4 +1,4 @@ -dist: trusty +dist: xenial sudo: required language: cpp @@ -13,40 +13,41 @@ env: global: - # Environment variables for packpack + # Environment variables for packaging - PRODUCT=flameshot - - VERSION=0.5.1 + - VERSION=0.6.0 - RELEASE=1 - ARCH=x86_64 -# - DOCKER_REPO=packpack/packpack -# - DOCKER_REPO=vitzy/packpack + # Dockerfile from https://github.com/flameshotapp/flameshot-docker-images - DOCKER_REPO=vitzy/flameshot + # Option: wetransfer.com, file.io, 0x0.st, transfer.sh + - UPLOAD_SERVICE=wetransfer.com -#The actual list of distribution is available on -#https://hub.docker.com/r/packpack/packpack/tags/ -#https://hub.docker.com/r/vitzy/packpack/tags/ -#https://hub.docker.com/r/vitzy/flameshot/tags/ +# The actual list of distribution is available on +# https://hub.docker.com/r/vitzy/flameshot/tags/ matrix: include: - os: linux - env: OS=fedora DIST=27 EXTEN=rpm - services: docker - - os: linux + # 28 env: OS=fedora DIST=28 EXTEN=rpm services: docker - os: linux - # trusty: only for build & test & AppImage - # 14.04 LTS; Qt version is 5.2.1, flameshot not support - env: OS=ubuntu DIST=trusty EXTEN=AppImage + # 29 + env: OS=fedora DIST=29 EXTEN=rpm + services: docker - os: linux # 16.04 LTS env: OS=ubuntu DIST=xenial EXTEN=deb services: docker - os: linux - # 18.04 + # 18.04 LTS env: OS=ubuntu DIST=bionic EXTEN=deb services: docker - os: linux + # 19.04 + env: OS=ubuntu DIST=disco EXTEN=deb + services: docker + - os: linux # 8 env: OS=debian DIST=jessie EXTEN=deb services: docker @@ -54,26 +55,32 @@ # 9 env: OS=debian DIST=stretch EXTEN=deb services: docker + - os: linux + # No docker environment, just for CI build & test + # ubuntu xenial; default Qt version is 5.6.1 + env: OS=ubuntu DIST=xenial EXTEN=other # - os: osx # compiler: clang # osx_image: xcode9.2 before_install: - - chmod +x travis/*.sh - - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then source travis/linux_before_install.sh; fi + - export ROOT_PATH="$(pwd)" + - chmod +x .travis/*.sh + - chmod +x .travis/services/*.sh + - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then source .travis/linux_before_install.sh; fi install: - - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then source travis/linux_install.sh; fi + - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then source .travis/linux_install.sh; fi script: # - git submodule update --init --recursive # - git describe --long - - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then source travis/linux_script.sh; fi -# - if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then source travis/osx_script.sh; fi - - pwd && ls + - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then source .travis/linux_script.sh; fi +# - if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then source .travis/osx_script.sh; fi after_success: - - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then source travis/linux_after_success.sh; fi + - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then source .travis/linux_after_success.sh; fi + - echo "Download URL is $TEMP_DOWNLOAD_URL ." # deploy: # # Deploy packages to Github Release