Merge pull request #8501 from howard-stearns/pr-review-comments-3

Pr review comments 3
This commit is contained in:
Howard Stearns 2016-08-22 12:52:40 -07:00 committed by GitHub
commit f9d8ccaeac
4 changed files with 15 additions and 21 deletions

View file

@ -5171,19 +5171,23 @@ void Application::toggleLogDialog() {
}
void Application::takeSnapshot(bool notify, float aspectRatio) {
QMediaPlayer* player = new QMediaPlayer();
QFileInfo inf = QFileInfo(PathUtils::resourcesPath() + "sounds/snap.wav");
player->setMedia(QUrl::fromLocalFile(inf.absoluteFilePath()));
player->play();
postLambdaEvent([notify, aspectRatio, this] {
QMediaPlayer* player = new QMediaPlayer();
QFileInfo inf = QFileInfo(PathUtils::resourcesPath() + "sounds/snap.wav");
player->setMedia(QUrl::fromLocalFile(inf.absoluteFilePath()));
player->play();
QString path = Snapshot::saveSnapshot(getActiveDisplayPlugin()->getScreenshot(aspectRatio));
QString path = Snapshot::saveSnapshot(getActiveDisplayPlugin()->getScreenshot(aspectRatio));
emit DependencyManager::get<WindowScriptingInterface>()->snapshotTaken(path, notify);
emit DependencyManager::get<WindowScriptingInterface>()->snapshotTaken(path, notify);
});
}
void Application::shareSnapshot(const QString& path) {
// not much to do here, everything is done in snapshot code...
Snapshot::uploadSnapshot(path);
postLambdaEvent([path] {
// not much to do here, everything is done in snapshot code...
Snapshot::uploadSnapshot(path);
});
}
float Application::getRenderResolutionScale() const {

View file

@ -205,13 +205,9 @@ void WindowScriptingInterface::copyToClipboard(const QString& text) {
}
void WindowScriptingInterface::takeSnapshot(bool notify, float aspectRatio) {
qApp->postLambdaEvent([notify, aspectRatio] {
qApp->takeSnapshot(notify, aspectRatio);
});
qApp->takeSnapshot(notify, aspectRatio);
}
void WindowScriptingInterface::shareSnapshot(const QString& path) {
qApp->postLambdaEvent([path] {
qApp->shareSnapshot(path);
});
qApp->shareSnapshot(path);
}

View file

@ -162,11 +162,6 @@
// this means you may or may not be logged in, but can't share
// because you are not in a public place.
document.getElementById("sharing").innerHTML = "<p class='prompt'>Snapshots can be shared when they're taken in shareable places.";
} else if (!shareMsg.isLoggedIn) {
// this means you are in a public place, but can't share because
// you need to login. Soon we will just bring up the share dialog
// in this case (and maybe set a boolean here to inform the html)
document.getElementById("sharing").innerHTML = "<p class='prompt'>Snapshots can be shared when you're logged in.";
}
}
window.onload = function () {

View file

@ -55,7 +55,7 @@ function confirmShare(data) {
Settings.setValue('openFeedAfterShare', true)
break;
default:
dialog.webEventReceived.disconnect(onMessage); // I'm not certain that this is necessary. If it is, what do we do on normal close?
dialog.webEventReceived.disconnect(onMessage);
dialog.close();
isLoggedIn = Account.isLoggedIn();
message.forEach(function (submessage) {
@ -139,7 +139,6 @@ function resetButtons(path, notify) {
{ localPath: path },
{
canShare: Boolean(location.placename),
isLoggedIn: true, // Just have the dialog act as though we are. To be removed at both ends later.
openFeedAfterShare: shouldOpenFeedAfterShare()
}
]);