History

Merge pull request #8428 from highfidelity/discovery

Snapshot of Snapshot-Discovery to master

Howard Stearns committed 10 years ago

Commit 89b00882 parents 82041e4 97c706f43 files · +1400 −285Browse files

Showing the changes to interface/src/Application.cpp (1 of 43 files). Show all

Unified · Split

interface/src/Application.cpp+18−8
@@ -2296,7 +2296,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 2295 unmodified lines
22962296 } else if (isOption && !isShifted && !isMeta) {
22972297 Menu::getInstance()->triggerOption(MenuOption::ScriptEditor);
22982298 } else if (!isOption && !isShifted && isMeta) {
2299− takeSnapshot();
2299+ takeSnapshot(true);
23002300 }
23012301 break;
23022302
@@ -4913,6 +4913,7 @@ bool Application::canAcceptURL(const QString& urlString) const { · 2610 unmodified lines
49134913 bool Application::acceptURL(const QString& urlString, bool defaultUpload) {
49144914 if (urlString.startsWith(HIFI_URL_SCHEME)) {
49154915 // this is a hifi URL - have the AddressManager handle it
4916+ emit receivedHifiSchemeURL(urlString);
49164917 QMetaObject::invokeMethod(DependencyManager::get<AddressManager>().data(), "handleLookupString",
49174918 Qt::AutoConnection, Q_ARG(const QString&, urlString));
49184919 return true;
@@ -5189,15 +5190,24 @@ void Application::toggleLogDialog() { · 270 unmodified lines
51895190 }
51905191 }
51915192
5192−void Application::takeSnapshot() {
5193− QMediaPlayer* player = new QMediaPlayer();
5194− QFileInfo inf = QFileInfo(PathUtils::resourcesPath() + "sounds/snap.wav");
5195− player->setMedia(QUrl::fromLocalFile(inf.absoluteFilePath()));
5196− player->play();
5193+void Application::takeSnapshot(bool notify, float aspectRatio) {
5194+ postLambdaEvent([notify, aspectRatio, this] {
5195+ QMediaPlayer* player = new QMediaPlayer();
5196+ QFileInfo inf = QFileInfo(PathUtils::resourcesPath() + "sounds/snap.wav");
5197+ player->setMedia(QUrl::fromLocalFile(inf.absoluteFilePath()));
5198+ player->play();
51975199
5198− QString path = Snapshot::saveSnapshot(getActiveDisplayPlugin()->getScreenshot());
5200+ QString path = Snapshot::saveSnapshot(getActiveDisplayPlugin()->getScreenshot(aspectRatio));
51995201
5200− emit DependencyManager::get<WindowScriptingInterface>()->snapshotTaken(path);
5202+ emit DependencyManager::get<WindowScriptingInterface>()->snapshotTaken(path, notify);
5203+ });
5204+}
5205+
5206+void Application::shareSnapshot(const QString& path) {
5207+ postLambdaEvent([path] {
5208+ // not much to do here, everything is done in snapshot code...
5209+ Snapshot::uploadSnapshot(path);
5210+ });
52015211 }
52025212
52035213 float Application::getRenderResolutionScale() const {