mirror of
https://github.com/fergalmoran/flameshot.git
synced 2025-12-22 09:51:06 +00:00
Add useGrimAdapter option to the config window (#3943)
This commit is contained in:
committed by
GitHub
parent
f7a049ee78
commit
76f8067b2d
@@ -37,6 +37,7 @@ GeneralConf::GeneralConf(QWidget* parent)
|
||||
initAutoCloseIdleDaemon();
|
||||
#endif
|
||||
initShowTrayIcon();
|
||||
initUseGrimAdapter();
|
||||
initShowDesktopNotification();
|
||||
initShowAbortNotification();
|
||||
#if !defined(DISABLE_UPDATE_CHECKER)
|
||||
@@ -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()
|
||||
@@ -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)
|
||||
{
|
||||
@@ -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(
|
||||
|
||||
@@ -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
|
||||
@@ -87,6 +88,7 @@ private:
|
||||
void initShowSidePanelButton();
|
||||
void initShowStartupLaunchMessage();
|
||||
void initShowTrayIcon();
|
||||
void initUseGrimAdapter();
|
||||
void initSquareMagnifier();
|
||||
void initUndoLimit();
|
||||
void initUploadWithoutConfirmation();
|
||||
@@ -107,6 +109,7 @@ private:
|
||||
QCheckBox* m_sysNotifications;
|
||||
QCheckBox* m_abortNotifications;
|
||||
QCheckBox* m_showTray;
|
||||
QCheckBox* m_useGrimAdapter;
|
||||
QCheckBox* m_helpMessage;
|
||||
QCheckBox* m_sidePanelButton;
|
||||
#if !defined(DISABLE_UPDATE_CHECKER)
|
||||
|
||||
Reference in New Issue
Block a user