summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-06-14 02:05:06 -0400
committerisanae <14251494+isanae@users.noreply.github.com>2019-06-14 02:05:06 -0400
commiteed0f1503d2b2bf03d1ad823c72f7d279a1b41f6 (patch)
treecc2d4dbe45ce3f50c3e3b0b9cf19cae47a118e2b /src/mainwindow.cpp
parentd527d62b2b671b52e74a34f24a701c18d7632477 (diff)
re-added the api label tooltip
comments
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 250bc1d7..205ab7cc 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -227,13 +227,30 @@ MainWindow::MainWindow(QSettings &initSettings
QWebEngineProfile::defaultProfile()->setPersistentStoragePath(m_OrganizerCore.settings().getCacheDirectory());
ui->setupUi(this);
+ m_statusBar.reset(new StatusBar(statusBar(), ui));
{
auto* ni = NexusInterface::instance(&m_PluginContainer);
+ // there are two ways to get here:
+ // 1) the user just started MO, and
+ // 2) the user has changed some setting that required a restart
+ //
+ // "restarting" MO doesn't actually re-execute the binary, it just basically
+ // executes most of main() again, so a bunch of things are actually not
+ // reset
+ //
+ // one of these things is the api status, which will have fired its events
+ // long before the execution gets here because stuff is still cached and no
+ // real request to nexus is actually done
+ //
+ // therefore, when the user starts MO normally, the user account and stats
+ // will be empty (which is fine) and populated later on when the api key
+ // check has finished
+ //
+ // in the rare case where the user restarts MO through the settings, this
+ // will correctly pick up the previous values
updateWindowTitle(ni->getAPIUserAccount());
-
- m_statusBar.reset(new StatusBar(statusBar(), ui));
m_statusBar->setAPI(ni->getAPIStats(), ni->getAPIUserAccount());
}