mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 13:50:35 +02:00
Merge pull request #8501 from howard-stearns/pr-review-comments-3
Pr review comments 3
This commit is contained in:
commit
f9d8ccaeac
4 changed files with 15 additions and 21 deletions
|
@ -5171,6 +5171,7 @@ void Application::toggleLogDialog() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::takeSnapshot(bool notify, float aspectRatio) {
|
void Application::takeSnapshot(bool notify, float aspectRatio) {
|
||||||
|
postLambdaEvent([notify, aspectRatio, this] {
|
||||||
QMediaPlayer* player = new QMediaPlayer();
|
QMediaPlayer* player = new QMediaPlayer();
|
||||||
QFileInfo inf = QFileInfo(PathUtils::resourcesPath() + "sounds/snap.wav");
|
QFileInfo inf = QFileInfo(PathUtils::resourcesPath() + "sounds/snap.wav");
|
||||||
player->setMedia(QUrl::fromLocalFile(inf.absoluteFilePath()));
|
player->setMedia(QUrl::fromLocalFile(inf.absoluteFilePath()));
|
||||||
|
@ -5179,11 +5180,14 @@ void Application::takeSnapshot(bool notify, float aspectRatio) {
|
||||||
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) {
|
void Application::shareSnapshot(const QString& path) {
|
||||||
|
postLambdaEvent([path] {
|
||||||
// not much to do here, everything is done in snapshot code...
|
// not much to do here, everything is done in snapshot code...
|
||||||
Snapshot::uploadSnapshot(path);
|
Snapshot::uploadSnapshot(path);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
float Application::getRenderResolutionScale() const {
|
float Application::getRenderResolutionScale() const {
|
||||||
|
|
|
@ -205,13 +205,9 @@ void WindowScriptingInterface::copyToClipboard(const QString& text) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowScriptingInterface::takeSnapshot(bool notify, float aspectRatio) {
|
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) {
|
void WindowScriptingInterface::shareSnapshot(const QString& path) {
|
||||||
qApp->postLambdaEvent([path] {
|
|
||||||
qApp->shareSnapshot(path);
|
qApp->shareSnapshot(path);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,11 +162,6 @@
|
||||||
// this means you may or may not be logged in, but can't share
|
// this means you may or may not be logged in, but can't share
|
||||||
// because you are not in a public place.
|
// 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.";
|
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 () {
|
window.onload = function () {
|
||||||
|
|
|
@ -55,7 +55,7 @@ function confirmShare(data) {
|
||||||
Settings.setValue('openFeedAfterShare', true)
|
Settings.setValue('openFeedAfterShare', true)
|
||||||
break;
|
break;
|
||||||
default:
|
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();
|
dialog.close();
|
||||||
isLoggedIn = Account.isLoggedIn();
|
isLoggedIn = Account.isLoggedIn();
|
||||||
message.forEach(function (submessage) {
|
message.forEach(function (submessage) {
|
||||||
|
@ -139,7 +139,6 @@ function resetButtons(path, notify) {
|
||||||
{ localPath: path },
|
{ localPath: path },
|
||||||
{
|
{
|
||||||
canShare: Boolean(location.placename),
|
canShare: Boolean(location.placename),
|
||||||
isLoggedIn: true, // Just have the dialog act as though we are. To be removed at both ends later.
|
|
||||||
openFeedAfterShare: shouldOpenFeedAfterShare()
|
openFeedAfterShare: shouldOpenFeedAfterShare()
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|
Loading…
Reference in a new issue