Browse Source

Merge remote-tracking branch 'origin/master'

Hosted Weblate 3 years ago
parent
commit
9240c756ca

+ 18 - 6
.github/workflows/Linux-pack.yml

@@ -50,6 +50,24 @@ jobs:
               symbol: buster,
               arch: armhf
             }
+          - {
+              name: debian-11,
+              os: debian,
+              symbol: bullseye,
+              arch: amd64
+            }          
+          - {
+              name: debian-11,
+              os: debian,
+              symbol: bullseye,
+              arch: arm64
+            }       
+          - {
+              name: debian-11,
+              os: debian,
+              symbol: bullseye,
+              arch: armhf
+            }
           - {
               name: ubuntu-20.04,
               os: ubuntu,
@@ -284,12 +302,6 @@ jobs:
       fail-fast: false
       matrix:
         dist:
-          - {
-              name: fedora-32,
-              os: fedora,
-              symbol: 32,
-              arch: x86_64
-            }
           - {
               name: fedora-33,
               os: fedora,

+ 2 - 0
CMakeLists.txt

@@ -61,6 +61,8 @@ set(RUN_IN_PLACE
         ${DEFAULT_RUN_IN_PLACE}
         CACHE BOOL "Run directly in source directory structure")
 
+
+option(FLAMESHOT_DEBUG_CAPTURE "Enable mode to make debugging easier" OFF)
 option(GENERATE_TS "Regenerate translation source files" OFF)
 option(USE_EXTERNAL_SINGLEAPPLICATION "Use external QtSingleApplication library" OFF)
 option(USE_EXTERNAL_SPDLOG "Use external spdlog library" OFF)

+ 3 - 1
README.md

@@ -211,7 +211,9 @@ These shortcuts are available in GUI mode:
 
 ### Global
 
-If you want use Flameshot as a default screenshot utility, chances are you want to launch it using the <kbd>Prt Sc</kbd> key. Flameshot doesn't yet offer a fully-automated option to do so, but you can configure your system to do so.
+Flameshot uses <kbd>Print screen</kbd> (Windows) and <kbd>cmd</kbd>-<kbd>option</kbd>-<kbd>shift</kbd>-<kbd>4</kbd> (macOS) as default global hotkeys.
+
+On Linux, Flameshot doesn't yet support <kbd>Pr Scr</kbd> out of the box, but with a bit of configuration you can set this up:
 
 #### On KDE Plasma desktop
 

+ 2 - 0
data/dbus/org.flameshot.Flameshot.xml

@@ -5,6 +5,7 @@
       <!--
         graphicCapture:
         @path: the path where the screenshot will be saved. When the argument is empty the program will ask for a path graphically.
+        @toClipboard: Whether to copy the screenshot to clipboard or not.
         @delay: delay time in milliseconds.
         @id: identificator of the call.
 
@@ -13,6 +14,7 @@
     -->
     <method name="graphicCapture">
       <arg name="path" type="s" direction="in"/>
+      <arg name="toClipboard" type="b" direction="in"/>
       <arg name="delay" type="i" direction="in"/>
       <arg name="id" type="u" direction="in"/>
     </method>

+ 3 - 1
data/graphics.qrc

@@ -78,5 +78,7 @@
         <file>img/material/white/plus.svg</file>
         <file>img/material/black/minus.svg</file>
         <file>img/material/white/minus.svg</file>
+        <file>img/material/black/invert.svg</file>
+        <file>img/material/white/invert.svg</file>
     </qresource>
-</RCC>
+</RCC>

+ 5 - 0
data/img/material/black/invert.svg

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"  width="24" height="24" viewBox="0 0 24 24">
+   <path fill="#000000" d="M12,19.58V19.58C10.4,19.58 8.89,18.96 7.76,17.83C6.62,16.69 6,15.19 6,13.58C6,12 6.62,10.47 7.76,9.34L12,5.1M17.66,7.93L12,2.27V2.27L6.34,7.93C3.22,11.05 3.22,16.12 6.34,19.24C7.9,20.8 9.95,21.58 12,21.58C14.05,21.58 16.1,20.8 17.66,19.24C20.78,16.12 20.78,11.05 17.66,7.93Z" />
+</svg>

+ 5 - 0
data/img/material/white/invert.svg

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"  width="24" height="24" viewBox="0 0 24 24">
+   <path fill="#ffffff" d="M12,19.58V19.58C10.4,19.58 8.89,18.96 7.76,17.83C6.62,16.69 6,15.19 6,13.58C6,12 6.62,10.47 7.76,9.34L12,5.1M17.66,7.93L12,2.27V2.27L6.34,7.93C3.22,11.05 3.22,16.12 6.34,19.24C7.9,20.8 9.95,21.58 12,21.58C14.05,21.58 16.1,20.8 17.66,19.24C20.78,16.12 20.78,11.05 17.66,7.93Z" />
+</svg>

+ 19 - 0
docs/Sway and wlroots support.md

@@ -34,3 +34,22 @@ This is usually caused by flameshot receiving no response from the desktop porta
 Q) Flameshot takes one screenshot, then won't take anymore!
 
 A) There is a bug in xdg-desktop-portal-wlr and Flameshot causing calls with the same token to fail. If you see a sdbus vtable error in the xdpw logs, either used the [patched version](https://github.com/nullobsi/xdg-desktop-portal-wlr/tree/improve-screenshot) or update Flameshot to the latest master.
+
+# River wlroots support
+
+Like mentioned above, flameshot now works on wlroots based Wayland compositors, however, there is a weird problem with river and that is when setting `XDG_CURRENT_DESKTOP=river`, flameshot won't work. The fix is you need to trick flameshot that you are on `sway`. Hence, you need to run river like so:
+
+```sh
+XDG_CURRENT_DESKTOP=sway dbus-run-session river
+```
+
+and add the following on your config such as in `$HOME/.config/river/init`
+
+```
+riverctl float-filter-add "flameshot"
+```
+
+Otherwise, flameshot will not take all of the screen and tiles its window instead like a normal application. Note however, that some clipboard stuff is broken so it might be good to save your screenshot as a file while having it copied to a clipboard in case if clipboard does some weird stuff like not pasting the overall screenshot.
+
+#### For more information, please refer to https://github.com/emersion/xdg-desktop-portal-wlr/wiki/%22It-doesn't-work%22-Troubleshooting-Checklist
+

+ 3 - 3
docs/shortcuts-config/flameshot-shortcuts-kde

@@ -24,7 +24,7 @@ Type=SIMPLE_ACTION_DATA
 ActionsCount=1
 
 [Data_1_1Actions0]
-Arguments='Pictures/Screenshots' 0 0
+Arguments='Pictures/Screenshots' false 0 0
 Call=graphicCapture
 RemoteApp=org.flameshot.Flameshot
 RemoteObj=/
@@ -53,7 +53,7 @@ Type=SIMPLE_ACTION_DATA
 ActionsCount=1
 
 [Data_1_2Actions0]
-Arguments='Pictures/Screenshots' 3000 0
+Arguments='Pictures/Screenshots' false 3000 0
 Call=graphicCapture
 RemoteApp=org.flameshot.Flameshot
 RemoteObj=/
@@ -102,7 +102,7 @@ Type=SHORTCUT
 Uuid={3c7ead73-00ad-4f90-bdba-5d15a70b8b43}
 
 [Data_1_4]
-Comment=Take a full-screen (all monitors) screenshot and copy it to the clipboard
+Comment=Take a full-screen (all monitors) screenshot and copy it to the clipboard and ask where to save
 Enabled=true
 Name=Take full-screen screenshot and copy it to clipboard
 Type=SIMPLE_ACTION_DATA

+ 101 - 66
packaging/rpm/flameshot.spec

@@ -1,120 +1,155 @@
+#
+# spec file for package flameshot on fedora, rehl, opensuse leap 15.x
+#
+
+# fedora >= 30, rhel >=7
+%define is_rhel_or_fedora (0%{?fedora} && 0%{?fedora} >= 30) || (0%{?rhel} && 0%{?rhel} >= 7)
+# openSUSE Leap >= 15.2
+%define is_suse_leap (0%{?is_opensuse} && 0%{?sle_version} >= 150200)
+
 Name: flameshot
 Version: 0.10.1
+%if %{is_rhel_or_fedora}
 Release: 1%{?dist}
+%endif
+%if %{is_suse_leap}
+Release: 1
+%endif
+License: GPLv3+ and ASL 2.0 and GPLv2 and LGPLv3 and Free Art
 Summary: Powerful yet simple to use screenshot software
-Summary(eu-ES): Potente pero simple de usar software de capturas
-
-%global sourcename flameshot
+URL: https://github.com/flameshot-org/flameshot
+Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
 
-Group: Application
-License: GPLv3
-URL: https://github.com/flameshot-org/%{sourcename}
-Source0: https://github.com/flameshot-org/%{sourcename}/archive/v%{version}.tar.gz
-
-#%%define _binaries_in_noarch_packages_terminate_build   0
-#BuildArch: noarch
-
-%if 0%{?is_opensuse}
-%if 0%{?suse_version} >= 1500
+BuildRequires: cmake >= 3.13.0
 BuildRequires: gcc-c++ >= 7
+BuildRequires: fdupes
+%if %{is_suse_leap}
 BuildRequires: update-desktop-files
-%else
-BuildRequires: gcc7 >= 7.4.0
-BuildRequires: gcc7-c++ >= 7.4.0
+BuildRequires: appstream-glib
 %endif
-BuildRequires: libqt5-qttools-devel >= 5.9.0
-BuildRequires: libqt5-linguist >= 5.9.0
-%else
-BuildRequires: gcc-c++  >= 7.4.0
-%endif
-
-%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version}
-BuildRequires: qt5-qttools-devel >= 5.9.0
-BuildRequires: qt5-linguist >= 5.9.0
+%if %{is_rhel_or_fedora}
+BuildRequires: libappstream-glib
+BuildRequires: ninja-build
 %endif
