Commit Graph

121 Commits

Author SHA1 Message Date
Haris Gušić
417a1534cf Introduce a config resolver (#2244)
* Add config resolver

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Enable resolver even when using systray

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix bugs

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Do not show resolver for shortcut conflicts

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix build error on MacOS and Windows

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add missing translations

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Replace variable i with row

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Improve presentation

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Disambiguate shortcuts and general settings

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Wrap some strings in tr

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Update tooltips in ConfigResolver

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
2022-01-13 16:01:56 -06:00
Haris Gušić
2b9b988f95 Fix broken copy on upload (#2246)
* Fix broken copy on upload

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add translation

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
2022-01-13 20:19:47 +01:00
Haris Gušić
883e55c52d Fix flameshot not exiting when it should (#2223)
* Remove unused methods from Controller

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix flameshot exit bug

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Remove unnecessary code

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Some more refactoring

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
2022-01-04 08:02:06 -06:00
borgmanJeremy
fcadc02a29 Fix recursive static init (#2196)
* Removed default config for abstract logger that sends a system notification, also cleaned up a useless ifdef

* Send notifications from event loop on Win and Mac (#2197)

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

Co-authored-by: Haris Gušić <harisgusic.dev@gmail.com>
2021-12-28 08:43:17 -06:00
Haris Gušić
36b3bd9639 Implement abstract logger (#2174)
* AbstractLogger base implementation

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Switch most system notifications to AbstractLogger

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Make CLI parser use AbstractLogger

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix annoying QPainter warning in QtColorWidgets

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Remove obsolete TODOs

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix failing windows build

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add missing #include <cassert>

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
2021-12-21 11:59:08 -06:00
Haris Gušić
233c765b1f Reduce dependence on D-Bus (#2003)
* Handle captures without sigslots

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Set {app,organization}Name and version consistently

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Make 'full' dbus-free

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Move CaptureRequest::exportCapture to Controller

We need to wait until the upload widget (or similar widgets) have
finished before exiting. This must be done using a signal. The problem
is that CaptureRequest can't be guaranteed to survive until the widget
has finished what it's doing.

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Use QApplication with the 'full' subcommand

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Do unto 'screen' as we did to 'full'

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add FlameshotDaemon singleton class

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Support clipboard hosting for both pixmaps and text

* Fix upload handling

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Do not show tray icon if not daemon

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Clean up handling of pin task

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Remove annoying Qt warning messages

The messages were caused by the color wheel.

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix small bug in Controller::exportCapture

* Fix --raw output

* Make 'gui' dbus-independent

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix accept on select bug

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix compile error on Windows

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Make it work on Windows

* Remove obsolete function in main.cpp

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Make 'launcher' work without dbus

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* clang-format, sigh

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Enable CLI parsing on MacOS

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Make 'config' work without dbus

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Small refactor of capture request handling

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Remove obsolete DBusUtils

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Remove unused D-Bus sigslots

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Remove D-Bus methods openConfig, autostartEnabled and trayIconEnabled

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Remove D-Bus method requestCapture

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Remove CaptureRequest id mechanism

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix 'launcher' crash

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Handle clipboard notifications properly

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add 'autoCloseIdleDaemon' option

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Document FlameshotDaemon class

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Make 'flameshot gui' run in single-application mode

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add `allowmultipleGuiInstances` config option

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix endless loop with multiple GUI instances

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Move upload confirmation dialog where it belongs

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add the new config options to the GUI as well

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix failing build on Windows

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Handle persistence on MacOS

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* fixed notifications on macos

* Fixed display on macos

* Reformat tests/action_options.sh

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix infinite recursion in tests/action_options.sh

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

Co-authored-by: Dearsh Oberoi <59907159+deo002@users.noreply.github.com>
Co-authored-by: Jeremy Borgman <borgman.jeremy@pm.me>
2021-12-08 22:18:39 +01:00
Haris Gušić
6d9768445f Fix screen grab error (#2139)
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
2021-12-02 17:30:57 -06:00
borgmanJeremy
b8c0b74ea2 Qt5 deprications (#2076)
* working on removing deprecated warnings for Qt6 migration

* tewsting 18.04 fix
2021-11-21 14:40:56 -06:00
LHBosssss
2283b3e783 Enable Screenshot & Screenshot history shortcut changing in MACOS (#2098)
* Enable Screenshot & Screenshot history shortcut changing in MACOS
From issue #1259 and my experience, I've fix and test this feature in my Hackintosh. So now you can change shortcut to take screenshot and show screenshot history (require restart flameshot).
- Default key to take screenshot is "Cmd + Shift + X", screenshot history is "Option + Shift + X".
- Added new translate text "Require restart flameshot".

* - Change message text for screenshot shortcut

* - Format code using clang-format

Co-authored-by: adrienpixodeo <adrien@pixodeo.net>
2021-11-20 20:44:39 -06:00
borgmanJeremy
f675123e0a working on monochrome icon (#2071)
* working on monochrome icon

* Update pipeline

* adjusted icns to be monochrome

* Added 1045 monochrome
2021-11-17 14:28:16 -06:00
Haris Gušić
6432490c31 Add --region option (#2013)
* Fix empty help message bug

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add --region option

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix: initial selection even without --region

* Enable 'full --region'

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Enable 'screen --region'

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Allow negative width/height

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix screen intersection bug

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Change output format of --print-geometry

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
2021-11-08 22:59:46 +01:00
Haris Gušić
988dcab9de Add --pin, --upload, --accept-on-select to CLI (#1970)
* Add --pin option

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add --upload option

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add --accept-on-select option

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix failing build on MacOS

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Clean up option variable names in main

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Remove missing --path error

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add tests for action options

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix file extension config option

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix --print-geometry bug

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Replace Qt::endl with "\n"

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix copy/upload task clipboard conflict

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix endless loop when using --raw and --delay

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix bug in upload handling

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Show dialog after upload if --clipboard is set

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix failing build on Mac and Win

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
2021-10-20 11:48:54 -05:00
Haris Gušić
d1428889b9 Implement config checking (#1859)
* Add error handling functions to ConfigHandler

Refurbished functions setValue and value which were previously unused.
These functions now set/get a setting with error handling.
Currently recognizes only errors recognizable by QSettings.

* Make use of value and setValue in ConfigHandler

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add checker for unrecognized general options

Extraneous config options in [General] will be reported as errors.
Added some placeholder functions to be implemented in future commits.

* Introduce keysFromGroup function

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Check shortcut names for duplicates

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix notification spam

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Implement shortcut conflict checking

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix reading of fallbacks on error

If there is a config error, some values would not be loaded correctly.
Using the newly implemented function ConfigHandler::contains instead of
QSettings::contains solves this issue.

These changes reveal u bug that causes a crash on startup.

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix crashes introduced in previous commit

Because ConfigHandler is a dependency of most other classes,
calling functions from those classes inside ConfigHandler caused
infinite recursions in some cases.

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add config file watcher

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add missing config options

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix bug in shortcut conflict detection

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add error resolved notification

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add GUI error message overlay

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add indicator in config window

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Use ConfigHandler::fileChanged in ConfigWindow

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix watcher sometimes not firing

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Improve config file watching performance

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add new way to handle config

This is only a fundamental implementation. Future commits will replace
everything with this new paradigm.

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix getButtons and related functions

Also refactored related code to use QList instead of QVector because
QSettings does not work well with QVector.

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Make good use of the new way

* Implement proper checking for basic types

Everything is covered, apart from KeySequence.

* Move fallback path to ExistingDir value handler

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Use consistent naming scheme in ConfigHandler

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Implement config getters/setters via macro

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Surround text with tr and clang-format

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix colors being saved obfuscated

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add ValueHandler::represenation

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Move ValueHandler to separate files

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* confighandler.cpp: rename macro CUSTOM to OPTION

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix bug with shortcut conflict checker

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Update docs and fix setAllTheButtons

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Handle filenamePattern properly

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix failing build due to wrong function name

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix QSet error due to Qt version mismatch

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Replace QSharedPointer::get with data for older Qt versions

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix failing build on MacOS and ubuntu 18.04

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add column headers to recognizedGeneralOptions map

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix ubuntu 18.04 error

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix false positive when shortcuts empty

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix wrong shortcut group prefix

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Implement proper shortcut checking

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add shortcut map in ConfigHandler

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Move ConfigShortcuts functions to ShortcutsWidget

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix minor bugs

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add fallback scheme: Pictures, HOME, TMP

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add config --check CLI option

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add config error log to GUI

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Rename ValueHandler::description to expected

* Convert Qt's #AARRGGBB to #RRGGBBAA and vice versa

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Remove obsolete `saveAfterCopyPath`

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix errors in example config

Also added an additional ; in front of actual comments to differentiate
them from commented options.

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Allow special value 'picker' in userColors

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Allow only name, #RRGGBB, and #RRGGBBAA color formats

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
2021-09-15 11:56:01 -05:00
Haris Gušić
584bcd7f6c Add --clipboard to gui subcommand (#1829)
* Add --clipboard to gui subcommand

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Prevent duplicate notification

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
2021-08-20 13:09:06 -05:00
Haris Gušić
1c4f3bdb39 Enable shortcuts with buttons invisible (#1580) (#1800)
* Make `ShortcutsWidget` load all shortcuts

`ShortcutsWidget" now loads shortcuts for all capture widgets,
regardless of enabled state in 'Interface settings'.

Also removed unnecessary indirection which made the API confusing:

- Removed `ConfigHandler::setShortcutsDefault` which was only called
  once on a temporary `ConfigHandler` and hence had no effect

- Removed function `ConfigHandler::shortcuts`

- `ShortcutsWidget` now calls `ConfigShortcuts::captureShortcutsDefault`
  directly instead of through `ConfigHandler::shortcuts`

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Enable shortcuts for hidden buttons

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix crash if ButtonHandler has no buttons

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* obligatory clang-format

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
2021-08-04 11:03:19 -05:00
Haris Gušić
b2ecb70e38 Fix checkboxes in General Config (#1543) (#1793)
* GeneralConf.cpp: Remove redundant initializations

Removed unnecessary setChecked and setValue calls in init* methods which
get called inside updateComponents anyway. Also added missing function
calls in updateComponents. This has exposed more bugs.

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Merge updateComponents and setActualFormData

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix useJpgForClipboard checkbox

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix crash when 'Automatic updates' is checked

The config window used to crash when 'Automatic updates' check box was
interacted with, if the application started with the system tray
disabled.

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Some cleanup

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
2021-08-02 08:56:09 -05:00
Vitaly Zaitsev
0b56f96573 Use Qt native version string comparansion. (#1776)
Signed-off-by: Vitaly Zaitsev <vitaly@easycoding.org>
2021-07-29 08:08:02 -05:00
Boyuan Yang
fbada715af Fix nullptr reference when trayicon is disabled (#1742) 2021-07-22 18:55:57 -05:00
Yurii Puchkov
55e61b8743 Namecheap - Basic objects editing (move, remove, change color, change thickness) (#1539)
* Code refactoring - rename deleteToolwidgetOrClose to deleteToolWidgetOrClose

(cherry picked from commit cc9d71c660fd335e484b8c2c5a4c9ac939a5b643)

* Code refactoring - move part of code from CaptureWidget::paintEvent function into showInitialMessage

(cherry picked from commit 377b716dc4cdc460e385e9a953850c377283db73)

* Code refactoring - move part of code from CaptureWidget::paintEvent function into showInitialMessage

(cherry picked from commit 377b716dc4cdc460e385e9a953850c377283db73)

* Code refactoring - move part of code from CaptureWidget::paintEvent function into drawInactiveRegion, rename showInitialMessage -> drawInitialMessage

(cherry picked from commit 39bf83588db52b9e5b40fddb2b7a9939a64bd19b)

* Re-implement undo/redo feature with a future ability to work with it as with history with access by index (remove/edit not just for a last item)

(cherry picked from commit d6c6cf51c38b8dd8f51f443f3dcb162e96796a66)

* fix - No bubble border for CircleCountTool

(cherry picked from commit 6ef81efd91d9d8d169c1dafd2801fffd2a722ee8)

* fix - Restore Pen and Brush after the rectangle tool (effects Circle tool without it)

(cherry picked from commit 5239925fa5cf69b6755004f3ab8443d091d731c1)

* Tool objects history (undo) list on Utility Panel - added icon to the items

(cherry picked from commit 4181990f2677a9c8b62c844546f4ac708ecac076)

* Update Ukrainian and Russian translations

(cherry picked from commit eae2fe0f5826eda4d44d1616bbd12ff53a9254dd)

* Feature - remove any created object on CaptureWidget

(cherry picked from commit ed2073fa7c2d4e9067668d5a262a067d3ccf9c9a)

* Search tool object on CaptureWidget on mouse click and select it in UtilityPanel

(cherry picked from commit 5a997dd5608d0bf72af1b50bcfa1779336b842ac)

* Optimize tool object search on CaptureWidget

(cherry picked from commit 7cd4872cb4adb29e847c5e3adfdb3a24a240982b)

* Move selection with Ctrl modificator key only, set correct mouse cursor for dragging and selecting tool objects

(cherry picked from commit bf8e47ccbef33bc765820fe64c12168587117ea6)

* Move tool objects based on AbstractTwoPointTool class

(cherry picked from commit 3f041b76d2da9326f099b7109984b75a4ce0df28)

* Move Text tool objects on CaptureWidget

(cherry picked from commit b71b6db9e1a4c64e19a045096bd7df0d5a3f4b8f)

* Move Pencil tool objects on CaptureWidget

(cherry picked from commit 3a269a57bb38bdfea0596f2a8310de6bd5bdb119)

* Code refactoring - clean up unused and some refactoring

(cherry picked from commit af667f1e25c7c363a42952b20580620c0e6d7925)

* Remove - duplicate 'at' class member with int and uint types

(cherry picked from commit 4b5b2f7a75ce568bd23d170b8d8731f630d1bf48)

* Search for an active object BLUR/PIXELATE and activate it on mouse click

(cherry picked from commit 04cbbdd352e41e23edb4ae596173a6d3971ecdb5)

* Increase search radius for text objects

(cherry picked from commit 4f189bc40b71b82d0e1e5d3ff06e6641616abb8c)

* Code refactoring - remove old unused undo/redo backupPixmap

(cherry picked from commit 1b15b9acf514fce854d5e0f467c10a6e14a333a0)

* Add object selection arownd the object on select for tools based on AbstractTwoPointTool

(cherry picked from commit 26fab8ff365ed0d7ff3eee1191d48248e8a05dcd)

* Add object selection arownd the object on select for tools based on AbstractPathTool

(cherry picked from commit bbf53e4c35a58d313d0cd94b24b86c15f5841483)

* Add object selection arownd the object on select for the TextTool

(cherry picked from commit ec5780b5c1ec59fd8924834f67563df36590c0a6)

* Edit color for any selected object

(cherry picked from commit 465a183978f8e8ff0df0e2c5cf77ec3d3115fccc)

* Code refactoring - fix some missprints in MacOS CI

(cherry picked from commit 99ef8a55d4ca812b6217bd15934c276a2ed5aa57)

* Text object selection has wrong size

(cherry picked from commit cd365060f1bc607ee53a77482af50f71d5ffe674)

* Make more noticeable object selection for TwoPoints and Path tools (except arrows)

(cherry picked from commit 67e304474fd116d95ae6138a50c719186b71bf9a)

* Make more noticeable object selection for Arrows

(cherry picked from commit 066ff0a425ebfc2c235ef756057c086cd75a863f)

* Make more noticeable object selection for Text

(cherry picked from commit e5e0afd5853ae2e8169209a0d9a3a6b1ce42f6e1)

* fix - Make more noticeable object selection for Arrow tool

(cherry picked from commit e1028c7c786d7d8b92b2bd7561193ed5be9066c8)

* fix - add '#include <cmath>' for round function

(cherry picked from commit a043036627587d78bbc916a4590e4e0cb9a6173d)

* Add hotkey for removing objects

(cherry picked from commit 13059461d550fbdd7f43d157c3a87fad43989742)

* Add hotkey for removing objects

(cherry picked from commit 13059461d550fbdd7f43d157c3a87fad43989742)

* Code refactoring - remove outdated parts of undo/redo, some optimisation

(cherry picked from commit 8e08cea690dcbadb61efbab4139b4bd43a9dd91a)

* Add operator = for tool objects to be able to implement undo/redo stack based on the concept of full state saving for each step (just objects, not generated images and layers)

(cherry picked from commit 7ffc850883ea97d807514a15d89ac5dd0e45c9f5)

* Implement basic Undo/Redo step based on QUndoStack (without move and change color steps), some other fixes

(cherry picked from commit 818f3d2939fbe5153787612824e40b3b1997297b)

* Add undo/redo stack for changing color

(cherry picked from commit 2b8a4ffc4f5e39d8531611f516a222288f54224b)

* fix - save objects state before color update for undo/redo stack and do not save state until mouse release event

(cherry picked from commit 4ba79d6b96d89a3010f14d0d9759ff98ae407fd1)

* Add object movement to the undo/redo stack

(cherry picked from commit 1eacc35a15487a815a68db6b7ad5daf8bac7adcf)

* fix - undo/redo from first to the latest item (still with a brutal hack)

(cherry picked from commit 421f43ff5361da1d215465e133b52b407829340c)

* Do not close CaptureWidget if some tool object or selection is active

(cherry picked from commit 17fc95e167dd7ac3c17c8ed39c4bbde03301ea9b)

* Don't change color if right click is not in the object selection area

(cherry picked from commit d8ecead647ca0804c5e7555c8ffa3117abc8f3d1)

* Edit thickness for the existing objects

(cherry picked from commit 9ab45497e60b1316bf50d67ca7d29b84cd70f515)

* fix - restore CaptureWidget thickness on object select

(cherry picked from commit 9ff9de5a915eec65bed66a74e3a5ec7f1bee2719)

* Code refactoring - move repeated code to the function 'activeToolObject'

(cherry picked from commit c388d8c8ec2844c2426148a437f6aaad2a1f7923)

* Code refactoring - remove unused lines and many fixes based on Clang-Tidy

(cherry picked from commit 7e19019dbaa185387b90fe9f45c8a65f057cd582)

* Code refactoring - remove unused lines and many fixes based on Clang-Tidy

(cherry picked from commit 7e19019dbaa185387b90fe9f45c8a65f057cd582)

* fix - Circle Counter Bubble numeration can skip some items if CPU is high loaded at that moment

(cherry picked from commit 6242fe8620bd5a46a7291de41ea8ce5465950664)

* Code refactoring - make m_thickness variable in tool objects private and work with it as get/set methods

(cherry picked from commit f36e823864c1af35aa94809515f786a45915e180)

* fix - CircleTool doesn't place on CaptureWidget without mouse move
Code refactoring - make number of variables private for AbstractTwoPointTool and work with them as get/set methods

(cherry picked from commit 874ebc3afd3da77fcb954e83429e88016518cbca)

* CircleCount - make circles more contrast and mouse preview opaque

(cherry picked from commit cebf3b831cf5751cb0b4b9b83f6f63d60b18dc8c)

* fix - CircleCount selection and changing color for existing object

(cherry picked from commit 477c230194b57af9223a3d68c4ac4f5c1bf3566c)

* fix - Move selection area tool cannot be selected

(cherry picked from commit 38662ff86e6a858c02050de1caa37295bb25d574)

* fix - Selection area disappears on click on existing tool out of area

(cherry picked from commit e98c60e226c9883558718f1278879339dc528973)

* Change MacOS hotkey Command+Backspace -> Backspace

(cherry picked from commit aa96b956348a0192179f03a43a0ce5712ce1a965)

* Make rectangle tool with rounded borders (not cut), Make selection tool without rounded edges

(cherry picked from commit 2fd9c2ad9f5d00dcb9204b09989a66309b43f472)

* fix - Thickness doesn't changed for existing object on changing it in side panel

(cherry picked from commit 271731c89185b982a86bb27e3a7bc441a2942c10)

* fix - Sync selection on CaptureWidget when clicking on tool in panel

(cherry picked from commit 9db0c75ec0e92d5fad5bc3856f46f5ed87c6aefd)

* Change selection on mouse down instead of mouse up event

(cherry picked from commit 3e09778b701498498c144c5e5516f746f1c9088a)

* Code refactoring - remove variable m_rightClick from CaptureWidget, use another existing trigger to detect it

(cherry picked from commit 1abc595ce352b8445a943504a7c359cd0830a640)

* fix - Rectangle preview and final objects are not the same

(cherry picked from commit b31905892a60228cae5c8bcde1f71699eca63447)

* fix - Doesn't save image if the 'use fixed path' checkbox is checked

(cherry picked from commit 1470859aa2c4f28f2c45581891534f3fa4bd6f0a)

* fix - Latest Uploads max size value doesn't restore after reset/import settings

(cherry picked from commit fa72bacfc0bb12313dd351ee246dd567dfc3f3c8)

* fix - impossible to disable the keyboard shortcut by clicking Delete button

(cherry picked from commit 74d36e4b3a333cb81ffb4ad93a2bd5465e79cb94)

* fix - MacOS - Increase and Decrease Size tool icon colors are not changed (dark/light) when changing main tool background color

(cherry picked from commit e48b685c900540a9cd353f71290be04491621fc7)

* fix - Selected region control points cannot be dragged on the screen corners

(cherry picked from commit 08bf02b5ee096c14d10c15853543749d58c51ef4)

* fix - Object selects if mouse pointer above any object when TextTool is active

(cherry picked from commit b7a6a7efc8c3a77c55039721ab0cf388973c25d5)

* fix - Test Tool doesn't close editor on next text item, you can see two editors and one of them will be never closed

(cherry picked from commit eb12f76fd7121d1917659485673305684de523c8)

* Code refactoring - remove function in the CaptureToolObjects class with the same functional

(cherry picked from commit 1a108f7be48d5b4d89960ac4a5f4e82c03762cbc)

* Code refactoring - CaptureWidget::mousePressEvent function is split into a few, code became more readable

(cherry picked from commit dc850b3daa00fa173126d86403c35f3c67c448e6)

* optimization - remove unnecessary calls of CaptureWidget::drawToolsData

(cherry picked from commit c2432bd5602657233ee9506e84a7806bafeb6f68)

* fix - Move tool doesn't work if any object is selected
fix - Active tool stays active if existing object is selected in the Tool Settings panel

(cherry picked from commit 6154feba575f79a06082f72b5c45a869c8d08f42)

* fix - App freezes for a while when changing thickness of the pixelate to the minimal value

(cherry picked from commit 3a1c519c8309b831e4cc4f11b9014b1a9599ba93)

* fix - Text Tool doubles on press ESC when text editing field is active

(cherry picked from commit 00bdebff75a0178a46f38606eec4921fdf2f5917)

* fix - Image is pinned/saved with object selection frame if there is one

(cherry picked from commit 81871860720fa0527f8dcabe1b274b3f03818b7c)

* fix - Object line thickness changes according to previously modified object when switching between objects via object list

(cherry picked from commit a4a367d30e18a743f0df849e7db1aa2dc20af2a6)

* fix - Configuration: Filename doesn't set default value on clear

(cherry picked from commit 289663c0c85f4bae98c1a19a7a05fb1029738c12)

* Update README.md - Global shortcut for Ubuntu 20.04

(cherry picked from commit 3bee0aa0ac937c00113f2bcca818a9a57e6c5530)

* fix - Saved screenshot has selection if some object is selected on Save

(cherry picked from commit e53bb33e804cc7de1102a1ab3069bfb849174b73)

* fix - Saved screenshot has selection if some object is selected on Upload

* fix - Rename "Reset" to "Restore" in file settings for restoring saved file name rules in the configuration widget

(cherry picked from commit d2ac5a330fca902b832fce163e4f5f138dbbcc6b)

* Update Ukrainian and Russian translations

* fix - Shapes are displayed as semi-empty at the very beginning of drawing if the line is thick

(cherry picked from commit d8b09c5d5233fefe3181a69f5200198815bc3ec1)

* fix - MacOS - Button "Tool Settings" is not visible on some displays if displays are vertically aligned

(cherry picked from commit 6af590a859b2708177c34c3ff37725905f4c3bec)

* fix - Incorrect selection border for Rectangle/Pixelate tool

(cherry picked from commit c908d3b67c5d8e2188d2699ac11951110493b756)

* Code refactoring - replace magic numbers

(cherry picked from commit c8e1ce345adb1646659e4e90d314916532d5e67a)

* fix merge conflicts for Internationalization files

* fix - thickness shouldn't be less than one

(cherry picked from commit d8ea8a0db7fffcec601dd3139c57198ba15b64b7)

* Update copyright info

Co-authored-by: Yuriy Puchkov <yuriy.puchkov@namecheap.com>
2021-04-19 19:28:10 -05:00
Jeremy Borgman
a2a866669f Moved check to a more reasonable place, fixed issue where the api check could still happen from a constructor 2021-03-17 11:14:08 -05:00
Jeremy Borgman
b3aa917bb0 Dont query github api if check for updates is disabled 2021-03-17 11:14:08 -05:00
Jeremy Borgman
9af391b2e9 force flameshot icon on info popup 2021-03-15 08:14:12 -05:00
Yuriy Puchkov
e3b1d55fd8 fix - 'Show tray icon' checkbox is automatically unchecked when checking some other checkboxes
(cherry picked from commit 3803f6725d3d7f95f36299a65557f5bfb2d15f2a)
2021-02-24 17:32:05 +02:00
Boyuan Yang
a9c7cc7b04 Use SPDX-License-Identifier
closes: #1374 .

Use SPDX short-form identifiers instead of lengthy copyright
header to document per-file license and copyright.

This commit updates all files under src/ directory where applicable
as well as org.flameshot.Flameshot.metainfo.xml.
2021-02-20 19:22:53 -05:00
Boyuan Yang
ee2ef05178 Do not include QHotKey header on non-Mac system
QHotKey is only used on macOS. As a result, do not unconditionally
include QHotKey headers.
2021-02-20 08:01:02 -05:00
Yuriy Puchkov
cb02578a9e fix - Hide/show tray icon makes duplicates in the tray menu
(cherry picked from commit 93e3a125be3602f2fd95d02fb0e11f11b1f059be)
2021-02-18 18:51:33 +02:00
Yuriy Puchkov
894556d681 Code refactoring - remove Q_OS_MAC64 (is not required, is covered by Q_OS_DARWIN)
(cherry picked from commit e511b521cec6edd9f77916c6ee753329326a5f91)
2021-02-17 18:46:12 +02:00
Yuriy Puchkov
a5cd4cd1bc Code refactoring - remove Q_OS_MACX (is not required, is covered by Q_OS_DARWIN)
(cherry picked from commit 00b9aae5266aaffb9a01a6f689e1829ae8218bdc)
2021-02-17 18:46:12 +02:00
Yuriy Puchkov
a893fdfc75 Code refactoring - remove Q_OS_MAC (deprecated synonym for Q_OS_DARWIN)
(cherry picked from commit aff1649670aa5ba64f2927933a29c62b06fee21f)
2021-02-17 18:46:12 +02:00
Yuriy Puchkov
dc7f62ab8d Fix - MacOS - get currentScreen on the edge bottom and right returns nullptr and application crashes
(cherry picked from commit 01ae74fbed34849db485db53ffbdf4a938ebea8e)
2021-02-17 18:46:12 +02:00
Yuriy Puchkov
0425be7a44 Remove possibility of the infinitive loop on screen capture and remove activeModalWidget check on screen capture for MacOS
(cherry picked from commit afaed07ae9b3c729e6082cc6b325aeca1dc08436)
2021-02-17 18:46:12 +02:00
Yuriy Puchkov
3973c2f38d Remove possibility of the infinitive loop on screen capture and remove activeModalWidget check on screen capture for MacOS
(cherry picked from commit 305e054c9c97e47e092ad974a683cdf5753ab4a9)
2021-02-17 18:46:12 +02:00
Yuriy Puchkov
1ad6f9ff74 Add a few additional check on initializing trayMenu, possibly they will fix rare issue with frozen application on MacOS
(cherry picked from commit bf5741a9145659e9fc5489f26a62c9757b824abe)
2021-02-17 18:46:12 +02:00
Yuriy Puchkov
ecb88380a6 MacOS - Catalina - Tray icon and menu bar stays on screen when taking screenshot
(cherry picked from commit 517d34d2231da99d238149688ebddc254f35be98)
2021-02-17 18:46:12 +02:00
Yuriy Puchkov
540e407eb7 Add option to disable feature for checking for a new update
(cherry picked from commit d26dd55dba066aa4884b00b55173597f49309f0d)
2021-02-17 18:46:12 +02:00
Yuriy Puchkov
c3ee36f809 fix - MacOS - Take screenshot option sometimes doesn't work (because of Mission Control feature)
(cherry picked from commit fdb086a5eb3106200fe4eb751eaa6d641ede25c4)
2021-02-17 18:46:12 +02:00
Jeremy Borgman
9581a698af resolved merge conflicts 2021-01-15 19:02:16 -06:00
Jeremy Borgman
92b9379d69 Made changes after review of merge 2021-01-15 17:54:56 -06:00
brimston3
e07829ec55 Emit dbus captureSaved signal when saving files
New captureSaved signal contains the request ID and canonical path of the saved
file. This allows a dbus listener interested in postprocessing files access to
the path most recently written.
2021-01-15 12:49:33 -06:00
Jeremy Borgman
73fe772b70 resolving merge conflicts 2021-01-08 10:19:53 -06:00
Yuriy Puchkov
fa096560b6 MacOS - On 2 and more displays notification disappears too quickly 2020-12-23 11:57:45 +02:00
Yuriy Puchkov
6576f0ae47 fix - ignore available updates by "less" instead of "not equal" 2020-12-18 16:46:26 +02:00
Yuriy Puchkov
2114ad3c32 fix - 'update version notification' widget position and event handler for Linux 2020-12-18 15:33:00 +02:00
Yuriy Puchkov
aee8a55292 fix - update version notification logic 2020-12-18 14:55:45 +02:00
Yuriy Puchkov
162b864353 MacOS - Global shortcuts 2020-12-17 12:25:08 +02:00
Yuriy Puchkov
47c99774ce Add timer for auto-checks for available updates (every 24 hours) 2020-12-11 17:50:53 +02:00
Yuriy Puchkov
784da1a652 Update to a new version notification 2020-12-11 15:00:11 +02:00
Yuriy Puchkov
84e4a9c9c6 MacOS - QSystemTrayIcon does not show context menu on primary screen on Catalina, on BigSur is ok and use native menu 2020-12-04 14:15:06 +02:00
Yuriy Puchkov
719719f36b MacOS and Win - fix tray menu 2020-12-03 15:11:02 +02:00
Yuriy Puchkov
c783b66672 MacOS - QSystemTrayIcon does not show context menu on primary screen 2020-12-02 17:45:12 +02:00