diff --git a/flameshot.example.ini b/flameshot.example.ini index a33eb071ed..2717479d51 100644 --- a/flameshot.example.ini +++ b/flameshot.example.ini @@ -48,6 +48,9 @@ ;; Whether the tray icon is disabled (bool) ;disabledTrayIcon=false ; +;; Disable Grim Warning notification +;disabledGrimWarning=true +; ;; Automatically close daemon when it's not needed (not available on Windows) ;autoCloseIdleDaemon=false ; diff --git a/src/utils/confighandler.cpp b/src/utils/confighandler.cpp index cb9ae5d7e0..485fb26575 100644 --- a/src/utils/confighandler.cpp +++ b/src/utils/confighandler.cpp @@ -78,6 +78,7 @@ static QMap> OPTION("showSidePanelButton" ,Bool ( true )), OPTION("showDesktopNotification" ,Bool ( true )), OPTION("disabledTrayIcon" ,Bool ( false )), + OPTION("disabledGrimWarning" ,Bool ( false )), OPTION("historyConfirmationToDelete" ,Bool ( true )), #if !defined(DISABLE_UPDATE_CHECKER) OPTION("checkForUpdates" ,Bool ( true )), diff --git a/src/utils/confighandler.h b/src/utils/confighandler.h index aedd732915..f2eb4ad940 100644 --- a/src/utils/confighandler.h +++ b/src/utils/confighandler.h @@ -88,6 +88,7 @@ class ConfigHandler : public QObject bool) CONFIG_GETTER_SETTER(filenamePattern, setFilenamePattern, QString) CONFIG_GETTER_SETTER(disabledTrayIcon, setDisabledTrayIcon, bool) + CONFIG_GETTER_SETTER(disabledGrimWarning, disabledGrimWarning, bool) CONFIG_GETTER_SETTER(drawThickness, setDrawThickness, int) CONFIG_GETTER_SETTER(drawFontSize, setDrawFontSize, int) CONFIG_GETTER_SETTER(keepOpenAppLauncher, setKeepOpenAppLauncher, bool) diff --git a/src/utils/screengrabber.cpp b/src/utils/screengrabber.cpp index 062c4bdeea..9ce3854f43 100644 --- a/src/utils/screengrabber.cpp +++ b/src/utils/screengrabber.cpp @@ -4,6 +4,7 @@ #include "screengrabber.h" #include "abstractlogger.h" #include "src/core/qguiappcurrentscreen.h" +#include "src/utils/confighandler.h" #include "src/utils/filenamehandler.h" #include "src/utils/systemnotification.h" #include @@ -141,10 +142,12 @@ QPixmap ScreenGrabber::grabEntireDesktop(bool& ok) "activate the grim-based general wayland screenshot adapter"); freeDesktopPortal(ok, res); #else - AbstractLogger::warning() - << tr("grim's screenshot component is implemented based on " - "wlroots, it may not be used in GNOME or similar " - "desktop environments"); + if (!ConfigHandler().disabledGrimWarning()) { + AbstractLogger::warning() << tr( + "grim's screenshot component is implemented based on " + "wlroots, it may not be used in GNOME or similar " + "desktop environments"); + } generalGrimScreenshot(ok, res); #endif break;