+BuildRequires: desktop-file-utils
 
-BuildRequires: cmake  >= 3.13.0
-BuildRequires: pkgconfig
-BuildRequires: pkgconfig(Qt5Core) >= 5.9.0
-BuildRequires: pkgconfig(Qt5Gui)  >= 5.9.0
-BuildRequires: pkgconfig(Qt5DBus) >= 5.9.0
-BuildRequires: pkgconfig(Qt5Network) >= 5.9.0
-BuildRequires: pkgconfig(Qt5Widgets)  >= 5.9.0
-BuildRequires: pkgconfig(Qt5Svg)  >= 5.9.0
+BuildRequires: cmake(Qt5Core) >= 5.9.0
+BuildRequires: cmake(Qt5DBus) >= 5.9.0
+BuildRequires: cmake(Qt5Gui) >= 5.9.0
+BuildRequires: cmake(Qt5LinguistTools) >= 5.9.0
+BuildRequires: cmake(Qt5Network) >= 5.9.0
+BuildRequires: cmake(Qt5Svg) >= 5.9.0
+BuildRequires: cmake(Qt5Widgets) >= 5.9.0
 
 
-%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version}
+Requires: hicolor-icon-theme
+%if %{is_rhel_or_fedora}
 Requires: qt5-qtbase >= 5.9.0
 Requires: qt5-qttools >= 5.9.0
