Showing the changes to interface/src/Application.cpp (1 of 3 files). Show all
Unified · Split
| @@ -172,7 +172,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 171 unmodified lines | |||
| 172 | _nodeBoundsDisplay(this), | 172 | _nodeBoundsDisplay(this), |
| 173 | _previousScriptLocation(), | 173 | _previousScriptLocation(), |
| 174 | _runningScriptsWidget(new RunningScriptsWidget(_window)), | 174 | _runningScriptsWidget(new RunningScriptsWidget(_window)), |
| 175 | _runningScriptsWidgetWasVisible(false) | 175 | _runningScriptsWidgetWasVisible(false), |
| 176 | _trayIcon(new QSystemTrayIcon(_window)) | ||
| 176 | { | 177 | { |
| 177 | // read the ApplicationInfo.ini file for Name/Version/Domain information | 178 | // read the ApplicationInfo.ini file for Name/Version/Domain information |
| 178 | QSettings applicationInfo(Application::resourcesPath() + "info/ApplicationInfo.ini", QSettings::IniFormat); | 179 | QSettings applicationInfo(Application::resourcesPath() + "info/ApplicationInfo.ini", QSettings::IniFormat); |
| @@ -242,7 +243,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 63 unmodified lines | |||
| 242 | QTimer* locationUpdateTimer = new QTimer(this); | 243 | QTimer* locationUpdateTimer = new QTimer(this); |
| 243 | connect(locationUpdateTimer, &QTimer::timeout, this, &Application::updateLocationInServer); | 244 | connect(locationUpdateTimer, &QTimer::timeout, this, &Application::updateLocationInServer); |
| 244 | locationUpdateTimer->start(DATA_SERVER_LOCATION_CHANGE_UPDATE_MSECS); | 245 | locationUpdateTimer->start(DATA_SERVER_LOCATION_CHANGE_UPDATE_MSECS); |
| 245 | 246 | ||
| 246 | connect(nodeList, &NodeList::nodeAdded, this, &Application::nodeAdded); | 247 | connect(nodeList, &NodeList::nodeAdded, this, &Application::nodeAdded); |
| 247 | connect(nodeList, &NodeList::nodeKilled, this, &Application::nodeKilled); | 248 | connect(nodeList, &NodeList::nodeKilled, this, &Application::nodeKilled); |
| 248 | connect(nodeList, SIGNAL(nodeKilled(SharedNodePointer)), SLOT(nodeKilled(SharedNodePointer))); | 249 | connect(nodeList, SIGNAL(nodeKilled(SharedNodePointer)), SLOT(nodeKilled(SharedNodePointer))); |
| @@ -251,16 +252,16 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 2 unmodified lines | |||
| 251 | connect(nodeList, &NodeList::uuidChanged, this, &Application::updateWindowTitle); | 252 | connect(nodeList, &NodeList::uuidChanged, this, &Application::updateWindowTitle); |
| 252 | connect(nodeList, SIGNAL(uuidChanged(const QUuid&)), _myAvatar, SLOT(setSessionUUID(const QUuid&))); | 253 | connect(nodeList, SIGNAL(uuidChanged(const QUuid&)), _myAvatar, SLOT(setSessionUUID(const QUuid&))); |
| 253 | connect(nodeList, &NodeList::limitOfSilentDomainCheckInsReached, nodeList, &NodeList::reset); | 254 | connect(nodeList, &NodeList::limitOfSilentDomainCheckInsReached, nodeList, &NodeList::reset); |
| 254 | 255 | ||
| 255 | // connect to appropriate slots on AccountManager | 256 | // connect to appropriate slots on AccountManager |
| 256 | AccountManager& accountManager = AccountManager::getInstance(); | 257 | AccountManager& accountManager = AccountManager::getInstance(); |
| 257 | 258 | ||
| 258 | const qint64 BALANCE_UPDATE_INTERVAL_MSECS = 5 * 1000; | 259 | const qint64 BALANCE_UPDATE_INTERVAL_MSECS = 5 * 1000; |
| 259 | 260 | ||
| 260 | QTimer* balanceUpdateTimer = new QTimer(this); | 261 | QTimer* balanceUpdateTimer = new QTimer(this); |
| 261 | connect(balanceUpdateTimer, &QTimer::timeout, &accountManager, &AccountManager::updateBalance); | 262 | connect(balanceUpdateTimer, &QTimer::timeout, &accountManager, &AccountManager::updateBalance); |
| 262 | balanceUpdateTimer->start(BALANCE_UPDATE_INTERVAL_MSECS); | 263 | balanceUpdateTimer->start(BALANCE_UPDATE_INTERVAL_MSECS); |
| 263 | 264 | ||
| 264 | connect(&accountManager, &AccountManager::balanceChanged, this, &Application::updateWindowTitle); | 265 | connect(&accountManager, &AccountManager::balanceChanged, this, &Application::updateWindowTitle); |
| 265 | 266 | ||
| 266 | connect(&accountManager, &AccountManager::authRequired, Menu::getInstance(), &Menu::loginForCurrentDomain); | 267 | connect(&accountManager, &AccountManager::authRequired, Menu::getInstance(), &Menu::loginForCurrentDomain); |
| @@ -391,6 +392,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 124 unmodified lines | |||
| 391 | OAuthWebViewHandler::getInstance(); | 392 | OAuthWebViewHandler::getInstance(); |
| 392 | // make sure the High Fidelity root CA is in our list of trusted certs | 393 | // make sure the High Fidelity root CA is in our list of trusted certs |
| 393 | OAuthWebViewHandler::addHighFidelityRootCAToSSLConfig(); | 394 | OAuthWebViewHandler::addHighFidelityRootCAToSSLConfig(); |
| 395 | |||
| 396 | _trayIcon->show(); | ||
| 394 | } | 397 | } |
| 395 | 398 | ||
| 396 | Application::~Application() { | 399 | Application::~Application() { |
| @@ -562,7 +565,7 @@ void Application::paintGL() { · 165 unmodified lines | |||
| 562 | PerformanceWarning warn(showWarnings, "Application::paintGL()"); | 565 | PerformanceWarning warn(showWarnings, "Application::paintGL()"); |
| 563 | 566 | ||
| 564 | glEnable(GL_LINE_SMOOTH); | 567 | glEnable(GL_LINE_SMOOTH); |
| 565 | 568 | ||
| 566 | if (_myCamera.getMode() == CAMERA_MODE_FIRST_PERSON) { | 569 | if (_myCamera.getMode() == CAMERA_MODE_FIRST_PERSON) { |
| 567 | _myCamera.setTightness(0.0f); // In first person, camera follows (untweaked) head exactly without delay | 570 | _myCamera.setTightness(0.0f); // In first person, camera follows (untweaked) head exactly without delay |
| 568 | _myCamera.setTargetPosition(_myAvatar->getHead()->calculateAverageEyePosition()); | 571 | _myCamera.setTargetPosition(_myAvatar->getHead()->calculateAverageEyePosition()); |
| @@ -3110,18 +3113,18 @@ void Application::updateWindowTitle(){ · 2541 unmodified lines | |||
| 3110 | QString username = AccountManager::getInstance().getAccountInfo().getUsername(); | 3113 | QString username = AccountManager::getInstance().getAccountInfo().getUsername(); |
| 3111 | QString title = QString() + (!username.isEmpty() ? username + " @ " : QString()) | 3114 | QString title = QString() + (!username.isEmpty() ? username + " @ " : QString()) |
| 3112 | + nodeList->getDomainHandler().getHostname() + buildVersion; | 3115 | + nodeList->getDomainHandler().getHostname() + buildVersion; |
| 3113 | 3116 | ||
| 3114 | AccountManager& accountManager = AccountManager::getInstance(); | 3117 | AccountManager& accountManager = AccountManager::getInstance(); |
| 3115 | if (accountManager.getAccountInfo().hasBalance()) { | 3118 | if (accountManager.getAccountInfo().hasBalance()) { |
| 3116 | float creditBalance = accountManager.getAccountInfo().getBalance() / SATOSHIS_PER_CREDIT; | 3119 | float creditBalance = accountManager.getAccountInfo().getBalance() / SATOSHIS_PER_CREDIT; |
| 3117 | 3120 | ||
| 3118 | QString creditBalanceString; | 3121 | QString creditBalanceString; |
| 3119 | creditBalanceString.sprintf("%.8f", creditBalance); | 3122 | creditBalanceString.sprintf("%.8f", creditBalance); |
| 3120 | 3123 | ||
| 3121 | title += " - ₵" + creditBalanceString; | 3124 | title += " - ₵" + creditBalanceString; |
| 3122 | } | 3125 | } |
| 3123 | 3126 | ||
| 3124 | qDebug("Application title set to: %s", title.toStdString().c_str()); | 3127 | qDebug("Application title set to: %s", title.toStdString().c_str()); |
| 3125 | _window->setWindowTitle(title); | 3128 | _window->setWindowTitle(title); |
| 3126 | } | 3129 | } |
| 3127 | 3130 | ||