Showing the changes to interface/src/Application.cpp (1 of 2 files). Show all
Unified · Split
| @@ -5171,19 +5171,23 @@ void Application::toggleLogDialog() { · 5170 unmodified lines | |||
| 5171 | } | 5171 | } |
| 5172 | 5172 | ||
| 5173 | void Application::takeSnapshot(bool notify, float aspectRatio) { | 5173 | void Application::takeSnapshot(bool notify, float aspectRatio) { |
| 5174 | QMediaPlayer* player = new QMediaPlayer(); | 5174 | postLambdaEvent([notify, aspectRatio, this] { |
| 5175 | QFileInfo inf = QFileInfo(PathUtils::resourcesPath() + "sounds/snap.wav"); | 5175 | QMediaPlayer* player = new QMediaPlayer(); |
| 5176 | player->setMedia(QUrl::fromLocalFile(inf.absoluteFilePath())); | 5176 | QFileInfo inf = QFileInfo(PathUtils::resourcesPath() + "sounds/snap.wav"); |
| 5177 | player->play(); | 5177 | player->setMedia(QUrl::fromLocalFile(inf.absoluteFilePath())); |
| 5178 | player->play(); | ||
| 5178 | 5179 | ||
| 5179 | QString path = Snapshot::saveSnapshot(getActiveDisplayPlugin()->getScreenshot(aspectRatio)); | 5180 | QString path = Snapshot::saveSnapshot(getActiveDisplayPlugin()->getScreenshot(aspectRatio)); |
| 5180 | 5181 | ||
| 5181 | emit DependencyManager::get<WindowScriptingInterface>()->snapshotTaken(path, notify); | 5182 | emit DependencyManager::get<WindowScriptingInterface>()->snapshotTaken(path, notify); |
| 5183 | }); | ||
| 5182 | } | 5184 | } |
| 5183 | 5185 | ||
| 5184 | void Application::shareSnapshot(const QString& path) { | 5186 | void Application::shareSnapshot(const QString& path) { |
| 5185 | // not much to do here, everything is done in snapshot code... | 5187 | postLambdaEvent([path] { |
| 5186 | Snapshot::uploadSnapshot(path); | 5188 | // not much to do here, everything is done in snapshot code... |
| 5189 | Snapshot::uploadSnapshot(path); | ||
| 5190 | }); | ||
| 5187 | } | 5191 | } |
| 5188 | 5192 | ||
| 5189 | float Application::getRenderResolutionScale() const { | 5193 | float Application::getRenderResolutionScale() const { |