mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:35:08 +02:00
Added temp fix to ModelUploader dialog too
This commit is contained in:
parent
e33da2a741
commit
2b44b03a27
2 changed files with 28 additions and 8 deletions
|
@ -344,6 +344,9 @@ Application::Application(int& argc, char** argv, timeval &startup_time) :
|
|||
} else {
|
||||
// do this as late as possible so that all required subsystems are inialized
|
||||
loadScripts();
|
||||
|
||||
QMutexLocker locker(&_settingsMutex);
|
||||
_previousScriptLocation = _settings->value("LastScriptLocation", QVariant("")).toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3184,11 +3187,10 @@ void Application::packetSent(quint64 length) {
|
|||
|
||||
void Application::loadScripts() {
|
||||
// loads all saved scripts
|
||||
|
||||
lockSettings();
|
||||
int size = _settings->beginReadArray("Settings");
|
||||
int size = lockSettings()->beginReadArray("Settings");
|
||||
unlockSettings();
|
||||
for (int i = 0; i < size; ++i){
|
||||
_settings->setArrayIndex(i);
|
||||
lockSettings()->setArrayIndex(i);
|
||||
QString string = _settings->value("script").toString();
|
||||
unlockSettings();
|
||||
if (!string.isEmpty()) {
|
||||
|
|
|
@ -20,7 +20,9 @@
|
|||
|
||||
#include <AccountManager.h>
|
||||
|
||||
#include "Application.h"
|
||||
#include "renderer/FBXReader.h"
|
||||
|
||||
#include "ModelUploader.h"
|
||||
|
||||
|
||||
|
@ -32,6 +34,8 @@ static const QString LOD_FIELD = "lod";
|
|||
static const QString S3_URL = "http://highfidelity-public.s3-us-west-1.amazonaws.com";
|
||||
static const QString MODEL_URL = "/api/v1/models";
|
||||
|
||||
static const QString SETTING_NAME = "LastModelUploadLocation";
|
||||
|
||||
static const int MAX_SIZE = 10 * 1024 * 1024; // 10 MB
|
||||
static const int TIMEOUT = 1000;
|
||||
static const int MAX_CHECK = 30;
|
||||
|
@ -49,6 +53,7 @@ ModelUploader::ModelUploader(bool isHead) :
|
|||
_numberOfChecks(MAX_CHECK)
|
||||
{
|
||||
connect(&_timer, SIGNAL(timeout()), SLOT(checkS3()));
|
||||
|
||||
}
|
||||
|
||||
ModelUploader::~ModelUploader() {
|
||||
|
@ -57,14 +62,27 @@ ModelUploader::~ModelUploader() {
|
|||
|
||||
bool ModelUploader::zip() {
|
||||
// File Dialog
|
||||
QString filename = QFileDialog::getOpenFileName(NULL,
|
||||
"Select your .fst file ...",
|
||||
QStandardPaths::writableLocation(QStandardPaths::HomeLocation),
|
||||
"*.fst");
|
||||
QSettings* settings = Application::getInstance()->lockSettings();
|
||||
QString lastLocation = settings->value(SETTING_NAME).toString();
|
||||
|
||||
if (lastLocation.isEmpty()) {
|
||||
lastLocation = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation);
|
||||
// Temporary fix to Qt bug: http://stackoverflow.com/questions/16194475
|
||||
#ifdef __APPLE__
|
||||
lastLocation.append("/model.fst");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
QString filename = QFileDialog::getOpenFileName(NULL, "Select your .fst file ...", lastLocation, "*.fst");
|
||||
if (filename == "") {
|
||||
// If the user canceled we return.
|
||||
Application::getInstance()->unlockSettings();
|
||||
return false;
|
||||
}
|
||||
settings->setValue(SETTING_NAME, filename);
|
||||
Application::getInstance()->unlockSettings();
|
||||
|
||||
bool _nameIsPresent = false;
|
||||
QString texDir;
|
||||
QString fbxFile;
|
||||
|
|
Loading…
Reference in a new issue