* added a magnifierwidget
* added option to show magnifier and added option to switch to square shaped magnifier
* integrated magnifierwidget into capture
this could probably be done in a nicer way.
right now the magnifier wont show if you select via the move tool.
Co-authored-by: Silas Dohm <silas@sdohm.xyz>
* Refactored upload history widget to use qt ui files. Cleaned up clang
tidy warnings. Remove copied to clipboard notified.
* fixed some irregularities with the layout
* fixing forward declaration
* working on wayland clipboard
* disabled wayland kde clipboard fix on snap until Kf5 tools are updated
* enable wayland clibboard on fedora
* drop fedora 34 and disable wayland clipboard on suse until it gets a new enough kf5
* 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>
* 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>
* 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>
* Add default file extension configuration
* Format fix
* Implement ValueHandler for setSaveAsFileExtension
* Fix formatting issues
* Add format to properScreenshotPath call
* Fix SaveFileExtension::check
* Fix format
* Move extension layout to Save Path group
* adds a config option to toggle antialiasing for the pin zoom
* fix C++ scope error thanks for @veracioux
* set the default value of antialiasing of pin tool to be true
* fix the clang-format
* Add ConfigHandler::toolSize and setToolSize
* Refactor thickness (now toolSize) in CaptureWidget
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Fix update of tool size while object is drawn
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Rename thickness to tool size across the board
Tool size is the generic term. Depending on the selected tool,
different specialized names are used. This has always been the case
in the config.
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Reorder circle count tool
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* clang-format
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* 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>
* Add invert tool to build commands
* Add icons for invert tool
* Integrate invert tool
* Add shortcut for invert tool
* Add invert tool
* Add translation for invert tool
* Run clang-format
* Update tool to invert a region instead of everything
* Update shortcut for invert tool
* Update button order of inverter and counter
* Update translations for invert tool
* Run clang-format
* Revert "Update translations for invert tool"
This reverts commit c1fd5a162be6c64b26790d53eab3749b3a124bcf.
* Revert "Add translation for invert tool"
This reverts commit b0c1da5f36e844fa8b5f1492f5f507d85bb7aa7b.
* Update drawSearchArea to match pixelate
* Update invert icon to one from Material Design
Co-authored-by: crackcat <>
* Fall back to default keyboard shortcuts
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Add missing shortcuts and clean up
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Remove obsolete method ConfigHandler::shortcuts
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Make --path work correctly with relative paths
Relative paths are taken relative to the working directory of the calling
command, not relative to the daemon's working directory.
* Allow file paths in --path and refactor
* Remove some redundancy
These actions are already performed in the respective functions in
FlameshotDBusAdapter.
* Tweak --path error checker a bit more
* Rework FileNameHandler and update references
The class now has a much simpler interface.
- Screenshot paths are now universally determined by the function
properScreenshotPath
- Some unreferenced methods have been removed
- The documentation of properScreenshotPath documents the changes well.
* Add crude tests for --path
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>
* Add a test for invalid path
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Make tests clearer
Thanks to @mmahmoudian for his review and contribution.
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Fix bug in properScreenshotPath
Auto-numeration did not work when the screenshot was automatically
saved when copied to clipboard.
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Fall back to default pictures location
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Revert "Remove some redundancy"
This was not redundancy. I had actually introduced a bug with this.
This reverts commit 011ef737564892e494518443e6b80ccf3d286ae1.
* Change default path only on interactive save
Previously, the default save path was changed every time a screenshot
was saved. Now, that only happens when it gets saved from the GUI.
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Change --path help text
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Allow other image formats
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Make CaptureWidget::initShortcuts uniform
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Disable window flags in debug builds
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Remove pointer in extendedRect parameter
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Move color initialization to the constructor
* Rename updateButtons to initButtons
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Rename handleButtonSignal to handleToolSignal
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Remove useless code in pixmap()
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Remove obsolete comment
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Move processTool definition inline
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Merge painter, aliasing and process into a function
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Fix inconsistent (non)usage of emit
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Rename nameID to type
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Remove some redundancy in confighandler.cpp
- In `getButtons`: instead of re-adding all the buttons manually, now
the buttons are taken from
`CaptureToolButton::getIterableButtonTypes()` and those we want
unchecked are removed.
- Changed some parts to use `fromButtonToInt` instead of re-implementing
it inline each time
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Revert "Disable window flags in debug builds"
This reverts commit 2adb583359bc0a1fd2d335f2d0e88299a4d1dd65.
* Disable window flags in debug builds
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>