Manager: Refactor the machine process stats system
and the statusbar text generation
This commit is contained in:
@@ -1086,16 +1086,25 @@ msgstr ""
|
||||
msgid "Paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "Paused (Waiting)"
|
||||
msgid "Waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "Powered Off"
|
||||
msgstr ""
|
||||
|
||||
msgid "waiting"
|
||||
msgid "%n running"
|
||||
msgstr ""
|
||||
|
||||
msgid "total"
|
||||
msgid "%n paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "%n waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "%1 total"
|
||||
msgstr ""
|
||||
|
||||
msgid "VMs: %1"
|
||||
msgstr ""
|
||||
|
||||
msgid "System Directory:"
|
||||
|
||||
@@ -1086,16 +1086,25 @@ msgstr ""
|
||||
msgid "Paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "Paused (Waiting)"
|
||||
msgid "Waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "Powered Off"
|
||||
msgstr ""
|
||||
|
||||
msgid "waiting"
|
||||
msgid "%n running"
|
||||
msgstr ""
|
||||
|
||||
msgid "total"
|
||||
msgid "%n paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "%n waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "%1 total"
|
||||
msgstr ""
|
||||
|
||||
msgid "VMs: %1"
|
||||
msgstr ""
|
||||
|
||||
msgid "System Directory:"
|
||||
|
||||
@@ -1086,16 +1086,25 @@ msgstr ""
|
||||
msgid "Paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "Paused (Waiting)"
|
||||
msgid "Waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "Powered Off"
|
||||
msgstr ""
|
||||
|
||||
msgid "waiting"
|
||||
msgid "%n running"
|
||||
msgstr ""
|
||||
|
||||
msgid "total"
|
||||
msgid "%n paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "%n waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "%1 total"
|
||||
msgstr ""
|
||||
|
||||
msgid "VMs: %1"
|
||||
msgstr ""
|
||||
|
||||
msgid "System Directory:"
|
||||
|
||||
@@ -1086,16 +1086,25 @@ msgstr ""
|
||||
msgid "Paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "Paused (Waiting)"
|
||||
msgid "Waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "Powered Off"
|
||||
msgstr ""
|
||||
|
||||
msgid "waiting"
|
||||
msgid "%n running"
|
||||
msgstr ""
|
||||
|
||||
msgid "total"
|
||||
msgid "%n paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "%n waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "%1 total"
|
||||
msgstr ""
|
||||
|
||||
msgid "VMs: %1"
|
||||
msgstr ""
|
||||
|
||||
msgid "System Directory:"
|
||||
|
||||
@@ -1086,16 +1086,25 @@ msgstr ""
|
||||
msgid "Paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "Paused (Waiting)"
|
||||
msgid "Waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "Powered Off"
|
||||
msgstr ""
|
||||
|
||||
msgid "waiting"
|
||||
msgid "%n running"
|
||||
msgstr ""
|
||||
|
||||
msgid "total"
|
||||
msgid "%n paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "%n waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "%1 total"
|
||||
msgstr ""
|
||||
|
||||
msgid "VMs: %1"
|
||||
msgstr ""
|
||||
|
||||
msgid "System Directory:"
|
||||
|
||||
@@ -1086,16 +1086,25 @@ msgstr ""
|
||||
msgid "Paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "Paused (Waiting)"
|
||||
msgid "Waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "Powered Off"
|
||||
msgstr ""
|
||||
|
||||
msgid "waiting"
|
||||
msgid "%n running"
|
||||
msgstr ""
|
||||
|
||||
msgid "total"
|
||||
msgid "%n paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "%n waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "%1 total"
|
||||
msgstr ""
|
||||
|
||||
msgid "VMs: %1"
|
||||
msgstr ""
|
||||
|
||||
msgid "System Directory:"
|
||||
|
||||
@@ -1086,16 +1086,25 @@ msgstr ""
|
||||
msgid "Paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "Paused (Waiting)"
|
||||
msgid "Waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "Powered Off"
|
||||
msgstr ""
|
||||
|
||||
msgid "waiting"
|
||||
msgid "%n running"
|
||||
msgstr ""
|
||||
|
||||
msgid "total"
|
||||
msgid "%n paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "%n waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "%1 total"
|
||||
msgstr ""
|
||||
|
||||
msgid "VMs: %1"
|
||||
msgstr ""
|
||||
|
||||
msgid "System Directory:"
|
||||
|
||||
@@ -1086,16 +1086,25 @@ msgstr ""
|
||||
msgid "Paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "Paused (Waiting)"
|
||||
msgid "Waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "Powered Off"
|
||||
msgstr ""
|
||||
|
||||
msgid "waiting"
|
||||
msgid "%n running"
|
||||
msgstr ""
|
||||
|
||||
msgid "total"
|
||||
msgid "%n paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "%n waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "%1 total"
|
||||
msgstr ""
|
||||
|
||||
msgid "VMs: %1"
|
||||
msgstr ""
|
||||
|
||||
msgid "System Directory:"
|
||||
|
||||
@@ -1086,16 +1086,25 @@ msgstr ""
|
||||
msgid "Paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "Paused (Waiting)"
|
||||
msgid "Waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "Powered Off"
|
||||
msgstr ""
|
||||
|
||||
msgid "waiting"
|
||||
msgid "%n running"
|
||||
msgstr ""
|
||||
|
||||
msgid "total"
|
||||
msgid "%n paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "%n waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "%1 total"
|
||||
msgstr ""
|
||||
|
||||
msgid "VMs: %1"
|
||||
msgstr ""
|
||||
|
||||
msgid "System Directory:"
|
||||
|
||||
@@ -1086,17 +1086,26 @@ msgstr "In esecuzione"
|
||||
msgid "Paused"
|
||||
msgstr "In pausa"
|
||||
|
||||
msgid "Paused (Waiting)"
|
||||
msgstr "In pausa (In attesa)"
|
||||
msgid "Waiting"
|
||||
msgstr "In attesa"
|
||||
|
||||
msgid "Powered Off"
|
||||
msgstr "Spento"
|
||||
|
||||
msgid "waiting"
|
||||
msgstr "in attesa"
|
||||
msgid "%n running"
|
||||
msgstr "%n in esecuzione"
|
||||
|
||||
msgid "total"
|
||||
msgstr "totale"
|
||||
msgid "%n paused"
|
||||
msgstr "%n in pausa"
|
||||
|
||||
msgid "%n waiting"
|
||||
msgstr "%n In attesa"
|
||||
|
||||
msgid "%1 total"
|
||||
msgstr "%1 totale"
|
||||
|
||||
msgid "VMs: %1"
|
||||
msgstr ""
|
||||
|
||||
msgid "System Directory:"
|
||||
msgstr "Directory Sistema:"
|
||||
|
||||
@@ -1086,16 +1086,25 @@ msgstr ""
|
||||
msgid "Paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "Paused (Waiting)"
|
||||
msgid "Waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "Powered Off"
|
||||
msgstr ""
|
||||
|
||||
msgid "waiting"
|
||||
msgid "%n running"
|
||||
msgstr ""
|
||||
|
||||
msgid "total"
|
||||
msgid "%n paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "%n waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "%1 total"
|
||||
msgstr ""
|
||||
|
||||
msgid "VMs: %1"
|
||||
msgstr ""
|
||||
|
||||
msgid "System Directory:"
|
||||
|
||||
@@ -1086,16 +1086,25 @@ msgstr ""
|
||||
msgid "Paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "Paused (Waiting)"
|
||||
msgid "Waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "Powered Off"
|
||||
msgstr ""
|
||||
|
||||
msgid "waiting"
|
||||
msgid "%n running"
|
||||
msgstr ""
|
||||
|
||||
msgid "total"
|
||||
msgid "%n paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "%n waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "%1 total"
|
||||
msgstr ""
|
||||
|
||||
msgid "VMs: %1"
|
||||
msgstr ""
|
||||
|
||||
msgid "System Directory:"
|
||||
|
||||
@@ -1086,17 +1086,26 @@ msgstr "Actief"
|
||||
msgid "Paused"
|
||||
msgstr "Gepauzeerd"
|
||||
|
||||
msgid "Paused (Waiting)"
|
||||
msgstr "Gepauzeerd (aan het wachtend)"
|
||||
msgid "Waiting"
|
||||
msgstr "aan het wachtend"
|
||||
|
||||
msgid "Powered Off"
|
||||
msgstr "Sluit af"
|
||||
|
||||
msgid "waiting"
|
||||
msgstr "aan het wachten"
|
||||
msgid "%n running"
|
||||
msgstr "%n actief"
|
||||
|
||||
msgid "total"
|
||||
msgstr "totaal"
|
||||
msgid "%n paused"
|
||||
msgstr "%n gepauzeerd"
|
||||
|
||||
msgid "%n waiting"
|
||||
msgstr "%n aan het wachten"
|
||||
|
||||
msgid "%1 total"
|
||||
msgstr "%1 totaal"
|
||||
|
||||
msgid "VMs: %1"
|
||||
msgstr "VMs: %1"
|
||||
|
||||
msgid "System Directory:"
|
||||
msgstr "Systeemmap:"
|
||||
|
||||
@@ -1086,16 +1086,25 @@ msgstr ""
|
||||
msgid "Paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "Paused (Waiting)"
|
||||
msgid "Waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "Powered Off"
|
||||
msgstr ""
|
||||
|
||||
msgid "waiting"
|
||||
msgid "%n running"
|
||||
msgstr ""
|
||||
|
||||
msgid "total"
|
||||
msgid "%n paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "%n waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "%1 total"
|
||||
msgstr ""
|
||||
|
||||
msgid "VMs: %1"
|
||||
msgstr ""
|
||||
|
||||
msgid "System Directory:"
|
||||
|
||||
@@ -1087,16 +1087,25 @@ msgid "Paused"
|
||||
msgstr "Pausado"
|
||||
|
||||
msgid "Paused (Waiting)"
|
||||
msgstr "Pausado (Esperando)"
|
||||
msgstr "Esperando"
|
||||
|
||||
msgid "Powered Off"
|
||||
msgstr "Desligado"
|
||||
|
||||
msgid "waiting"
|
||||
msgstr "esperando"
|
||||
msgid "%n running"
|
||||
msgstr "%n rodando"
|
||||
|
||||
msgid "total"
|
||||
msgstr "total"
|
||||
msgid "%n paused"
|
||||
msgstr "%n pausado"
|
||||
|
||||
msgid "%n waiting"
|
||||
msgstr "%n esperando"
|
||||
|
||||
msgid "%1 total"
|
||||
msgstr "%1 total"
|
||||
|
||||
msgid "VMs: %1"
|
||||
msgstr ""
|
||||
|
||||
msgid "System Directory:"
|
||||
msgstr "Diretório do Sistema:"
|
||||
|
||||
@@ -1086,16 +1086,25 @@ msgstr ""
|
||||
msgid "Paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "Paused (Waiting)"
|
||||
msgid "Waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "Powered Off"
|
||||
msgstr ""
|
||||
|
||||
msgid "waiting"
|
||||
msgid "%n running"
|
||||
msgstr ""
|
||||
|
||||
msgid "total"
|
||||
msgid "%n paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "%n waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "%1 total"
|
||||
msgstr ""
|
||||
|
||||
msgid "VMs: %1"
|
||||
msgstr ""
|
||||
|
||||
msgid "System Directory:"
|
||||
|
||||
@@ -1084,19 +1084,28 @@ msgid "Running"
|
||||
msgstr "Работает"
|
||||
|
||||
msgid "Paused"
|
||||
msgstr "Приостановлено"
|
||||
msgstr "Приостановлена"
|
||||
|
||||
msgid "Paused (Waiting)"
|
||||
msgstr "Приостановлено (Ожидание)"
|
||||
|
||||
msgid "Powered Off"
|
||||
msgstr "Выключено"
|
||||
|
||||
msgid "waiting"
|
||||
msgid "Waiting"
|
||||
msgstr "Ожидание"
|
||||
|
||||
msgid "total"
|
||||
msgstr "Всего"
|
||||
msgid "Powered Off"
|
||||
msgstr "Выключена"
|
||||
|
||||
msgid "%n running"
|
||||
msgstr "%n работает"
|
||||
|
||||
msgid "%n paused"
|
||||
msgstr "%n приостановлено"
|
||||
|
||||
msgid "%n waiting"
|
||||
msgstr "%n ожидает"
|
||||
|
||||
msgid "%1 total"
|
||||
msgstr "всего %1"
|
||||
|
||||
msgid "VMs: %1"
|
||||
msgstr "Машин: %1"
|
||||
|
||||
msgid "System Directory:"
|
||||
msgstr "Системная папка:"
|
||||
|
||||
@@ -1086,16 +1086,25 @@ msgstr ""
|
||||
msgid "Paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "Paused (Waiting)"
|
||||
msgid "Waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "Powered Off"
|
||||
msgstr ""
|
||||
|
||||
msgid "waiting"
|
||||
msgid "%n running"
|
||||
msgstr ""
|
||||
|
||||
msgid "total"
|
||||
msgid "%n paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "%n waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "%1 total"
|
||||
msgstr ""
|
||||
|
||||
msgid "VMs: %1"
|
||||
msgstr ""
|
||||
|
||||
msgid "System Directory:"
|
||||
|
||||
@@ -1086,16 +1086,25 @@ msgstr ""
|
||||
msgid "Paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "Paused (Waiting)"
|
||||
msgid "Waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "Powered Off"
|
||||
msgstr ""
|
||||
|
||||
msgid "waiting"
|
||||
msgid "%n running"
|
||||
msgstr ""
|
||||
|
||||
msgid "total"
|
||||
msgid "%n paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "%n waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "%1 total"
|
||||
msgstr ""
|
||||
|
||||
msgid "VMs: %1"
|
||||
msgstr ""
|
||||
|
||||
msgid "System Directory:"
|
||||
|
||||
@@ -1086,16 +1086,25 @@ msgstr ""
|
||||
msgid "Paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "Paused (Waiting)"
|
||||
msgid "Waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "Powered Off"
|
||||
msgstr ""
|
||||
|
||||
msgid "waiting"
|
||||
msgid "%n running"
|
||||
msgstr ""
|
||||
|
||||
msgid "total"
|
||||
msgid "%n paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "%n waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "%1 total"
|
||||
msgstr ""
|
||||
|
||||
msgid "VMs: %1"
|
||||
msgstr ""
|
||||
|
||||
msgid "System Directory:"
|
||||
|
||||
@@ -1086,16 +1086,25 @@ msgstr ""
|
||||
msgid "Paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "Paused (Waiting)"
|
||||
msgid "Waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "Powered Off"
|
||||
msgstr ""
|
||||
|
||||
msgid "waiting"
|
||||
msgid "%n running"
|
||||
msgstr ""
|
||||
|
||||
msgid "total"
|
||||
msgid "%n paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "%n waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "%1 total"
|
||||
msgstr ""
|
||||
|
||||
msgid "VMs: %1"
|
||||
msgstr ""
|
||||
|
||||
msgid "System Directory:"
|
||||
|
||||
@@ -1086,16 +1086,25 @@ msgstr ""
|
||||
msgid "Paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "Paused (Waiting)"
|
||||
msgid "Waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "Powered Off"
|
||||
msgstr ""
|
||||
|
||||
msgid "waiting"
|
||||
msgid "%n running"
|
||||
msgstr ""
|
||||
|
||||
msgid "total"
|
||||
msgid "%n paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "%n waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "%1 total"
|
||||
msgstr ""
|
||||
|
||||
msgid "VMs: %1"
|
||||
msgstr ""
|
||||
|
||||
msgid "System Directory:"
|
||||
|
||||
@@ -1086,16 +1086,25 @@ msgstr ""
|
||||
msgid "Paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "Paused (Waiting)"
|
||||
msgid "Waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "Powered Off"
|
||||
msgstr ""
|
||||
|
||||
msgid "waiting"
|
||||
msgid "%n running"
|
||||
msgstr ""
|
||||
|
||||
msgid "total"
|
||||
msgid "%n paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "%n waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "%1 total"
|
||||
msgstr ""
|
||||
|
||||
msgid "VMs: %1"
|
||||
msgstr ""
|
||||
|
||||
msgid "System Directory:"
|
||||
|
||||
@@ -1086,17 +1086,26 @@ msgstr "正在运行"
|
||||
msgid "Paused"
|
||||
msgstr "已暂停"
|
||||
|
||||
msgid "Paused (Waiting)"
|
||||
msgstr "暂停 (等待中)"
|
||||
msgid "Waiting"
|
||||
msgstr "等待中"
|
||||
|
||||
msgid "Powered Off"
|
||||
msgstr "已关机"
|
||||
|
||||
msgid "waiting"
|
||||
msgstr "等待中"
|
||||
msgid "%n running"
|
||||
msgstr "%n 正在运行"
|
||||
|
||||
msgid "total"
|
||||
msgstr "总计"
|
||||
msgid "%n paused"
|
||||
msgstr "%n 已暂停"
|
||||
|
||||
msgid "%n waiting"
|
||||
msgstr "%n 等待中"
|
||||
|
||||
msgid "%1 total"
|
||||
msgstr "%1 总计"
|
||||
|
||||
msgid "VMs: %1"
|
||||
msgstr ""
|
||||
|
||||
msgid "System Directory:"
|
||||
msgstr "系统目录"
|
||||
|
||||
@@ -1086,16 +1086,25 @@ msgstr ""
|
||||
msgid "Paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "Paused (Waiting)"
|
||||
msgid "Waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "Powered Off"
|
||||
msgstr ""
|
||||
|
||||
msgid "waiting"
|
||||
msgid "%n running"
|
||||
msgstr ""
|
||||
|
||||
msgid "total"
|
||||
msgid "%n paused"
|
||||
msgstr ""
|
||||
|
||||
msgid "%n waiting"
|
||||
msgstr ""
|
||||
|
||||
msgid "%1 total"
|
||||
msgstr ""
|
||||
|
||||
msgid "VMs: %1"
|
||||
msgstr ""
|
||||
|
||||
msgid "System Directory:"
|
||||
|
||||
@@ -334,7 +334,7 @@ VMManagerDetails::updateProcessStatus() {
|
||||
QString status_text = running ?
|
||||
QString("%1: PID %2").arg(tr("Running"), QString::number(sysconfig->process->processId())) :
|
||||
tr("Not running");
|
||||
status_text.append(sysconfig->window_obscured ? QString(" (%1)").arg(tr("waiting")) : "");
|
||||
status_text.append(sysconfig->window_obscured ? QString(" (%1)").arg(tr("Waiting")) : "");
|
||||
ui->statusLabel->setText(status_text);
|
||||
resetButton->setEnabled(running);
|
||||
stopButton->setEnabled(running);
|
||||
|
||||
@@ -369,7 +369,7 @@ illegal_chars:
|
||||
|
||||
// Set initial status bar after the event loop starts
|
||||
QTimer::singleShot(0, this, [this] {
|
||||
emit updateStatusRight(totalCountString());
|
||||
emit updateStatusRight(machineCountString());
|
||||
});
|
||||
|
||||
#if EMU_BUILD_NUM != 0
|
||||
@@ -698,10 +698,14 @@ VMManagerMain::getSearchCompletionList() const
|
||||
}
|
||||
|
||||
QString
|
||||
VMManagerMain::totalCountString() const
|
||||
VMManagerMain::machineCountString(QString states) const
|
||||
{
|
||||
const auto count = vm_model->rowCount(QModelIndex());
|
||||
return QString("%1 %2").arg(QString::number(count), tr("total"));
|
||||
if (!states.isEmpty())
|
||||
states.append(", ");
|
||||
states.append(tr("%1 total").arg(count));
|
||||
|
||||
return tr("VMs: %1").arg(states);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -713,14 +717,26 @@ VMManagerMain::modelDataChange()
|
||||
QStringList stats;
|
||||
for (auto it = modelStats.constBegin(); it != modelStats.constEnd(); ++it) {
|
||||
const auto &key = it.key();
|
||||
stats.append(QString("%1 %2").arg(QString::number(modelStats[key]), key));
|
||||
QString text = "";
|
||||
switch (key) {
|
||||
case VMManagerSystem::ProcessStatus::Running:
|
||||
text = tr("%n running", "", modelStats[key]);
|
||||
break;
|
||||
case VMManagerSystem::ProcessStatus::Paused:
|
||||
text = tr("%n paused", "", modelStats[key]);
|
||||
break;
|
||||
case VMManagerSystem::ProcessStatus::PausedWaiting:
|
||||
case VMManagerSystem::ProcessStatus::RunningWaiting:
|
||||
text = tr("%n waiting", "", modelStats[key]);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if(!text.isEmpty())
|
||||
stats.append(text);
|
||||
}
|
||||
auto states = stats.join(", ");
|
||||
if (!modelStats.isEmpty()) {
|
||||
states.append(", ");
|
||||
}
|
||||
|
||||
emit updateStatusRight(states + totalCountString());
|
||||
emit updateStatusRight(machineCountString(states));
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -103,7 +103,7 @@ private:
|
||||
void updateDisplayName(const QModelIndex &index);
|
||||
void loadSettings();
|
||||
[[nodiscard]] bool currentSelectionIsValid() const;
|
||||
[[nodiscard]] QString totalCountString() const;
|
||||
[[nodiscard]] QString machineCountString(QString states = "") const;
|
||||
#if EMU_BUILD_NUM != 0
|
||||
void backgroundUpdateCheckStart() const;
|
||||
#endif
|
||||
|
||||
@@ -167,15 +167,12 @@ VMManagerModel::updateDisplayName(const QModelIndex &index, const QString &newDi
|
||||
machines.at(index.row())->setDisplayName(newDisplayName);
|
||||
modelDataChanged();
|
||||
}
|
||||
QHash<QString, int>
|
||||
QMap<VMManagerSystem::ProcessStatus, int>
|
||||
VMManagerModel::getProcessStats()
|
||||
{
|
||||
QHash<QString, int> stats;
|
||||
QMap<VMManagerSystem::ProcessStatus, int> stats;
|
||||
for (const auto& system: machines) {
|
||||
if (system->getProcessStatus() != VMManagerSystem::ProcessStatus::Stopped) {
|
||||
auto statusString = system->getProcessStatusString();
|
||||
stats[statusString] += 1;
|
||||
}
|
||||
stats[system->getProcessStatus()] += 1;
|
||||
}
|
||||
return stats;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
QModelIndex getIndexForConfigFile(const QFileInfo& config_file);
|
||||
void reload(QWidget* parent = nullptr);
|
||||
void updateDisplayName(const QModelIndex &index, const QString &newDisplayName);
|
||||
QHash <QString, int> getProcessStats();
|
||||
QMap<VMManagerSystem::ProcessStatus, int> getProcessStats();
|
||||
int getActiveMachineCount();
|
||||
void refreshConfigs();
|
||||
signals:
|
||||
|
||||
@@ -1175,7 +1175,7 @@ VMManagerSystem::processStatusToString(VMManagerSystem::ProcessStatus status)
|
||||
return tr("Paused");
|
||||
case VMManagerSystem::ProcessStatus::PausedWaiting:
|
||||
case VMManagerSystem::ProcessStatus::RunningWaiting:
|
||||
return tr("Paused (Waiting)");
|
||||
return QString("%1 (%2)").arg(tr("Paused"), tr("Waiting"));
|
||||
default:
|
||||
return tr("Unknown Status");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user