Skip to content

Commit

Permalink
add config to disable grim warrning close flameshot-org#3186
Browse files Browse the repository at this point in the history
  • Loading branch information
Monirzadeh committed Dec 30, 2023
1 parent 3d21e49 commit 6539323
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
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

0 comments on commit 6539323

Please sign in to comment.