Changeset View
Changeset View
Standalone View
Standalone View
src/SpectacleCore.cpp
Show First 20 Lines • Show All 82 Lines • ▼ Show 20 Line(s) | 55 | { | |||
---|---|---|---|---|---|
83 | // set up the export manager | 83 | // set up the export manager | ||
84 | auto lExportManager = ExportManager::instance(); | 84 | auto lExportManager = ExportManager::instance(); | ||
85 | lExportManager->setCaptureMode(theCaptureMode); | 85 | lExportManager->setCaptureMode(theCaptureMode); | ||
86 | connect(lExportManager, &ExportManager::errorMessage, this, &SpectacleCore::showErrorMessage); | 86 | connect(lExportManager, &ExportManager::errorMessage, this, &SpectacleCore::showErrorMessage); | ||
87 | connect(lExportManager, &ExportManager::imageSaved, this, &SpectacleCore::doCopyPath); | 87 | connect(lExportManager, &ExportManager::imageSaved, this, &SpectacleCore::doCopyPath); | ||
88 | connect(lExportManager, &ExportManager::forceNotify, this, &SpectacleCore::doNotify); | 88 | connect(lExportManager, &ExportManager::forceNotify, this, &SpectacleCore::doNotify); | ||
89 | connect(mPlatform.get(), &Platform::windowTitleChanged, lExportManager, &ExportManager::setWindowTitle); | 89 | connect(mPlatform.get(), &Platform::windowTitleChanged, lExportManager, &ExportManager::setWindowTitle); | ||
90 | 90 | | |||
91 | setUpShortcuts(); | ||||
aprcela: Here.
When commented out, spectacle runs but it doesn't show the according shortcut in the main… | |||||
92 | | ||||
91 | switch (theStartMode) { | 93 | switch (theStartMode) { | ||
92 | case StartMode::DBus: | 94 | case StartMode::DBus: | ||
93 | break; | 95 | break; | ||
94 | case StartMode::Background: { | 96 | case StartMode::Background: { | ||
95 | auto lMsec = (KWindowSystem::compositingActive() ? 200 : 50) + theDelayMsec; | 97 | auto lMsec = (KWindowSystem::compositingActive() ? 200 : 50) + theDelayMsec; | ||
96 | auto lShutterMode = lImmediateAvailable ? Platform::ShutterMode::Immediate : Platform::ShutterMode::OnClick; | 98 | auto lShutterMode = lImmediateAvailable ? Platform::ShutterMode::Immediate : Platform::ShutterMode::OnClick; | ||
97 | auto lIncludePointer = lGuiConfig.readEntry("includePointer", true); | 99 | auto lIncludePointer = lGuiConfig.readEntry("includePointer", true); | ||
98 | auto lIncludeDecorations = lGuiConfig.readEntry("includeDecorations", true); | 100 | auto lIncludeDecorations = lGuiConfig.readEntry("includeDecorations", true); | ||
99 | const Platform::GrabMode lCaptureMode = toPlatformGrabMode(theCaptureMode); | 101 | const Platform::GrabMode lCaptureMode = toPlatformGrabMode(theCaptureMode); | ||
100 | QTimer::singleShot(lMsec, this, [ this, lCaptureMode, lShutterMode, lIncludePointer, lIncludeDecorations ]() { | 102 | QTimer::singleShot(lMsec, this, [ this, lCaptureMode, lShutterMode, lIncludePointer, lIncludeDecorations ]() { | ||
101 | mPlatform->doGrab(lShutterMode, lCaptureMode, lIncludePointer, lIncludeDecorations); | 103 | mPlatform->doGrab(lShutterMode, lCaptureMode, lIncludePointer, lIncludeDecorations); | ||
102 | }); | 104 | }); | ||
103 | } | 105 | } | ||
104 | break; | 106 | break; | ||
105 | case StartMode::Gui: | 107 | case StartMode::Gui: | ||
106 | initGui(lGuiConfig.readEntry("includePointer", true), lGuiConfig.readEntry("includeDecorations", true)); | 108 | initGui(lGuiConfig.readEntry("includePointer", true), lGuiConfig.readEntry("includeDecorations", true)); | ||
107 | break; | 109 | break; | ||
108 | } | 110 | } | ||
109 | setUpShortcuts(); | | |||
110 | } | 111 | } | ||
111 | 112 | | |||
112 | void SpectacleCore::setUpShortcuts() | 113 | void SpectacleCore::setUpShortcuts() | ||
113 | { | 114 | { | ||
114 | SpectacleConfig* config = SpectacleConfig::instance(); | 115 | SpectacleConfig* config = SpectacleConfig::instance(); | ||
115 | 116 | | |||
116 | QAction* openAction = config->shortCutActions->action(QStringLiteral("_launch")); | 117 | QAction* openAction = config->shortCutActions->action(QStringLiteral("_launch")); | ||
117 | KGlobalAccel::self()->setGlobalShortcut(openAction, Qt::Key_Print); | 118 | KGlobalAccel::self()->setGlobalShortcut(openAction, Qt::Key_Print); | ||
▲ Show 20 Lines • Show All 286 Lines • Show Last 20 Lines |
Here.
When commented out, spectacle runs but it doesn't show the according shortcut in the main window's 'Area' dropdown menu.