-Requires: qt5-qtsvg >= 5.9.0
+Requires: qt5-qtsvg%{?_isa} >= 5.9.0
 %endif
-%if 0%{?is_opensuse}
+%if %{is_suse_leap}
 Requires: libQt5Core5 >= 5.9.0
 Requires: libqt5-qttools >= 5.9.0
 Requires: libQt5Svg5 >= 5.9.0
 %endif
-Requires: hicolor-icon-theme
 
+	
 %description
-Flameshot is a screenshot software, it's
-powerful yet simple to use for GNU/Linux
+Powerful and simple to use screenshot software with built-in
+editor with advanced features.
+
+Features:
+
+ * Customizable appearance.
+ * Easy to use.
+ * In-app screenshot edition.
+ * DBus interface.
+ * Upload to Imgur
 
 %prep
-%setup -q -n v%{version}
+%autosetup -p1
 
 %build
-cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr
-make %{?_smp_mflags}
+%if %{is_suse_leap}
+%cmake -DCMAKE_BUILD_TYPE=Release
+%endif
+%if %{is_rhel_or_fedora}
+%cmake -G Ninja -DCMAKE_BUILD_TYPE=Release
+%endif
+%cmake_build
 
 %install
-%make_install INSTALL_ROOT=%{buildroot}
-
-%if 0%{?is_opensuse}
-%if 0%{?suse_version} >= 1500
-%suse_update_desktop_file org.flameshot.Flameshot Graphics
-%endif
+%cmake_install
+# https://fedoraproject.org/wiki/PackagingDrafts/find_lang
+%find_lang Internationalization --with-qt
+%if %{is_suse_leap}
+%suse_update_desktop_file -r org.flameshot.Flameshot Utility X-SuSE-DesktopUtility
 %endif
