Changeset View
Changeset View
Standalone View
Standalone View
src/SpectacleConfig.cpp
Show All 13 Lines | |||||
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 | 21 | | |||
22 | #include <KLocalizedString> | ||||
22 | #include <KWindowSystem> | 23 | #include <KWindowSystem> | ||
23 | 24 | | |||
25 | #include <KGlobalAccel> | ||||
26 | | ||||
27 | #include <QDebug> | ||||
28 | | ||||
24 | SpectacleConfig::SpectacleConfig(QObject *parent) : | 29 | SpectacleConfig::SpectacleConfig(QObject *parent) : | ||
25 | QObject(parent) | 30 | QObject(parent) | ||
26 | { | 31 | { | ||
27 | mConfig = KSharedConfig::openConfig(QStringLiteral("spectaclerc")); | 32 | mConfig = KSharedConfig::openConfig(QStringLiteral("spectaclerc")); | ||
28 | mGeneralConfig = KConfigGroup(mConfig, "General"); | 33 | mGeneralConfig = KConfigGroup(mConfig, "General"); | ||
29 | mGuiConfig = KConfigGroup(mConfig, "GuiConfig"); | 34 | mGuiConfig = KConfigGroup(mConfig, "GuiConfig"); | ||
35 | | ||||
36 | shortCutActions = new KActionCollection(this); | ||||
37 | | ||||
38 | //everything here is named to match the jumplist actions in our .desktop file | ||||
39 | shortCutActions->setComponentName(QStringLiteral("org.kde.spectacle.desktop")); | ||||
40 | //qdbus org.kde.kglobalaccel /component/org_kde_spectacle_desktop org.kde.kglobalaccel.Component.shortcutNames | ||||
41 | // ActiveWindowScreenShot | ||||
42 | // CurrentMonitorScreenShot | ||||
43 | // RectangularRegionScreenShot | ||||
44 | // FullScreenScreenShot | ||||
45 | // _launch | ||||
46 | { | ||||
47 | QAction *action = new QAction(i18n("Launch Spectacle")); | ||||
48 | action->setObjectName(QStringLiteral("_launch")); | ||||
49 | shortCutActions->addAction(action->objectName(), action); | ||||
50 | } | ||||
51 | { | ||||
52 | QAction *action = new QAction(i18n("Capture Entire Desktop")); | ||||
53 | action->setObjectName(QStringLiteral("FullScreenScreenShot")); | ||||
54 | shortCutActions->addAction(action->objectName(), action); | ||||
55 | } | ||||
56 | { | ||||
57 | QAction *action = new QAction(i18n("Capture Current Monitor")); | ||||
58 | action->setObjectName(QStringLiteral("CurrentMonitorScreenShot")); | ||||
59 | shortCutActions->addAction(action->objectName(), action); | ||||
60 | } | ||||
61 | { | ||||
62 | QAction *action = new QAction(i18n("Capture Active Window")); | ||||
63 | action->setObjectName(QStringLiteral("ActiveWindowScreenShot")); | ||||
64 | shortCutActions->addAction(action->objectName(), action); | ||||
65 | } | ||||
66 | { | ||||
67 | QAction *action = new QAction(i18n("Capture Rectangular Region")); | ||||
68 | action->setObjectName(QStringLiteral("RectangularRegionScreenShot")); | ||||
69 | shortCutActions->addAction(action->objectName(), action); | ||||
70 | } | ||||
30 | } | 71 | } | ||
31 | 72 | | |||
32 | SpectacleConfig::~SpectacleConfig() | 73 | SpectacleConfig::~SpectacleConfig() | ||
33 | {} | 74 | {} | ||
34 | 75 | | |||
35 | SpectacleConfig* SpectacleConfig::instance() | 76 | SpectacleConfig* SpectacleConfig::instance() | ||
36 | { | 77 | { | ||
37 | static SpectacleConfig instance; | 78 | static SpectacleConfig instance; | ||
▲ Show 20 Lines • Show All 328 Lines • Show Last 20 Lines |