You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wowlet/src/dialog/torinfodialog.cpp

38 lines
915 B

// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2020-2021, The Monero Project.
#include "torinfodialog.h"
#include "ui_torinfodialog.h"
#include <QDesktopServices>
TorInfoDialog::TorInfoDialog(AppContext *ctx, QWidget *parent)
: QDialog(parent)
, ui(new Ui::TorInfoDialog)
, m_ctx(ctx)
{
ui->setupUi(this);
if (!m_ctx->tor->torConnected && !m_ctx->tor->errorMsg.isEmpty()) {
ui->message->setText(m_ctx->tor->errorMsg);
} else {
ui->message->setText(QString("Currently using Tor instance: %1:%2").arg(Tor::torHost).arg(Tor::torPort));
}
if (m_ctx->tor->localTor) {
ui->logs->setHidden(true);
} else {
ui->logs->setPlainText(m_ctx->tor->torLogs);
}
this->adjustSize();
}
void TorInfoDialog::onLogsUpdated() {
ui->logs->setPlainText(m_ctx->tor->torLogs);
}
TorInfoDialog::~TorInfoDialog() {
delete ui;
}