+%fdupes %{buildroot}%{_datadir}/icons
 
-%if 0%{?fedora}
-%post -p /sbin/ldconfig
-%postun -p /sbin/ldconfig
+%check
+%if %{is_rhel_or_fedora}
+appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.metainfo.xml
+%endif
+%if %{is_suse_leap}
+appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/*.metainfo.xml
 %endif
+desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop
 
-%files
+%files -f Internationalization.lang
 %doc README.md
-%doc %{_mandir}/man*/*
 %license LICENSE
+%dir %{_datadir}/%{name}
+%dir %{_datadir}/%{name}/translations
+%dir %{_datadir}/bash-completion/completions
+%dir %{_datadir}/zsh/site-functions
 %{_bindir}/%{name}
-%{_datadir}/%{name}
-%{_datadir}/dbus-1/interfaces/org.flameshot.Flameshot.xml
-%{_datadir}/dbus-1/services/org.flameshot.Flameshot.service
-%{_datadir}/metainfo/org.flameshot.Flameshot.metainfo.xml
-%{_datadir}/flameshot/translations
 %{_datadir}/applications/org.flameshot.Flameshot.desktop
+%if %{is_suse_leap}
+%{_datadir}/metainfo/org.flameshot.Flameshot.metainfo.xml
+%endif
+%if %{is_rhel_or_fedora}
+%{_metainfodir}/org.flameshot.Flameshot.metainfo.xml
+%endif
 %{_datadir}/bash-completion/completions/%{name}
 %{_datadir}/zsh/site-functions/_%{name}
-%{_datadir}/icons/hicolor
+%{_datadir}/dbus-1/interfaces/org.flameshot.Flameshot.xml
+%{_datadir}/dbus-1/services/org.flameshot.Flameshot.service
+%{_datadir}/icons/hicolor/*/apps/*.png
+%{_datadir}/icons/hicolor/scalable/apps/*.svg
+%{_mandir}/man1/%{name}.1*
 
 %changelog
+* Sun Aug 29 2021 Zetao Yang <vitzys@outlook.com> - 0.10.1-2
+- Minor SPEC fixes.
+
 * Sun Jul 25 2021 Jeremy Borgman <borgman.jeremy@pm.me> - 0.10.1-1
 - Updated for flameshot 0.10.1
-* Sun May 17 2021 Jeremy Borgman <borgman.jeremy@pm.me> - 0.10.0-1
+
+* Mon May 17 2021 Jeremy Borgman <borgman.jeremy@pm.me> - 0.10.0-1
 - Updated for flameshot 0.10.0
+
 * Sat Feb 27 2021 Jeremy Borgman <borgman.jeremy@pm.me> - 0.9.0-1
 - Updated for flameshot 0.9.0
-* Sat Oct 14 2020 Jeremy Borgman <borgman.jeremy@pm.me> - 0.8.5-1
+
+* Wed Oct 14 2020 Jeremy Borgman <borgman.jeremy@pm.me> - 0.8.5-1
 - Updated for flameshot 0.8.5
+
 * Sat Oct 10 2020 Jeremy Borgman <borgman.jeremy@pm.me> - 0.8.4-1
 - Updated for flameshot 0.8.4
-* Mon Sep 19 2020 Jeremy Borgman <borgman.jeremy@pm.me> - 0.8.3-1
+
+* Sat Sep 19 2020 Jeremy Borgman <borgman.jeremy@pm.me> - 0.8.3-1
 - Updated for flameshot 0.8.3
+
 * Mon Sep 07 2020 Zetao Yang <vitzys@outlook.com> - 0.8.0-1
 - Updated for flameshot 0.8.0
-- More details, please see https://flameshot.js.org/#/changelog?id=v080
+- More details, please see https://flameshot.org/changelog/#v080
+
 * Sat Aug 18 2018 Zetao Yang <vitzys@outlook.com> - 0.6.0-1
 - Updated for flameshot 0.6.0
-- More details, please see https://flameshot.js.org/#/changelog?id=v060
+- More details, please see https://flameshot.org/changelog/#v060
+
 * Tue Jan 09 2018 Zetao Yang <vitzys@outlook.com> - 0.5.0-1
 - Initial package for flameshot 0.5.0
-- More details, please see https://flameshot.js.org/#/changelog?id=v051
-
+- More details, please see https://flameshot.org/changelog/#v050

Some files were not shown because too many files changed in this diff