summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2020-04-17 10:01:33 -0400
committerisanae <14251494+isanae@users.noreply.github.com>2020-04-17 10:01:33 -0400
commitf43c11497df6550ac224e0965b7a07d4c548055b (patch)
tree76bab367f5cc13cb16841aaa30def6f1c903d254 /src
parent014df88aa874fcfc4c76fd13ad23deddecb7570d (diff)
added game, instance and profile to status bar
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.cpp2
-rw-r--r--src/statusbar.cpp36
-rw-r--r--src/statusbar.h4
3 files changed, 39 insertions, 3 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index cac9a0b9..df1063ba 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -523,6 +523,7 @@ MainWindow::MainWindow(Settings &settings
updatePluginCount();
updateModCount();
processUpdates();
+ ui->statusBar->updateNormalMessage(m_OrganizerCore);
}
void MainWindow::setupModList()
@@ -1699,6 +1700,7 @@ void MainWindow::activateSelectedProfile()
m_OrganizerCore.refreshModList();
updateModCount();
updatePluginCount();
+ ui->statusBar->updateNormalMessage(m_OrganizerCore);
}
void MainWindow::on_profileBox_currentIndexChanged(int index)
diff --git a/src/statusbar.cpp b/src/statusbar.cpp
index 58189619..5897b6bb 100644
--- a/src/statusbar.cpp
+++ b/src/statusbar.cpp
@@ -1,12 +1,15 @@
#include "statusbar.h"
#include "nexusinterface.h"
#include "settings.h"
+#include "organizercore.h"
+#include "instancemanager.h"
#include "ui_mainwindow.h"
StatusBar::StatusBar(QWidget* parent) :
- QStatusBar(parent), ui(nullptr), m_progress(new QProgressBar),
- m_progressSpacer1(new QWidget), m_progressSpacer2(new QWidget),
- m_notifications(nullptr), m_update(nullptr), m_api(new QLabel)
+ QStatusBar(parent), ui(nullptr), m_normal(new QLabel),
+ m_progress(new QProgressBar), m_progressSpacer1(new QWidget),
+ m_progressSpacer2(new QWidget), m_notifications(nullptr), m_update(nullptr),
+ m_api(new QLabel)
{
}
@@ -16,6 +19,8 @@ void StatusBar::setup(Ui::MainWindow* mainWindowUI, const Settings& settings)
m_notifications = new StatusBarAction(ui->actionNotifications);
m_update = new StatusBarAction(ui->actionUpdate);
+ addWidget(m_normal);
+
m_progressSpacer1->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
addPermanentWidget(m_progressSpacer1, 0);
addPermanentWidget(m_progress);
@@ -138,6 +143,31 @@ void StatusBar::checkSettings(const Settings& settings)
m_api->setVisible(!settings.interface().hideAPICounter());
}
+void StatusBar::updateNormalMessage(OrganizerCore& core)
+{
+ QString game;
+
+ if (core.managedGame()) {
+ game = core.managedGame()->gameName();
+ } else {
+ game = tr("Unknown game");
+ }
+
+ QString instance = InstanceManager::instance().currentInstance();
+ if (instance.isEmpty()) {
+ instance = tr("Portable");
+ }
+
+ QString profile = core.profileName();
+
+ const auto s = QString("%1 - %2 - %3")
+ .arg(game)
+ .arg(instance)
+ .arg(profile);
+
+ m_normal->setText(s);
+}
+
void StatusBar::showEvent(QShowEvent*)
{
visibilityChanged(true);
diff --git a/src/statusbar.h b/src/statusbar.h
index 708615a1..7ff8fcbb 100644
--- a/src/statusbar.h
+++ b/src/statusbar.h
@@ -7,6 +7,8 @@
struct APIStats;
class APIUserAccount;
class Settings;
+class OrganizerCore;
+
namespace Ui { class MainWindow; }
@@ -41,6 +43,7 @@ public:
void setAPI(const APIStats& stats, const APIUserAccount& user);
void setUpdateAvailable(bool b);
void checkSettings(const Settings& settings);
+ void updateNormalMessage(OrganizerCore& core);
protected:
void showEvent(QShowEvent* e);
@@ -48,6 +51,7 @@ protected:
private:
Ui::MainWindow* ui;
+ QLabel* m_normal;
QProgressBar* m_progress;
QWidget* m_progressSpacer1;
QWidget* m_progressSpacer2;