Commit Graph

35 Commits

Author SHA1 Message Date
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
Ivan
04cfab4f4d fix: Code typo (#1799) 2021-08-03 20:41:23 -05:00
nullobsi
743f17dd2e clang-format 2021-03-08 11:07:48 -06:00
nullobsi
a3b0cad881 fix compatibility fot Qt < 5.11 2021-03-08 11:07:48 -06:00
nullobsi
6b3e551ce6 use unique token & subscribe to signal before calling screenshot 2021-03-08 11:07:48 -06:00
Yuriy Puchkov
f54538ee1e Code refactoring - ScreenGrabber: 'screen' has been explicitly marked deprecated
(cherry picked from commit 9ffb3fff8cd7ee679070f9e4bfb931b88c960ff6)
2021-03-01 13:14:12 -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
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
nullobsi
ddf69010d8 code formatting 2021-02-02 19:22:05 -06:00
nullobsi
799c4c9908 use device pixel ratio on screenshot to properly draw the image 2021-02-02 19:22:05 -06:00
nullobsi
b4ba730732 disconnect object when done 2021-02-02 19:22:05 -06:00
nullobsi
4c23d2e45d properly exit event loop 2021-02-02 19:22:05 -06:00
nullobsi
7a18dc096a preliminary support for sway/wlroots compositors 2021-02-02 19:22:05 -06:00
Yuriy Puchkov
293525f5b6 Fix - MacOS capture area, full screen mode, system tray area, etc 2020-11-24 07:39:51 -08:00
Peter Cai
e1214e23e5 correct position of QScreen geometry on HiDPI multi-headed setup 2020-09-24 18:17:43 -05:00
Jeremy Borgman
0d5386edd4 Changed clang format to new agreement 2020-09-24 07:53:28 -05:00
Jeremy Borgman
c8d15205be reformatted to Mozilla code style 2020-09-04 20:40:45 -05:00
lupoDharkael
42619158fa Update copyright year 2019-03-04 16:38:45 +01:00
Alfredo Ramos
ee2f583acd Fix some issues detected by Clazy (#384)
* Fix old style connect

* Fix unneeded QString memory allocations
2018-10-24 01:04:42 +02:00
lupoDharkael
affba85666 Remove Wayland duplicated screenshots after dbus calls 2018-09-28 23:31:22 +02:00
Peter Cai
21670e3344 screengrabber: fix devicePixelRatio detection (#277) 2018-07-22 15:30:52 +02:00
Danilo Egêa Gondolfo
df3958e43a Use defined(Q_OS_LINUX) || defined(Q_OS_UNIX) where applicable to support BSD OSs. (#264) 2018-07-01 13:45:49 +02:00
lupoDharkael
c766b3e048 Add capture individual screens option 2018-05-08 21:23:09 +02:00
lupoDharkael
48c058782a Implement single method capture request
The core now has a method requestCapture, which receives a
CaptureRequest object with all the needed information.
This reduces code duplication in future features.
2018-04-29 11:27:55 +02:00
Peter Schuller
48106975fb Fix case statement (so we build with clang). (#101) 2018-01-22 21:15:21 +01:00
lupoDharkael
89ac281033 Fix whitespace consistency 2018-01-19 00:58:40 +01:00
lupoDharkael
3a38abc2ab Add missing license information 2018-01-12 18:10:02 +01:00
lupoDharkael
514195ff41 Don't hardcode temp path 2018-01-12 17:55:19 +01:00
lupoDharkael
77aa604127 Remove dbus from Windows build 2017-12-26 02:00:07 +01:00
lupoDharkael
a5df852268 Add experimental support for captures with compositor 2017-12-15 18:16:33 +01:00
lupoDharkael
bb6ac04d60 Add --raw flag
Updated dbus API. Now it sends a signal with every capture, it may
be captureFailed or a captureTaken which contains the raw image
bytes in png format. You have to add an id to the screenshot calls
so it will be returned as a way to know the origin of the signal.
2017-11-09 18:14:04 +01:00
lupoDharkael
4a56f44bb9 Refactor in the mechanism of saving and exporting
- new imgur upload interface.
- rework for a better code structure. It still needs another change separating the Controller from the code dedicated to export data to the system.
- created the concept of "worker", component used to do some work based on a screenshot.
2017-08-16 13:44:33 +02:00