From 7cbca6ab20f34bbb9522f002f2f1cfa4eca1da18 Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Tue, 28 Sep 2021 23:20:34 +0100 Subject: NOISSUE Use common duration format for global and instances --- launcher/MainWindow.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'launcher/MainWindow.cpp') diff --git a/launcher/MainWindow.cpp b/launcher/MainWindow.cpp index c3cc6b8d..d394238a 100644 --- a/launcher/MainWindow.cpp +++ b/launcher/MainWindow.cpp @@ -88,6 +88,7 @@ #include "UpdateController.h" #include "KonamiCode.h" #include +#include "MMCTime.h" namespace { QString profileInUseFilter(const QString & profile, bool used) @@ -1926,15 +1927,8 @@ void MainWindow::checkInstancePathForProblems() void MainWindow::updateStatusCenter() { - int timeplayed = LAUNCHER->instances()->getTotalPlayTime(); - int minutesTotal = timeplayed / 60; - int seconds = timeplayed % 60; - int minutes = minutesTotal % 60; - int hours = minutesTotal / 60; - if(hours != 0) - m_statusCenter->setText(tr("Total playtime: %1h %2m %3s").arg(hours).arg(minutes).arg(seconds)); - else if(minutes != 0) - m_statusCenter->setText(tr("Total playtime: %1m %2s").arg(minutes).arg(seconds)); - else if(seconds != 0) - m_statusCenter->setText(tr("Total playtime: %1s").arg(seconds)); + int timePlayed = LAUNCHER->instances()->getTotalPlayTime(); + if (timePlayed > 0) { + m_statusCenter->setText(tr("Total playtime: %1").arg(Time::prettifyDuration(timePlayed))); + } } -- cgit From 5bc6dd8f970249c8279d6302f8df56910c599514 Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Fri, 1 Oct 2021 23:20:25 +0100 Subject: NOISSUE Remove lingering full stop in playtime status --- launcher/MainWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'launcher/MainWindow.cpp') diff --git a/launcher/MainWindow.cpp b/launcher/MainWindow.cpp index d394238a..33d9c7f4 100644 --- a/launcher/MainWindow.cpp +++ b/launcher/MainWindow.cpp @@ -748,7 +748,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new MainWindow connect(LAUNCHER, &Launcher::globalSettingsClosed, this, &MainWindow::globalSettingsClosed); m_statusLeft = new QLabel(tr("No instance selected"), this); - m_statusCenter = new QLabel(tr("Total playtime: 0s."), this); + m_statusCenter = new QLabel(tr("Total playtime: 0s"), this); statusBar()->addPermanentWidget(m_statusLeft, 1); statusBar()->addPermanentWidget(m_statusCenter, 0); -- cgit