mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 12:04:03 +02:00
code cleanup
This commit is contained in:
parent
e40b33e618
commit
a3d64dbd9c
7 changed files with 15 additions and 17 deletions
|
@ -73,8 +73,7 @@ Window {
|
||||||
property var allStories: [];
|
property var allStories: [];
|
||||||
property int cardWidth: 200;
|
property int cardWidth: 200;
|
||||||
property int cardHeight: 152;
|
property int cardHeight: 152;
|
||||||
property string metaverseBase: "https://metaverse.highfidelity.com/api/v1/";
|
property string metaverseBase: addressBarDialog.metaverseServerUrl + "/api/v1/";
|
||||||
//property string metaverseBase: "http://10.0.0.241:3000/api/v1/";
|
|
||||||
property bool useHTML: false; // fixme: remove this and all false branches after the server is updated
|
property bool useHTML: false; // fixme: remove this and all false branches after the server is updated
|
||||||
|
|
||||||
AddressBarDialog {
|
AddressBarDialog {
|
||||||
|
|
|
@ -266,7 +266,7 @@ signals:
|
||||||
void activeDisplayPluginChanged();
|
void activeDisplayPluginChanged();
|
||||||
|
|
||||||
void uploadRequest(QString path);
|
void uploadRequest(QString path);
|
||||||
void receivedHifiSchemeURL(QString path);
|
void receivedHifiSchemeURL(const QString& url);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
QVector<EntityItemID> pasteEntities(float x, float y, float z);
|
QVector<EntityItemID> pasteEntities(float x, float y, float z);
|
||||||
|
|
|
@ -63,7 +63,7 @@ signals:
|
||||||
void svoImportRequested(const QString& url);
|
void svoImportRequested(const QString& url);
|
||||||
void domainConnectionRefused(const QString& reasonMessage, int reasonCode);
|
void domainConnectionRefused(const QString& reasonMessage, int reasonCode);
|
||||||
void snapshotTaken(const QString& path, bool notify);
|
void snapshotTaken(const QString& path, bool notify);
|
||||||
void snapshotShared(bool success);
|
void snapshotShared(const QString& error);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
WebWindowClass* doCreateWebWindow(const QString& title, const QString& url, int width, int height);
|
WebWindowClass* doCreateWebWindow(const QString& title, const QString& url, int width, int height);
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#define hifi_AddressBarDialog_h
|
#define hifi_AddressBarDialog_h
|
||||||
|
|
||||||
#include <OffscreenQmlDialog.h>
|
#include <OffscreenQmlDialog.h>
|
||||||
|
#include <NetworkingConstants.h>
|
||||||
|
|
||||||
class AddressBarDialog : public OffscreenQmlDialog {
|
class AddressBarDialog : public OffscreenQmlDialog {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -21,6 +22,7 @@ class AddressBarDialog : public OffscreenQmlDialog {
|
||||||
Q_PROPERTY(bool backEnabled READ backEnabled NOTIFY backEnabledChanged)
|
Q_PROPERTY(bool backEnabled READ backEnabled NOTIFY backEnabledChanged)
|
||||||
Q_PROPERTY(bool forwardEnabled READ forwardEnabled NOTIFY forwardEnabledChanged)
|
Q_PROPERTY(bool forwardEnabled READ forwardEnabled NOTIFY forwardEnabledChanged)
|
||||||
Q_PROPERTY(bool useFeed READ useFeed WRITE setUseFeed NOTIFY useFeedChanged)
|
Q_PROPERTY(bool useFeed READ useFeed WRITE setUseFeed NOTIFY useFeedChanged)
|
||||||
|
Q_PROPERTY(QString metaverseServerUrl READ metaverseServerUrl)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AddressBarDialog(QQuickItem* parent = nullptr);
|
AddressBarDialog(QQuickItem* parent = nullptr);
|
||||||
|
@ -28,12 +30,13 @@ public:
|
||||||
bool forwardEnabled() { return _forwardEnabled; }
|
bool forwardEnabled() { return _forwardEnabled; }
|
||||||
bool useFeed() { return _useFeed; }
|
bool useFeed() { return _useFeed; }
|
||||||
void setUseFeed(bool useFeed) { if (_useFeed != useFeed) { _useFeed = useFeed; emit useFeedChanged(); } }
|
void setUseFeed(bool useFeed) { if (_useFeed != useFeed) { _useFeed = useFeed; emit useFeedChanged(); } }
|
||||||
|
QString metaverseServerUrl() { return NetworkingConstants::METAVERSE_SERVER_URL.toString(); }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void backEnabledChanged();
|
void backEnabledChanged();
|
||||||
void forwardEnabledChanged();
|
void forwardEnabledChanged();
|
||||||
void useFeedChanged();
|
void useFeedChanged();
|
||||||
void receivedHifiSchemeURL(QString url);
|
void receivedHifiSchemeURL(const QString& url);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void displayAddressOfflineMessage();
|
void displayAddressOfflineMessage();
|
||||||
|
|
|
@ -215,20 +215,18 @@ void SnapshotUploader::uploadSuccess(QNetworkReply& reply) {
|
||||||
QJsonDocument(rootObject).toJson());
|
QJsonDocument(rootObject).toJson());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
emit DependencyManager::get<WindowScriptingInterface>()->snapshotShared(false);
|
emit DependencyManager::get<WindowScriptingInterface>()->snapshotShared(contents);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SnapshotUploader::uploadFailure(QNetworkReply& reply) {
|
void SnapshotUploader::uploadFailure(QNetworkReply& reply) {
|
||||||
// TODO: parse response, potentially helpful for logging (?)
|
emit DependencyManager::get<WindowScriptingInterface>()->snapshotShared(reply.readAll());
|
||||||
emit DependencyManager::get<WindowScriptingInterface>()->snapshotShared(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SnapshotUploader::createStorySuccess(QNetworkReply& reply) {
|
void SnapshotUploader::createStorySuccess(QNetworkReply& reply) {
|
||||||
emit DependencyManager::get<WindowScriptingInterface>()->snapshotShared(true);
|
emit DependencyManager::get<WindowScriptingInterface>()->snapshotShared("");
|
||||||
}
|
}
|
||||||
|
|
||||||
void SnapshotUploader::createStoryFailure(QNetworkReply& reply) {
|
void SnapshotUploader::createStoryFailure(QNetworkReply& reply) {
|
||||||
// TODO: parse response, potentially helpful for logging (?)
|
emit DependencyManager::get<WindowScriptingInterface>()->snapshotShared(reply.readAll());
|
||||||
emit DependencyManager::get<WindowScriptingInterface>()->snapshotShared(false);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ function showFeedWindow() {
|
||||||
|
|
||||||
var outstanding;
|
var outstanding;
|
||||||
function confirmShare(data) {
|
function confirmShare(data) {
|
||||||
var dialog = new OverlayWebWindow('Snapshot Review', Script.resolvePath("html/ShareSnapshot.html"), 800, 470);
|
var dialog = new OverlayWebWindow('Snapshot Review', Script.resolvePath("html/SnapshotReview.html"), 800, 470);
|
||||||
function onMessage(message) {
|
function onMessage(message) {
|
||||||
// Receives message from the html dialog via the qwebchannel EventBridge. This is complicated by the following:
|
// Receives message from the html dialog via the qwebchannel EventBridge. This is complicated by the following:
|
||||||
// 1. Although we can send POJOs, we cannot receive a toplevel object. (Arrays of POJOs are fine, though.)
|
// 1. Although we can send POJOs, we cannot receive a toplevel object. (Arrays of POJOs are fine, though.)
|
||||||
|
@ -82,13 +82,11 @@ function confirmShare(data) {
|
||||||
dialog.raise();
|
dialog.raise();
|
||||||
}
|
}
|
||||||
|
|
||||||
function snapshotShared(success) {
|
function snapshotShared(errorMessage) {
|
||||||
if (success) {
|
if (!errorMessage) {
|
||||||
// for now just print status
|
|
||||||
print('snapshot uploaded and shared');
|
print('snapshot uploaded and shared');
|
||||||
} else {
|
} else {
|
||||||
// for now just print an error.
|
print(errorMessage);
|
||||||
print('snapshot upload/share failed');
|
|
||||||
}
|
}
|
||||||
if ((--outstanding <= 0) && shouldOpenFeedAfterShare()) {
|
if ((--outstanding <= 0) && shouldOpenFeedAfterShare()) {
|
||||||
showFeedWindow();
|
showFeedWindow();
|
||||||
|
|
Loading…
Reference in a new issue