mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 12:23:24 +02:00
Add fbx upload on drop
This commit is contained in:
parent
2d12b2ba9a
commit
b666acdb26
4 changed files with 22 additions and 5 deletions
|
@ -157,6 +157,7 @@ static const QString SVO_EXTENSION = ".svo";
|
|||
static const QString SVO_JSON_EXTENSION = ".svo.json";
|
||||
static const QString JS_EXTENSION = ".js";
|
||||
static const QString FST_EXTENSION = ".fst";
|
||||
static const QString FBX_EXTENSION = ".fbx";
|
||||
|
||||
static const int MIRROR_VIEW_TOP_PADDING = 5;
|
||||
static const int MIRROR_VIEW_LEFT_PADDING = 10;
|
||||
|
@ -190,6 +191,15 @@ static const QString DESKTOP_LOCATION = QStandardPaths::writableLocation(QStanda
|
|||
const QString DEFAULT_SCRIPTS_JS_URL = "http://s3.amazonaws.com/hifi-public/scripts/defaultScripts.js";
|
||||
Setting::Handle<int> maxOctreePacketsPerSecond("maxOctreePPS", DEFAULT_MAX_OCTREE_PPS);
|
||||
|
||||
const QHash<QString, Application::AcceptURLMethod> Application::_acceptedExtensions {
|
||||
{ SNAPSHOT_EXTENSION, &Application::acceptSnapshot },
|
||||
{ SVO_EXTENSION, &Application::importSVOFromURL },
|
||||
{ SVO_JSON_EXTENSION, &Application::importSVOFromURL },
|
||||
{ JS_EXTENSION, &Application::askToLoadScript },
|
||||
{ FST_EXTENSION, &Application::askToSetAvatarUrl },
|
||||
{ FBX_EXTENSION, &Application::askToUploadAsset }
|
||||
};
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
class MyNativeEventFilter : public QAbstractNativeEventFilter {
|
||||
public:
|
||||
|
@ -4072,6 +4082,14 @@ bool Application::askToLoadScript(const QString& scriptFilenameOrURL) {
|
|||
return true;
|
||||
}
|
||||
|
||||
#include "ui/AssetUploadDialogFactory.h"
|
||||
bool Application::askToUploadAsset(const QString& filename) {
|
||||
if (!filename.isEmpty()) {
|
||||
AssetUploadDialogFactory::getInstance().showDialog(filename);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
ScriptEngine* Application::loadScript(const QString& scriptFilename, bool isUserLoaded,
|
||||
bool loadScriptFromEditor, bool activateMainWindow, bool reload) {
|
||||
|
||||
|
|
|
@ -327,6 +327,7 @@ private slots:
|
|||
bool acceptSnapshot(const QString& urlString);
|
||||
bool askToSetAvatarUrl(const QString& url);
|
||||
bool askToLoadScript(const QString& scriptFilenameOrURL);
|
||||
bool askToUploadAsset(const QString& asset);
|
||||
|
||||
void setSessionUUID(const QUuid& sessionUUID);
|
||||
void domainChanged(const QString& domainHostname);
|
||||
|
|
|
@ -29,10 +29,6 @@ AssetUploadDialogFactory& AssetUploadDialogFactory::getInstance() {
|
|||
return staticInstance;
|
||||
}
|
||||
|
||||
AssetUploadDialogFactory::AssetUploadDialogFactory() {
|
||||
|
||||
}
|
||||
|
||||
static const QString PERMISSION_DENIED_ERROR = "You do not have permission to upload content to this asset-server.";
|
||||
|
||||
void AssetUploadDialogFactory::showDialog() {
|
||||
|
|
|
@ -27,12 +27,14 @@ public:
|
|||
static AssetUploadDialogFactory& getInstance();
|
||||
|
||||
void setDialogParent(QWidget* dialogParent) { _dialogParent = dialogParent; }
|
||||
|
||||
public slots:
|
||||
void showDialog();
|
||||
private slots:
|
||||
void handleUploadFinished(AssetUpload* upload, const QString& hash);
|
||||
|
||||
private:
|
||||
AssetUploadDialogFactory();
|
||||
AssetUploadDialogFactory() = default;
|
||||
|
||||
void showErrorDialog(const QString& filename, const QString& additionalError);
|
||||
|
||||
|
|
Loading…
Reference in a new issue