Paste P336

Masterwork From Distant Lands
ActivePublic

Authored by davidedmundson on Feb 25 2019, 6:47 PM.
diff --git a/desktop/CMakeLists.txt b/desktop/CMakeLists.txt
index 2c3a37c..2335048 100644
--- a/desktop/CMakeLists.txt
+++ b/desktop/CMakeLists.txt
@@ -10,11 +10,6 @@ install(
DESTINATION ${KNOTIFYRC_INSTALL_DIR}
)
-install(
- FILES spectacle.khotkeys
- DESTINATION ${DATA_INSTALL_DIR}/khotkeys
-)
-
install(
FILES org.kde.spectacle.appdata.xml
DESTINATION ${KDE_INSTALL_METAINFODIR}
diff --git a/src/SpectacleConfig.cpp b/src/SpectacleConfig.cpp
index a6dde9b..cd7c13a 100644
--- a/src/SpectacleConfig.cpp
+++ b/src/SpectacleConfig.cpp
@@ -22,6 +22,10 @@
#include <KLocalizedString>
#include <KWindowSystem>
+#include <KGlobalAccel>
+
+#include <QDebug>
+
SpectacleConfig::SpectacleConfig(QObject *parent) :
QObject(parent)
{
@@ -30,10 +34,27 @@ SpectacleConfig::SpectacleConfig(QObject *parent) :
mGuiConfig = KConfigGroup(mConfig, "GuiConfig");
shortCutActions = new KActionCollection(this);
- shortCutActions->addAction(QStringLiteral("open_spectacle"), new QAction(i18n("Open Spectacle")));
- shortCutActions->addAction(QStringLiteral("take_fullscreen"), new QAction(i18n("Take Fullscreen Screenshot ")));
- shortCutActions->addAction(QStringLiteral("take_active"), new QAction(i18n("Take Screenshot of Active Window")));
- shortCutActions->addAction(QStringLiteral("take_region"), new QAction(i18n("Take Screenshot of Rectangular Region")));
+
+ //everything here is named to match the jumplist actions in our .desktop file
+ shortCutActions->setComponentName(QStringLiteral("org.kde.spectacle.desktop"));
+
+ {
+ QAction *action = new QAction(i18n("Launch Spectacle"));
+ action->setObjectName(QStringLiteral("_launch"));
+ shortCutActions->addAction(action->objectName(), action);
+ }
+ {
+ QAction *action = new QAction(i18n("Current Monitor ScreenShot"));
+ action->setObjectName(QStringLiteral("CurrentMonitorScreenShot"));
+ shortCutActions->addAction(action->objectName(), action);
+ }
+
+//$ qdbus org.kde.kglobalaccel /component/org_kde_spectacle_desktop org.kde.kglobalaccel.Component.shortcutNames
+// ActiveWindowScreenShot
+// CurrentMonitorScreenShot
+// RectangularRegionScreenShot
+// FullScreenScreenShot
+// _launch
}
SpectacleConfig::~SpectacleConfig()
diff --git a/src/SpectacleCore.cpp b/src/SpectacleCore.cpp
index 5c6c323..f32d9ed 100644
--- a/src/SpectacleCore.cpp
+++ b/src/SpectacleCore.cpp
@@ -122,21 +122,10 @@ void SpectacleCore::setUpShortcuts()
{
SpectacleConfig* config = SpectacleConfig::instance();
- QAction* openAction = config->shortCutActions->action(QStringLiteral("open_spectacle"));
- connect(openAction, &QAction::triggered, this, &SpectacleCore::dbusStartAgent);
- KGlobalAccel::self()->setGlobalShortcut(openAction, Qt::Key_Print);
+ QAction* openAction = config->shortCutActions->action(QStringLiteral("CurrentMonitorScreenShot"));
+ KGlobalAccel::self()->setDefaultShortcut(openAction, {Qt::SHIFT + Qt::Key_Print});
- QAction* fullscreenAction = config->shortCutActions->action(QStringLiteral("take_fullscreen"));
- connect(fullscreenAction, &QAction::triggered, [this](){takeNewScreenshot(ImageGrabber::FullScreen, 0, false, true);});
- KGlobalAccel::self()->setGlobalShortcut(fullscreenAction, Qt::SHIFT + Qt::Key_Print);
-
- QAction* activeWindowAction = config->shortCutActions->action(QStringLiteral("take_active"));
- connect(activeWindowAction, &QAction::triggered, [this](){takeNewScreenshot(ImageGrabber::ActiveWindow, 0, false, true);});
- KGlobalAccel::self()->setGlobalShortcut(activeWindowAction, Qt::META + Qt::Key_Print);
-
- QAction* regionAction = config->shortCutActions->action(QStringLiteral("take_region"));
- connect(regionAction, &QAction::triggered, [this](){takeNewScreenshot(ImageGrabber::RectangularRegion, 0, true, false);});
- KGlobalAccel::self()->setGlobalShortcut(regionAction, Qt::META + Qt::SHIFT + Qt::Key_Print);
+ // * 4
}
SpectacleCore::~SpectacleCore()
davidedmundson edited the content of this paste. (Show Details)Feb 25 2019, 6:47 PM
davidedmundson changed the title of this paste from untitled to Masterwork From Distant Lands.