Merge pull request 'DebugInfoDialog: Add Tails version' (#69) from tobtoht/feather:tails_version into master

Reviewed-on: feather/feather#69
master
tobtoht 4 years ago
commit 06cee3f03e

@ -43,7 +43,11 @@ DebugInfoDialog::DebugInfoDialog(AppContext *ctx, QWidget *parent)
ui->label_seedType->setText(ctx->currentWallet->getCacheAttribute("feather.seed").isEmpty() ? "25 word" : "14 word");
ui->label_viewOnly->setText(ctx->currentWallet->viewOnly() ? "True" : "False");
ui->label_OS->setText(QSysInfo::prettyProductName());
QString os = QSysInfo::prettyProductName();
if (ctx->isTails) {
os = QString("Tails %1").arg(TailsOS::version());
}
ui->label_OS->setText(os);
ui->label_timestamp->setText(QString::number(QDateTime::currentSecsSinceEpoch()));
connect(ui->btn_Copy, &QPushButton::clicked, this, &DebugInfoDialog::copyToClipboad);

@ -38,6 +38,20 @@ bool TailsOS::detectDotPersistence()
return QDir(tailsPathData + "dotfiles").exists();
}
QString TailsOS::version()
{
if (!Utils::fileExists("/etc/os-release"))
return "";
QByteArray data = Utils::fileOpen("/etc/os-release");
QRegExp re(R"(TAILS_VERSION_ID="(\d+.\d+))");
int pos = re.indexIn(data);
if (pos >= 0) {
return re.cap(1);
}
return "";
}
void TailsOS::showDataPersistenceDisabledWarning()
{
QMessageBox msgBox;

@ -13,6 +13,7 @@ public:
static bool detect();
static bool detectDataPersistence();
static bool detectDotPersistence();
static QString version();
static void showDataPersistenceDisabledWarning();
static void askPersistence();

Loading…
Cancel
Save