Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config option to disable grim warrning #3456

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions flameshot.example.ini
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
;; Whether the tray icon is disabled (bool)
;disabledTrayIcon=false
;
;; Disable Grim Warnnig notification
;disabledGrimWarnning=true
;
;; Automatically close daemon when it's not needed (not available on Windows)
;autoCloseIdleDaemon=false
;
Expand Down
1 change: 1 addition & 0 deletions src/utils/confighandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ static QMap<class QString, QSharedPointer<ValueHandler>>
OPTION("showSidePanelButton" ,Bool ( true )),
OPTION("showDesktopNotification" ,Bool ( true )),
OPTION("disabledTrayIcon" ,Bool ( false )),
OPTION("disabledGrimWarnning" ,Bool ( false )),
OPTION("historyConfirmationToDelete" ,Bool ( true )),
#if !defined(DISABLE_UPDATE_CHECKER)
OPTION("checkForUpdates" ,Bool ( true )),
Expand Down
1 change: 1 addition & 0 deletions src/utils/confighandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class ConfigHandler : public QObject
bool)
CONFIG_GETTER_SETTER(filenamePattern, setFilenamePattern, QString)
CONFIG_GETTER_SETTER(disabledTrayIcon, setDisabledTrayIcon, bool)
CONFIG_GETTER_SETTER(disabledGrimWarnning, disabledGrimWarnning, bool)
CONFIG_GETTER_SETTER(drawThickness, setDrawThickness, int)
CONFIG_GETTER_SETTER(drawFontSize, setDrawFontSize, int)
CONFIG_GETTER_SETTER(keepOpenAppLauncher, setKeepOpenAppLauncher, bool)
Expand Down
3 changes: 3 additions & 0 deletions src/utils/screengrabber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <QPixmap>
#include <QProcess>
#include <QScreen>
#include "src/utils/confighandler.h"

#if defined(Q_OS_LINUX) || defined(Q_OS_UNIX)
#include "request.h"
Expand Down Expand Up @@ -141,10 +142,12 @@ QPixmap ScreenGrabber::grabEntireDesktop(bool& ok)
"activate the grim-based general wayland screenshot adapter");
freeDesktopPortal(ok, res);
#else
if (!ConfigHandler().disabledGrimWarnning()) {
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;
Expand Down