Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
28 changes: 28 additions & 0 deletions src/config/generalconf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ GeneralConf::GeneralConf(QWidget* parent)
initAutoCloseIdleDaemon();
#endif
initShowTrayIcon();
initUseGrimAdapter();
initShowDesktopNotification();
initShowAbortNotification();
#if !defined(DISABLE_UPDATE_CHECKER)
Expand Down Expand Up @@ -117,6 +118,10 @@ void GeneralConf::_updateComponents(bool allowEmptySavePath)
#if defined(Q_OS_LINUX) || defined(Q_OS_UNIX)
m_showTray->setChecked(!config.disabledTrayIcon());
#endif

#if defined(Q_OS_LINUX)
m_useGrimAdapter->setChecked(config.useGrimAdapter());
#endif
}

void GeneralConf::updateComponents()
Expand Down Expand Up @@ -149,6 +154,11 @@ void GeneralConf::showAbortNotificationChanged(bool checked)
ConfigHandler().setShowAbortNotification(checked);
}

void GeneralConf::useGrimAdapter(bool checked)
{
ConfigHandler().useGrimAdapter(checked);
}

#if !defined(DISABLE_UPDATE_CHECKER)
void GeneralConf::checkForUpdatesChanged(bool checked)
{
Expand Down Expand Up @@ -326,6 +336,24 @@ void GeneralConf::initShowTrayIcon()
#endif
}

void GeneralConf::initUseGrimAdapter()
{
#if defined(Q_OS_LINUX)
m_useGrimAdapter =
new QCheckBox(tr("Use grim to capture screenshots"), this);
m_useGrimAdapter->setToolTip(
tr("Grim is a wayland only utility to capture screens based on the "
"screencopy protocol. Generally only enable on minimal wayland window "
"managers like sway, hyprland, etc."));
m_scrollAreaLayout->addWidget(m_useGrimAdapter);

connect(m_useGrimAdapter,
&QCheckBox::clicked,
this,
&GeneralConf::useGrimAdapter);
#endif
}

void GeneralConf::initHistoryConfirmationToDelete()
{
m_historyConfirmationToDelete = new QCheckBox(
Expand Down
3 changes: 3 additions & 0 deletions src/config/generalconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ private slots:
void showSidePanelButtonChanged(bool checked);
void showDesktopNotificationChanged(bool checked);
void showAbortNotificationChanged(bool checked);
void useGrimAdapter(bool checked);
#if !defined(DISABLE_UPDATE_CHECKER)
void checkForUpdatesChanged(bool checked);
#endif
Expand Down Expand Up @@ -87,6 +88,7 @@ private slots:
void initShowSidePanelButton();
void initShowStartupLaunchMessage();
void initShowTrayIcon();
void initUseGrimAdapter();
void initSquareMagnifier();
void initUndoLimit();
void initUploadWithoutConfirmation();
Expand All @@ -107,6 +109,7 @@ private slots:
QCheckBox* m_sysNotifications;
QCheckBox* m_abortNotifications;
QCheckBox* m_showTray;
QCheckBox* m_useGrimAdapter;
QCheckBox* m_helpMessage;
QCheckBox* m_sidePanelButton;
#if !defined(DISABLE_UPDATE_CHECKER)
Expand Down
Loading