History

Merge branch 'master' of https://github.com/highfidelity/hifi into temp0

Sam Gateau committed 12 years ago

Commit bd5c6512 parents 738369e 864dd01120 files · +7329 −2521Browse files

Showing the changes to interface/src/Application.cpp (1 of 120 files). Show all

Unified · Split

interface/src/Application.cpp+26−11
@@ -299,9 +299,16 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 298 unmodified lines
299299
300300 AddressManager& addressManager = AddressManager::getInstance();
301301
302− // connect to the domainChangeRequired signal on AddressManager
303− connect(&addressManager, &AddressManager::possibleDomainChangeRequired,
302+ // use our MyAvatar position and quat for address manager path
303+ addressManager.setPositionGetter(getPositionForPath);
304+ addressManager.setOrientationGetter(getOrientationForPath);
305+
306+ // handle domain change signals from AddressManager
307+ connect(&addressManager, &AddressManager::possibleDomainChangeRequiredToHostname,
304308 this, &Application::changeDomainHostname);
309+
310+ connect(&addressManager, &AddressManager::possibleDomainChangeRequiredViaICEForID,
311+ &domainHandler, &DomainHandler::setIceServerHostnameAndID);
305312
306313 _settings = new QSettings(this);
307314 _numChangedSettings = 0;
@@ -1796,16 +1803,25 @@ void Application::init() { · 1488 unmodified lines
17961803
17971804 Menu::getInstance()->loadSettings();
17981805 _audio.setReceivedAudioStreamSettings(Menu::getInstance()->getReceivedAudioStreamSettings());
1799−
1800− qDebug() << "Loaded settings";
18011806
18021807 // when --url in command line, teleport to location
18031808 const QString HIFI_URL_COMMAND_LINE_KEY = "--url";
18041809 int urlIndex = arguments().indexOf(HIFI_URL_COMMAND_LINE_KEY);
18051810 if (urlIndex != -1) {
18061811 AddressManager::getInstance().handleLookupString(arguments().value(urlIndex + 1));
1812+ } else {
1813+ // check if we have a URL in settings to load to jump back to
1814+ // we load this separate from the other settings so we don't double lookup a URL
1815+ QSettings* interfaceSettings = lockSettings();
1816+ QUrl addressURL = interfaceSettings->value(SETTINGS_ADDRESS_KEY).toUrl();
1817+
1818+ AddressManager::getInstance().handleLookupString(addressURL.toString());
1819+
1820+ unlockSettings();
18071821 }
18081822
1823+ qDebug() << "Loaded settings";
1824+
18091825 #ifdef __APPLE__
18101826 if (Menu::getInstance()->isOptionChecked(MenuOption::SixenseEnabled)) {
18111827 // on OS X we only setup sixense if the user wants it on - this allows running without the hid_init crash
@@ -3426,7 +3442,7 @@ void Application::updateWindowTitle(){ · 1614 unmodified lines
34263442 QString connectionStatus = nodeList->getDomainHandler().isConnected() ? "" : " (NOT CONNECTED) ";
34273443 QString username = AccountManager::getInstance().getAccountInfo().getUsername();
34283444 QString title = QString() + (!username.isEmpty() ? username + " @ " : QString())
3429− + nodeList->getDomainHandler().getHostname() + connectionStatus + buildVersion;
3445+ + AddressManager::getInstance().getCurrentDomain() + connectionStatus + buildVersion;
34303446
34313447 AccountManager& accountManager = AccountManager::getInstance();
34323448 if (accountManager.getAccountInfo().hasBalance()) {
@@ -3448,25 +3464,23 @@ void Application::updateWindowTitle(){ · 15 unmodified lines
34483464 void Application::updateLocationInServer() {
34493465
34503466 AccountManager& accountManager = AccountManager::getInstance();
3451− const QUuid& domainUUID = NodeList::getInstance()->getDomainHandler().getUUID();
3467+ DomainHandler& domainHandler = NodeList::getInstance()->getDomainHandler();
34523468
3453− if (accountManager.isLoggedIn() && !domainUUID.isNull()) {
3469+ if (accountManager.isLoggedIn() && domainHandler.isConnected() && !domainHandler.getUUID().isNull()) {
34543470
34553471 // construct a QJsonObject given the user's current address information
34563472 QJsonObject rootObject;
34573473
34583474 QJsonObject locationObject;
34593475
3460− QString pathString = AddressManager::pathForPositionAndOrientation(_myAvatar->getPosition(),
3461− true,
3462− _myAvatar->getOrientation());
3476+ QString pathString = AddressManager::getInstance().currentPath();
34633477
34643478 const QString LOCATION_KEY_IN_ROOT = "location";
34653479 const QString PATH_KEY_IN_LOCATION = "path";
34663480 const QString DOMAIN_ID_KEY_IN_LOCATION = "domain_id";
34673481
34683482 locationObject.insert(PATH_KEY_IN_LOCATION, pathString);
3469− locationObject.insert(DOMAIN_ID_KEY_IN_LOCATION, domainUUID.toString());
3483+ locationObject.insert(DOMAIN_ID_KEY_IN_LOCATION, domainHandler.getUUID().toString());
34703484
34713485 rootObject.insert(LOCATION_KEY_IN_ROOT, locationObject);
34723486
@@ -3876,6 +3890,7 @@ ScriptEngine* Application::loadScript(const QString& scriptFilename, bool isUser · 403 unmodified lines
38763890 connect(scriptEngine, SIGNAL(loadScript(const QString&, bool)), this, SLOT(loadScript(const QString&, bool)));
38773891
38783892 scriptEngine->registerGlobalObject("Overlays", &_overlays);
3893+ qScriptRegisterMetaType(scriptEngine, RayToOverlayIntersectionResultToScriptValue, RayToOverlayIntersectionResultFromScriptValue);
38793894
38803895 QScriptValue windowValue = scriptEngine->registerGlobalObject("Window", WindowScriptingInterface::getInstance());
38813896 scriptEngine->registerGetterSetter("location", LocationScriptingInterface::locationGetter,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t