Changeset View
Changeset View
Standalone View
Standalone View
src/SpectacleConfig.cpp
Show All 12 Lines | |||||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU Lesser General Public License | 14 | * You should have received a copy of the GNU Lesser General Public License | ||
15 | * along with this program; if not, write to the Free Software | 15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
17 | * Boston, MA 02110-1301, USA. | 17 | * Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #include "SpectacleConfig.h" | 20 | #include "SpectacleConfig.h" | ||
21 | #include "SpectacleCommon.h" | ||||
21 | 22 | | |||
22 | #include <KLocalizedString> | 23 | #include <KLocalizedString> | ||
23 | #include <KWindowSystem> | 24 | #include <KWindowSystem> | ||
24 | 25 | | |||
25 | 26 | | |||
26 | 27 | | |||
27 | SpectacleConfig::SpectacleConfig(QObject *parent) : | 28 | SpectacleConfig::SpectacleConfig(QObject *parent) : | ||
28 | QObject(parent) | 29 | QObject(parent) | ||
Show All 10 Lines | 30 | { | |||
39 | // ActiveWindowScreenShot | 40 | // ActiveWindowScreenShot | ||
40 | // CurrentMonitorScreenShot | 41 | // CurrentMonitorScreenShot | ||
41 | // RectangularRegionScreenShot | 42 | // RectangularRegionScreenShot | ||
42 | // FullScreenScreenShot | 43 | // FullScreenScreenShot | ||
43 | // _launch | 44 | // _launch | ||
44 | { | 45 | { | ||
45 | QAction *action = new QAction(i18n("Launch Spectacle")); | 46 | QAction *action = new QAction(i18n("Launch Spectacle")); | ||
46 | action->setObjectName(QStringLiteral("_launch")); | 47 | action->setObjectName(QStringLiteral("_launch")); | ||
48 | action->setProperty("isConfigurationAction", true); | ||||
47 | shortCutActions->addAction(action->objectName(), action); | 49 | shortCutActions->addAction(action->objectName(), action); | ||
48 | } | 50 | } | ||
49 | { | 51 | { | ||
50 | QAction *action = new QAction(i18n("Capture Entire Desktop")); | 52 | QAction *action = new QAction(i18n("Capture Entire Screen")); | ||
51 | action->setObjectName(QStringLiteral("FullScreenScreenShot")); | 53 | action->setObjectName(QStringLiteral("FullScreenScreenShot")); | ||
54 | action->setProperty("isConfigurationAction", true); | ||||
55 | action->setData(Spectacle::CaptureMode::EntireScreen); | ||||
52 | shortCutActions->addAction(action->objectName(), action); | 56 | shortCutActions->addAction(action->objectName(), action); | ||
53 | } | 57 | } | ||
54 | { | 58 | { | ||
55 | QAction *action = new QAction(i18n("Capture Current Monitor")); | 59 | QAction *action = new QAction(i18n("Capture Current Screen")); | ||
56 | action->setObjectName(QStringLiteral("CurrentMonitorScreenShot")); | 60 | action->setObjectName(QStringLiteral("CurrentMonitorScreenShot")); | ||
61 | action->setProperty("isConfigurationAction", true); | ||||
62 | action->setData(Spectacle::CaptureMode::CurrentScreen); | ||||
57 | shortCutActions->addAction(action->objectName(), action); | 63 | shortCutActions->addAction(action->objectName(), action); | ||
58 | } | 64 | } | ||
59 | { | 65 | { | ||
60 | QAction *action = new QAction(i18n("Capture Active Window")); | 66 | QAction *action = new QAction(i18n("Capture Active Window")); | ||
61 | action->setObjectName(QStringLiteral("ActiveWindowScreenShot")); | 67 | action->setObjectName(QStringLiteral("ActiveWindowScreenShot")); | ||
68 | action->setProperty("isConfigurationAction", true); | ||||
69 | action->setData(Spectacle::CaptureMode::ActiveWindow); | ||||
70 | shortCutActions->addAction(action->objectName(), action); | ||||
71 | } | ||||
72 | { | ||||
73 | QAction *action = new QAction(i18n("Capture Window Under Cursor")); | ||||
74 | action->setObjectName(QStringLiteral("WindowUnderCursorScreenShot")); | ||||
75 | action->setProperty("isConfigurationAction", true); | ||||
76 | action->setData(Spectacle::CaptureMode::WindowUnderCursor); | ||||
62 | shortCutActions->addAction(action->objectName(), action); | 77 | shortCutActions->addAction(action->objectName(), action); | ||
davidre: This also adds this to the shortcut editor which is completetly unrelated and untested if… | |||||
63 | } | 78 | } | ||
64 | { | 79 | { | ||
65 | QAction *action = new QAction(i18n("Capture Rectangular Region")); | 80 | QAction *action = new QAction(i18n("Capture Rectangular Region")); | ||
66 | action->setObjectName(QStringLiteral("RectangularRegionScreenShot")); | 81 | action->setObjectName(QStringLiteral("RectangularRegionScreenShot")); | ||
82 | action->setProperty("isConfigurationAction", true); | ||||
83 | action->setData(Spectacle::CaptureMode::RectangularRegion); | ||||
67 | shortCutActions->addAction(action->objectName(), action); | 84 | shortCutActions->addAction(action->objectName(), action); | ||
68 | } | 85 | } | ||
69 | } | 86 | } | ||
70 | 87 | | |||
71 | SpectacleConfig::~SpectacleConfig() | 88 | SpectacleConfig::~SpectacleConfig() | ||
72 | {} | 89 | {} | ||
73 | 90 | | |||
74 | SpectacleConfig* SpectacleConfig::instance() | 91 | SpectacleConfig* SpectacleConfig::instance() | ||
▲ Show 20 Lines • Show All 330 Lines • Show Last 20 Lines |
This also adds this to the shortcut editor which is completetly unrelated and untested if shortcut + window under cursor works.