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