mirror of
https://github.com/feather-wallet/feather.git
synced 2024-12-23 03:59:29 +00:00
Whonix: detect version
This commit is contained in:
parent
58c9c1a006
commit
71fb639c16
5 changed files with 13 additions and 1 deletions
|
@ -6,7 +6,6 @@
|
|||
|
||||
#include "appcontext.h"
|
||||
#include "globals.h"
|
||||
#include "utils/whonix.h"
|
||||
|
||||
// libwalletqt
|
||||
#include "libwalletqt/TransactionHistory.h"
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include <QTimer>
|
||||
|
||||
#include "utils/tails.h"
|
||||
#include "utils/whonix.h"
|
||||
#include "utils/prices.h"
|
||||
#include "utils/networking.h"
|
||||
#include "utils/tor.h"
|
||||
|
|
|
@ -64,6 +64,9 @@ void DebugInfoDialog::updateInfo() {
|
|||
if (m_ctx->isTails) {
|
||||
os = QString("Tails %1").arg(TailsOS::version());
|
||||
}
|
||||
if (m_ctx->isWhonix) {
|
||||
os = QString("Whonix %1").arg(WhonixOS::version());
|
||||
}
|
||||
ui->label_OS->setText(os);
|
||||
ui->label_timestamp->setText(QString::number(QDateTime::currentSecsSinceEpoch()));
|
||||
}
|
||||
|
|
|
@ -7,4 +7,11 @@
|
|||
|
||||
bool WhonixOS::detect() {
|
||||
return !QString::fromLocal8Bit(qgetenv("WHONIX")).isEmpty();
|
||||
}
|
||||
|
||||
QString WhonixOS::version() {
|
||||
if (!Utils::fileExists("/etc/whonix_version"))
|
||||
return "";
|
||||
|
||||
return Utils::barrayToString(Utils::fileOpen("/etc/whonix_version")).trimmed();
|
||||
}
|
|
@ -4,9 +4,11 @@
|
|||
#ifndef FEATHER_WHONIX_H
|
||||
#define FEATHER_WHONIX_H
|
||||
|
||||
#include <QString>
|
||||
|
||||
struct WhonixOS {
|
||||
static bool detect();
|
||||
static QString version();
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue