Commit Graph

108 Commits

Author SHA1 Message Date
El Thoro
67042f2836 Enable Singleapplication again (#4030)
* Enable SingleApplication again (compile flag; enabled by default)

* Enable SingleApplication again (compile flag; enabled by default)

* Cleanup: Removed /external/ subfolder
2025-06-22 12:32:02 -05:00
El Thoro
a56beb34d3 Support dark mode in Windows (#3984) 2025-06-08 19:49:14 -05:00
Jeremy Borgman
a23034bec7 Merge branch 'master' into qt6_2025 2025-06-03 15:56:49 -05:00
Jeremy Borgman
3fa9ce789f Apease clange format 2025-06-01 12:00:46 -05:00
El Thoro
49ff3de496 Fix further Qt 6 deprecations (#3966)
* Replace qAsConst

* Wayland hack on Gnome not needed anymore with Qt 6

* Fix QLibraryInfo and QFontDatabase deprecations

* Fix QKeySequence
2025-06-01 11:53:36 -05:00
Jeremy Borgman
b4b00ec3fa temporarily disable QtSingleApplication 2025-06-01 09:25:04 -05:00
El Thoro
277eb2f437 Fixing deprecation for future Qt 6 support (#3962)
* Replace foreach

* Replace QRegExp with QRegularExpression

* Replace QApplication::fontMetrics

* Replace QColor::isValidColor

* Replace canConvert(QVariant)

* Replace QString::midRef and QCharRef

* Add TODO for replacing QDesktopWidget for Qt 6

* Add TODO for replacing QTextCodec for Qt 6

* Fix QWidget::enterEvent for Qt 6

* qRegisterMetaTypeStreamOperators done automatically in Qt 6

* Fix QWidget::mapToGlobal for Qt 6

* Migrate QDesktopWidget replacement from old qt6 branch

* Drop Qt 5 support
2025-05-31 12:42:40 -05:00
Nicholas Morris
eefefe187a Adds Support for Command-Line on Windows (#3699)
* + cli support on windows

- removes the preprocessor macro that prevented arg
  parsing on Windows
- adds windows-cli.cpp as src for a wrapper exe
- adds flameshot-cli target into cmake when building
  on Windows
- updates README

* updates PR

+ support for unicode characters in cli args
+ additional clarification in README re: flameshot-cli
+ new workaround for spaces in _popen path; works with relative output paths

* fix EOL

* updated flameshot.exe path construction

avoids using the hard-coded length of flameshot-cli.exe

* fix whitespace (clang)
2025-05-31 12:39:02 -05:00
El Thoro
134238b8eb Fixing several Clazy warnings (#3960)
* Use multi-arg

* Unused vaiables

* Missing emit

* Range loop reference

* Don't use connect by name
2025-05-30 20:11:12 -05:00
borgmanJeremy
c2acf30ef2 Add config cli option to enable or disable notifications (#3942) 2025-05-24 08:21:55 -05:00
borgmanJeremy
74bb870f18 Fix issue when config subcommand toggles autostart (#3940) 2025-05-11 18:11:18 -05:00
Daniel Fox
90fd5fcb2e Remove QT+GNOME+Wayland 'xcb' hack on fixed Qt versions (#3683)
* Bypass the Qt GNOME/Wayland workaround on fixed Qt versions

We implement code on GNOME desktops to force the
QT_QPA_PLATFORM to be 'xcb'; this works around a
clipboard-related bug on GNOME+Wayland+Qt.

This bug was fixed (or worked around) in Qt 5.15.2,
so we implement a version check; if the runtime Qt
version is < 5.15.2, still force the workaround;
otherwise, we don't need the workaround so we skip
it.

* Reformat with clang-format
2025-05-10 20:07:12 -05:00
j4k0xb
a293034a50 Add option to disable abort notification (#3610) 2025-05-10 16:08:23 -05:00
yychi
d6d6f09294 Correct the exit value on abort (#3321) (#3786)
`flameshot gui` exits with 0 on abort, we can use the return value of `qApp->exec()` in `requestCaptureAndWait`.
2025-01-31 11:27:11 +02:00
Marcel de Vries
f54d4c7f0a Pass argc as reference to reinitializeAsQApplication (fixes #3367) (#3370)
* Pass argc as reference to reinitializeAsQApplication (fixes #3367)

* Formatting
2023-10-09 22:08:11 +02:00
Vlad Rakhmanin
a8a3fd963c Change text references from "arguments" to "subcommands" (#3360) 2023-10-09 22:07:17 +02:00
Haris Gušić
9557cd68ae Make loading of languages consistent across invocation types (#3313) 2023-09-17 11:16:49 +03:00
Acpear
3b93863cf1 done "TODO use abstract logger" in src/main.cpp (#3044) 2023-01-22 18:38:45 +01:00
Jeremy Fleischman
ff7028d8ab Fix documentation of flameshot gui --help (#2949)
In
6432490c31,
the format of `--print-geometry` changed from `W H X Y` to `WxH+X+Y`,
but it looks like we forgot to update the docs accordingly.
2022-10-16 07:50:44 -05:00
Alaskra
44b19a90e1 fix issue about externalWidget launchapp (#2698) 2022-06-29 17:59:57 -05:00
Alaskra
fb42ad5c25 fix unexpected close when launch external app (#2617)
* fix unexpected close when launch external app

* update
2022-06-10 08:46:21 -05:00
borgmanJeremy
46801d933a Added the ability to cache the last region (#2615)
* Added the ability to cache the last region

* adding cli option

* addressed typo comments and applied clang-format
2022-06-01 09:18:54 -05:00
borgmanJeremy
0c9a58fad0 fixed segfault when screen number exceeds screen count (#2534) 2022-04-07 10:31:32 -05:00
Haris Gušić
54690d5be8 Major Controller refactor (#2295)
* Change Controller interface to mimic the CLI

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

* Remove obsolete handleCaptureTaken

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

* Extract system tray icon into separate class

The implementation is not complete and full of bugs

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

* Remove Controller::handleCaptureFailed

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

* Fix a QObject connection

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

* Controller: remove unused includes

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

* Make check for updates work again

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

* Move functionality to daemon and tray icon

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

* Rename SystemTray to TrayIcon

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

* Add missing trayicon.* files

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

* Add missing QDesktopWidget

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

* Fix syntax errors

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

* Add missing include

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

* Include missing QOperatingSystemVersion on Mac

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

* Move update checking to daemon

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

* Remove obsolete method Controller::doLater

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

* Some cleanup

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

* Rename Controller to Flameshot

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

* Final touches

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
2022-03-25 09:47:21 -05:00
borgmanJeremy
0ac48f5c4b Clang tidy (#2372)
* Added missing braces

* applied some clang modernize

* clarified auto pointer

* clang-tidy
2022-02-06 12:12:09 -06:00
Haris Gušić
ab32f40348 Add fish completions (#2247)
* Add fish completions

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

* Fix minor bug in `flameshot config` output

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

* Add fish completions to install target

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

* Add release note

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

* Update rpm package spec

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
2022-01-14 22:55:56 +01:00
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
borgmanJeremy
ca70be773a remove SPD logging framework in favor of abstract logger (#2178) 2021-12-21 13:33:07 -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
Vitaly Zaitsev
120ba0bac3 Always use native Wayland backend on KDE Plasma. (#2131)
This will fix issues with broken hotkeys with KDE Plasma on Wayland.

Partially reverts 5d66405ed0e0fb871c174b8c1dfffb4a4d48034e commit.

Signed-off-by: Vitaly Zaitsev <vitaly@easycoding.org>
2021-11-30 10:09:35 -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
borgmanJeremy
5a0c5c389a Fix KDE Wayland Screenshots (#2045)
* testing wayland

* clang-format
2021-11-05 13:33:58 -05: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ć
b05b028861 Miscellaneous small fixes (#1972)
* m_captureWindow->activateWindow(), raise()

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

* Revert "m_captureWindow->activateWindow(), raise()"

This reverts commit 36320aa38a9584864a5fab32a2ce4872ff5ad072.

* screen --number: indicate 0-indexation

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

* Fix color update bug

Also refactored SidePanelWidget sigslots related to color change.

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

* Stop creating empty flameshot.conf file

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
2021-10-17 17:38:16 +02:00
Haris Gušić
5ee85ed5c0 Add requestCapture DBus call
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
2021-10-08 19:11:22 +02:00
Haris Gušić
151f6e35b4 Refactor CaptureRequest
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
2021-10-08 19:11:22 +02: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ć
22c9ea1f47 Do not interpret empty --path as current dir (#1838)
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
2021-08-24 10:27:44 -05:00
Haris Gušić
41ca51bc10 Improve screenshot path handling (#1815)
* 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>
2021-08-20 13:10:12 -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
Pavel Kalugin
6a2765f15e CMake: add option to use external singleapplication (#1598) 2021-05-02 13:24:06 -05:00
nullobsi
cb13ebc625 fix windows build 2021-03-08 11:07:59 -06:00
nullobsi
31f997aceb fix XDG desktop check 2021-03-08 11:07:59 -06: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
Yuriy Puchkov
ebdb3743dd 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
dd54d028a1 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
Jeremy Borgman
ddd4eb5b0c added wayland XCB hack for clipboard 2021-02-05 19:43:58 -06:00
Jeremy Borgman
73fe772b70 resolving merge conflicts 2021-01-08 10:19:53 -06:00