Merge pull request #4172 from jamierocks/global-playtime
NOISSUE Add option to disable global play time status
This commit is contained in:
commit
cbe1b3353c
@ -644,6 +644,7 @@ Launcher::Launcher(int &argc, char **argv) : QApplication(argc, argv)
|
|||||||
|
|
||||||
// Game time
|
// Game time
|
||||||
m_settings->registerSetting("ShowGameTime", true);
|
m_settings->registerSetting("ShowGameTime", true);
|
||||||
|
m_settings->registerSetting("ShowGlobalGameTime", true);
|
||||||
m_settings->registerSetting("RecordGameTime", true);
|
m_settings->registerSetting("RecordGameTime", true);
|
||||||
|
|
||||||
// Minecraft launch method
|
// Minecraft launch method
|
||||||
|
@ -1610,6 +1610,7 @@ void MainWindow::globalSettingsClosed()
|
|||||||
proxymodel->invalidate();
|
proxymodel->invalidate();
|
||||||
proxymodel->sort(0);
|
proxymodel->sort(0);
|
||||||
updateToolsMenu();
|
updateToolsMenu();
|
||||||
|
updateStatusCenter();
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1927,6 +1928,8 @@ void MainWindow::checkInstancePathForProblems()
|
|||||||
|
|
||||||
void MainWindow::updateStatusCenter()
|
void MainWindow::updateStatusCenter()
|
||||||
{
|
{
|
||||||
|
m_statusCenter->setVisible(LAUNCHER->settings()->get("ShowGlobalGameTime").toBool());
|
||||||
|
|
||||||
int timePlayed = LAUNCHER->instances()->getTotalPlayTime();
|
int timePlayed = LAUNCHER->instances()->getTotalPlayTime();
|
||||||
if (timePlayed > 0) {
|
if (timePlayed > 0) {
|
||||||
m_statusCenter->setText(tr("Total playtime: %1").arg(Time::prettifyDuration(timePlayed)));
|
m_statusCenter->setText(tr("Total playtime: %1").arg(Time::prettifyDuration(timePlayed)));
|
||||||
|
@ -54,7 +54,6 @@ void MinecraftPage::on_maximizedCheckBox_clicked(bool checked)
|
|||||||
updateCheckboxStuff();
|
updateCheckboxStuff();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MinecraftPage::applySettings()
|
void MinecraftPage::applySettings()
|
||||||
{
|
{
|
||||||
auto s = LAUNCHER->settings();
|
auto s = LAUNCHER->settings();
|
||||||
@ -70,6 +69,7 @@ void MinecraftPage::applySettings()
|
|||||||
|
|
||||||
// Game time
|
// Game time
|
||||||
s->set("ShowGameTime", ui->showGameTime->isChecked());
|
s->set("ShowGameTime", ui->showGameTime->isChecked());
|
||||||
|
s->set("ShowGlobalGameTime", ui->showGlobalGameTime->isChecked());
|
||||||
s->set("RecordGameTime", ui->recordGameTime->isChecked());
|
s->set("RecordGameTime", ui->recordGameTime->isChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,5 +86,6 @@ void MinecraftPage::loadSettings()
|
|||||||
ui->useNativeGLFWCheck->setChecked(s->get("UseNativeGLFW").toBool());
|
ui->useNativeGLFWCheck->setChecked(s->get("UseNativeGLFW").toBool());
|
||||||
|
|
||||||
ui->showGameTime->setChecked(s->get("ShowGameTime").toBool());
|
ui->showGameTime->setChecked(s->get("ShowGameTime").toBool());
|
||||||
|
ui->showGlobalGameTime->setChecked(s->get("ShowGlobalGameTime").toBool());
|
||||||
ui->recordGameTime->setChecked(s->get("RecordGameTime").toBool());
|
ui->recordGameTime->setChecked(s->get("RecordGameTime").toBool());
|
||||||
}
|
}
|
||||||
|
@ -147,6 +147,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="showGlobalGameTime">
|
||||||
|
<property name="text">
|
||||||
|
<string>Show time spent playing across all instances</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="recordGameTime">
|
<widget class="QCheckBox" name="recordGameTime">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
Loading…
Reference in New Issue
Block a user