Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ private slots:
void on_actionIgnore_C4_Reallocation_Event_Count_toggled(bool enabled);
void on_actionHEX_toggled(bool enabled);
void on_actionUse_Fahrenheit_toggled(bool enabled);
void on_actionUse_Human_Readable_Time_toggled(bool enabled);
void on_actionCyclic_Navigation_toggled(bool arg1);
void on_actionUse_GB_instead_of_TB_toggled(bool arg1);

Expand Down
20 changes: 18 additions & 2 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ MainWindow::MainWindow(QWidget *parent)
ui->actionIgnore_C4_Reallocation_Event_Count->setChecked(settings.value("IgnoreC4", true).toBool());
ui->actionHEX->setChecked(settings.value("HEX", true).toBool());
ui->actionUse_Fahrenheit->setChecked(settings.value("Fahrenheit", false).toBool());
ui->actionUse_Fahrenheit->setChecked(settings.value("HumanReadableTime", false).toBool());
ui->actionCyclic_Navigation->setChecked(settings.value("CyclicNavigation", false).toBool());
ui->actionUse_GB_instead_of_TB->setChecked(settings.value("UseGB", false).toBool());

Expand Down Expand Up @@ -448,6 +449,7 @@ void MainWindow::populateWindow(const QJsonObject &localObj, const QString &heal
int64_t totalMbWritesI64 = 0;
int64_t totalMbReadsI64 = 0;
bool useGB = ui->actionUse_GB_instead_of_TB->isChecked();
bool useHumanReadableTime = ui->actionUse_Human_Readable_Time->isChecked();

QString diskCapacityString = getMbToPrettyString(diskCapacityMbI64, PRECISION_CAPACITY_TO_STR, useGB);

Expand Down Expand Up @@ -493,7 +495,7 @@ void MainWindow::populateWindow(const QJsonObject &localObj, const QString &heal
selfTestsTableWidget->setRowCount(static_cast<int>(rowCount));
selfTestsTableWidget->setColumnCount(3);
selfTestsTableWidget->verticalHeader()->setVisible(false);
selfTestsTableWidget->setHorizontalHeaderLabels({tr("Type"), tr("Status"), tr("Power On Hours")});
selfTestsTableWidget->setHorizontalHeaderLabels({tr("Type"), tr("Status"), tr("Power On Time")});

for (int i = 0; i < rowCount; ++i) {
QJsonObject entry = selfTestsTable[i].toObject();
Expand Down Expand Up @@ -583,7 +585,11 @@ void MainWindow::populateWindow(const QJsonObject &localObj, const QString &heal
int powerOnTimeInt = localObj["power_on_time"].toObject().value("hours").toInt(-1);
QString powerOnTime;
if (powerOnTimeInt >= 0) {
powerOnTime = QString::number(powerOnTimeInt) + " " + tr("hours");
if (useHumanReadableTime) {
powerOnTime = QString::number(powerOnTimeInt / 24 / 365) + " " + tr("years") + " " + QString::number(powerOnTimeInt / 24 % 365) + " " + tr("days") + " " + QString::number(powerOnTimeInt % 24) + " " + tr("hours");
} else {
powerOnTime = QString::number(powerOnTimeInt) + " " + tr("hours");
}
} else {
powerOnTime = "Unknown";
}
Expand Down Expand Up @@ -1391,6 +1397,14 @@ void MainWindow::on_actionUse_Fahrenheit_toggled(bool enabled)
}
}

void MainWindow::on_actionUse_Human_Readable_Time_toggled(bool enabled)
{
settings.setValue("HumanReadableTime", enabled);
if (!initializing) {
updateUI(Utils.clearButtonGroup(buttonGroup, horizontalLayout, buttonStretch, menuDisk));
}
}

void MainWindow::on_actionCyclic_Navigation_toggled(bool cyclicNavigation)
{
settings.setValue("CyclicNavigation", cyclicNavigation);
Expand Down Expand Up @@ -1423,12 +1437,14 @@ void MainWindow::on_actionClear_Settings_triggered()
settings.setValue("IgnoreC4", true);
settings.setValue("HEX", true);
settings.setValue("Fahrenheit", false);
settings.setValue("HumanReadableTime", false);
settings.setValue("CyclicNavigation", false);
settings.setValue("UseGB", false);

ui->actionIgnore_C4_Reallocation_Event_Count->setChecked(true);
ui->actionHEX->setChecked(true);
ui->actionUse_Fahrenheit->setChecked(false);
ui->actionUse_Human_Readable_Time->setChecked(false);
ui->actionCyclic_Navigation->setChecked(false);
ui->actionUse_GB_instead_of_TB->setChecked(false);

Expand Down
11 changes: 10 additions & 1 deletion src/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@
<item row="4" column="0">
<widget class="QLabel" name="powerOnHoursLabel">
<property name="text">
<string>Power On Hours</string>
<string>Power On Time</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -508,6 +508,7 @@
<addaction name="actionIgnore_C4_Reallocation_Event_Count"/>
<addaction name="actionHEX"/>
<addaction name="actionUse_Fahrenheit"/>
<addaction name="actionUse_Human_Readable_Time"/>
<addaction name="actionCyclic_Navigation"/>
<addaction name="actionUse_GB_instead_of_TB"/>
<addaction name="separator"/>
Expand Down Expand Up @@ -618,6 +619,14 @@
<string>&amp;Use Fahrenheit</string>
</property>
</action>
<action name="actionUse_Human_Readable_Time">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>&amp;Use Human Readable Time</string>
</property>
</action>
<action name="actionSelf_Test">
<property name="text">
<string>Self Test</string>
Expand Down
16 changes: 14 additions & 2 deletions translations/qdiskinfo_af_ZA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
<translation>Power On Count</translation>
</message>
<message>
<source>Power On Hours</source>
<translation>Power On Hours</translation>
<source>Power On Time</source>
<translation>Power On Time</translation>
</message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:14pt; font-weight:700;&quot;&gt;Hard Drive Name&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
Expand Down Expand Up @@ -130,6 +130,10 @@
<source>&amp;Use Fahrenheit</source>
<translation>&amp;Use Fahrenheit</translation>
</message>
<message>
<source>&amp;Use Human Readable Time</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Self Test</source>
<translation>Self Test</translation>
Expand Down Expand Up @@ -190,6 +194,14 @@
<source>hours</source>
<translation>hours</translation>
</message>
<message>
<source>years</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>days</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Short</source>
<translation>Short</translation>
Expand Down
16 changes: 14 additions & 2 deletions translations/qdiskinfo_ar_SA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
<translation>Power On Count</translation>
</message>
<message>
<source>Power On Hours</source>
<translation>Power On Hours</translation>
<source>Power On Time</source>
<translation>Power On Time</translation>
</message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:14pt; font-weight:700;&quot;&gt;Hard Drive Name&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
Expand Down Expand Up @@ -130,6 +130,10 @@
<source>&amp;Use Fahrenheit</source>
<translation>&amp;Use Fahrenheit</translation>
</message>
<message>
<source>&amp;Use Human Readable Time</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Self Test</source>
<translation>Self Test</translation>
Expand Down Expand Up @@ -190,6 +194,14 @@
<source>hours</source>
<translation>hours</translation>
</message>
<message>
<source>years</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>days</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Short</source>
<translation>Short</translation>
Expand Down
16 changes: 14 additions & 2 deletions translations/qdiskinfo_ca_ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
<translation>Power On Count</translation>
</message>
<message>
<source>Power On Hours</source>
<translation>Power On Hours</translation>
<source>Power On Time</source>
<translation>Power On Time</translation>
</message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:14pt; font-weight:700;&quot;&gt;Hard Drive Name&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
Expand Down Expand Up @@ -130,6 +130,10 @@
<source>&amp;Use Fahrenheit</source>
<translation>&amp;Use Fahrenheit</translation>
</message>
<message>
<source>&amp;Use Human Readable Time</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Self Test</source>
<translation>Self Test</translation>
Expand Down Expand Up @@ -190,6 +194,14 @@
<source>hours</source>
<translation>hours</translation>
</message>
<message>
<source>years</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>days</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Short</source>
<translation>Short</translation>
Expand Down
16 changes: 14 additions & 2 deletions translations/qdiskinfo_cs_CZ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
<translation>Power On Count</translation>
</message>
<message>
<source>Power On Hours</source>
<translation>Power On Hours</translation>
<source>Power On Time</source>
<translation>Power On Time</translation>
</message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:14pt; font-weight:700;&quot;&gt;Hard Drive Name&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
Expand Down Expand Up @@ -130,6 +130,10 @@
<source>&amp;Use Fahrenheit</source>
<translation>&amp;Use Fahrenheit</translation>
</message>
<message>
<source>&amp;Use Human Readable Time</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Self Test</source>
<translation>Self Test</translation>
Expand Down Expand Up @@ -190,6 +194,14 @@
<source>hours</source>
<translation>hours</translation>
</message>
<message>
<source>years</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>days</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Short</source>
<translation>Short</translation>
Expand Down
16 changes: 14 additions & 2 deletions translations/qdiskinfo_da_DK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
<translation>Power On Count</translation>
</message>
<message>
<source>Power On Hours</source>
<translation>Power On Hours</translation>
<source>Power On Time</source>
<translation>Power On Time</translation>
</message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:14pt; font-weight:700;&quot;&gt;Hard Drive Name&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
Expand Down Expand Up @@ -130,6 +130,10 @@
<source>&amp;Use Fahrenheit</source>
<translation>&amp;Use Fahrenheit</translation>
</message>
<message>
<source>&amp;Use Human Readable Time</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Self Test</source>
<translation>Self Test</translation>
Expand Down Expand Up @@ -190,6 +194,14 @@
<source>hours</source>
<translation>hours</translation>
</message>
<message>
<source>years</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>days</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Short</source>
<translation>Short</translation>
Expand Down
16 changes: 14 additions & 2 deletions translations/qdiskinfo_de_DE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
<translation>Anzahl der Einschaltungen</translation>
</message>
<message>
<source>Power On Hours</source>
<translation>Betriebsstunden</translation>
<source>Power On Time</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:14pt; font-weight:700;&quot;&gt;Hard Drive Name&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
Expand Down Expand Up @@ -130,6 +130,10 @@
<source>&amp;Use Fahrenheit</source>
<translation>&amp;Fahrenheit benutzen</translation>
</message>
<message>
<source>&amp;Use Human Readable Time</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Self Test</source>
<translation>Selbsttest</translation>
Expand Down Expand Up @@ -190,6 +194,14 @@
<source>hours</source>
<translation>Stunden</translation>
</message>
<message>
<source>years</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>days</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Short</source>
<translation>Kurz</translation>
Expand Down
16 changes: 14 additions & 2 deletions translations/qdiskinfo_el_GR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
<translation>Μετρητής Λειτουργίας</translation>
</message>
<message>
<source>Power On Hours</source>
<translation>Ώρες Λειτουργίας</translation>
<source>Power On Time</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:14pt; font-weight:700;&quot;&gt;Hard Drive Name&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
Expand Down Expand Up @@ -130,6 +130,10 @@
<source>&amp;Use Fahrenheit</source>
<translation>Χρήση &amp;Fahrenheit</translation>
</message>
<message>
<source>&amp;Use Human Readable Time</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Self Test</source>
<translation>Αυτοδιάγνωση</translation>
Expand Down Expand Up @@ -190,6 +194,14 @@
<source>hours</source>
<translation>ώρες</translation>
</message>
<message>
<source>years</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>days</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Short</source>
<translation>Σύντομο</translation>
Expand Down
Loading