mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 20:33:09 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into HEAD
Conflicts: interface/interface_en.ts interface/src/Application.cpp
This commit is contained in:
commit
4a1687c023
5 changed files with 50 additions and 36 deletions
|
@ -4,30 +4,22 @@
|
||||||
<context>
|
<context>
|
||||||
<name>Application</name>
|
<name>Application</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/Application.cpp" line="1389"/>
|
<location filename="src/Application.cpp" line="1370"/>
|
||||||
<source>Export Voxels</source>
|
<source>Export Voxels</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/Application.cpp" line="1390"/>
|
<location filename="src/Application.cpp" line="1371"/>
|
||||||
<source>Sparse Voxel Octree Files (*.svo)</source>
|
<source>Sparse Voxel Octree Files (*.svo)</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<<<<<<< HEAD
|
<location filename="src/Application.cpp" line="3723"/>
|
||||||
<location filename="src/Application.cpp" line="3722"/>
|
|
||||||
=======
|
|
||||||
<location filename="src/Application.cpp" line="3734"/>
|
|
||||||
>>>>>>> 0fa910c61fd4ffb4e4eb4b7c53f1e67da9ac0913
|
|
||||||
<source>Open Script</source>
|
<source>Open Script</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<<<<<<< HEAD
|
<location filename="src/Application.cpp" line="3724"/>
|
||||||
<location filename="src/Application.cpp" line="3723"/>
|
|
||||||
=======
|
|
||||||
<location filename="src/Application.cpp" line="3735"/>
|
|
||||||
>>>>>>> 0fa910c61fd4ffb4e4eb4b7c53f1e67da9ac0913
|
|
||||||
<source>JavaScript Files (*.js)</source>
|
<source>JavaScript Files (*.js)</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
|
@ -112,8 +112,6 @@ const QString SKIP_FILENAME = QStandardPaths::writableLocation(QStandardPaths::D
|
||||||
|
|
||||||
const int STATS_PELS_PER_LINE = 20;
|
const int STATS_PELS_PER_LINE = 20;
|
||||||
|
|
||||||
const QString CUSTOM_URL_SCHEME = "hifi:";
|
|
||||||
|
|
||||||
void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString& message) {
|
void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString& message) {
|
||||||
if (message.size() > 0) {
|
if (message.size() > 0) {
|
||||||
QString dateString = QDateTime::currentDateTime().toTimeSpec(Qt::LocalTime).toString(Qt::ISODate);
|
QString dateString = QDateTime::currentDateTime().toTimeSpec(Qt::LocalTime).toString(Qt::ISODate);
|
||||||
|
@ -688,26 +686,9 @@ bool Application::event(QEvent* event) {
|
||||||
// handle custom URL
|
// handle custom URL
|
||||||
if (event->type() == QEvent::FileOpen) {
|
if (event->type() == QEvent::FileOpen) {
|
||||||
QFileOpenEvent* fileEvent = static_cast<QFileOpenEvent*>(event);
|
QFileOpenEvent* fileEvent = static_cast<QFileOpenEvent*>(event);
|
||||||
if (!fileEvent->url().isEmpty() && fileEvent->url().toLocalFile().startsWith(CUSTOM_URL_SCHEME)) {
|
bool isHifiSchemeURL = !fileEvent->url().isEmpty() && fileEvent->url().toLocalFile().startsWith(CUSTOM_URL_SCHEME);
|
||||||
QString destination = fileEvent->url().toLocalFile().remove(CUSTOM_URL_SCHEME);
|
if (isHifiSchemeURL) {
|
||||||
QStringList urlParts = destination.split('/', QString::SkipEmptyParts);
|
Menu::getInstance()->goTo(fileEvent->url().toString());
|
||||||
|
|
||||||
if (urlParts.count() > 1) {
|
|
||||||
// if url has 2 or more parts, the first one is domain name
|
|
||||||
Menu::getInstance()->goToDomain(urlParts[0]);
|
|
||||||
|
|
||||||
// location coordinates
|
|
||||||
Menu::getInstance()->goToDestination(urlParts[1]);
|
|
||||||
if (urlParts.count() > 2) {
|
|
||||||
|
|
||||||
// location orientation
|
|
||||||
Menu::getInstance()->goToOrientation(urlParts[2]);
|
|
||||||
}
|
|
||||||
} else if (urlParts.count() == 1) {
|
|
||||||
|
|
||||||
// location coordinates
|
|
||||||
Menu::getInstance()->goToDestination(urlParts[0]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -95,6 +95,7 @@ static const float NODE_KILLED_GREEN = 0.0f;
|
||||||
static const float NODE_KILLED_BLUE = 0.0f;
|
static const float NODE_KILLED_BLUE = 0.0f;
|
||||||
|
|
||||||
static const QString SNAPSHOT_EXTENSION = ".jpg";
|
static const QString SNAPSHOT_EXTENSION = ".jpg";
|
||||||
|
static const QString CUSTOM_URL_SCHEME = "hifi:";
|
||||||
|
|
||||||
static const float BILLBOARD_FIELD_OF_VIEW = 30.0f; // degrees
|
static const float BILLBOARD_FIELD_OF_VIEW = 30.0f; // degrees
|
||||||
static const float BILLBOARD_DISTANCE = 5.0f; // meters
|
static const float BILLBOARD_DISTANCE = 5.0f; // meters
|
||||||
|
|
|
@ -926,19 +926,58 @@ bool Menu::goToDestination(QString destination) {
|
||||||
return LocationManager::getInstance().goToDestination(destination);
|
return LocationManager::getInstance().goToDestination(destination);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Menu::goTo(QString destination) {
|
||||||
|
LocationManager::getInstance().goTo(destination);
|
||||||
|
}
|
||||||
|
|
||||||
void Menu::goTo() {
|
void Menu::goTo() {
|
||||||
|
|
||||||
QInputDialog gotoDialog(Application::getInstance()->getWindow());
|
QInputDialog gotoDialog(Application::getInstance()->getWindow());
|
||||||
gotoDialog.setWindowTitle("Go to");
|
gotoDialog.setWindowTitle("Go to");
|
||||||
gotoDialog.setLabelText("Destination:");
|
gotoDialog.setLabelText("Destination or URL:\n @user, #place, hifi://domain/location/orientation");
|
||||||
QString destination = QString();
|
QString destination = QString();
|
||||||
|
|
||||||
gotoDialog.setTextValue(destination);
|
gotoDialog.setTextValue(destination);
|
||||||
gotoDialog.setWindowFlags(Qt::Sheet);
|
gotoDialog.setWindowFlags(Qt::Sheet);
|
||||||
gotoDialog.resize(gotoDialog.parentWidget()->size().width() * DIALOG_RATIO_OF_WINDOW, gotoDialog.size().height());
|
gotoDialog.resize(gotoDialog.parentWidget()->size().width() * DIALOG_RATIO_OF_WINDOW, gotoDialog.size().height());
|
||||||
|
|
||||||
int dialogReturn = gotoDialog.exec();
|
int dialogReturn = gotoDialog.exec();
|
||||||
if (dialogReturn == QDialog::Accepted && !gotoDialog.textValue().isEmpty()) {
|
if (dialogReturn == QDialog::Accepted && !gotoDialog.textValue().isEmpty()) {
|
||||||
goToUser(gotoDialog.textValue());
|
QString desiredDestination = gotoDialog.textValue();
|
||||||
|
|
||||||
|
if (desiredDestination.startsWith(CUSTOM_URL_SCHEME + "//")) {
|
||||||
|
QStringList urlParts = desiredDestination.remove(0, CUSTOM_URL_SCHEME.length() + 2).split('/', QString::SkipEmptyParts);
|
||||||
|
|
||||||
|
if (urlParts.count() > 1) {
|
||||||
|
// if url has 2 or more parts, the first one is domain name
|
||||||
|
QString domain = urlParts[0];
|
||||||
|
|
||||||
|
// second part is either a destination coordinate or
|
||||||
|
// a place name
|
||||||
|
QString destination = urlParts[1];
|
||||||
|
|
||||||
|
// any third part is an avatar orientation.
|
||||||
|
QString orientation = urlParts.count() > 2 ? urlParts[2] : QString();
|
||||||
|
|
||||||
|
goToDomain(domain);
|
||||||
|
|
||||||
|
// goto either @user, #place, or x-xx,y-yy,z-zz
|
||||||
|
// style co-ordinate.
|
||||||
|
goTo(destination);
|
||||||
|
|
||||||
|
if (!orientation.isEmpty()) {
|
||||||
|
// location orientation
|
||||||
|
goToOrientation(orientation);
|
||||||
|
}
|
||||||
|
} else if (urlParts.count() == 1) {
|
||||||
|
// location coordinates or place name
|
||||||
|
QString destination = urlParts[0];
|
||||||
|
goTo(destination);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
goToUser(gotoDialog.textValue());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
sendFakeEnterEvent();
|
sendFakeEnterEvent();
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,6 +108,7 @@ public:
|
||||||
bool goToDestination(QString destination);
|
bool goToDestination(QString destination);
|
||||||
void goToOrientation(QString orientation);
|
void goToOrientation(QString orientation);
|
||||||
void goToDomain(const QString newDomain);
|
void goToDomain(const QString newDomain);
|
||||||
|
void goTo(QString destination);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue