mirror of
https://github.com/wownero/wowlet.git
synced 2026-10-17 15:21:30 +02:00
56 lines
1.9 KiB
C++
56 lines
1.9 KiB
C++
// SPDX-License-Identifier: BSD-3-Clause
|
|
// SPDX-FileCopyrightText: 2020-2022 The Monero Project
|
|
|
|
#include "PageNetworkTor.h"
|
|
#include "ui_PageNetworkTor.h"
|
|
#include "WalletWizard.h"
|
|
|
|
PageNetworkTor::PageNetworkTor(QWidget *parent)
|
|
: QWizardPage(parent)
|
|
, ui(new Ui::PageNetworkTor)
|
|
{
|
|
ui->setupUi(this);
|
|
|
|
QPixmap iconAllTorExceptNode(":/assets/images/securityLevelStandard.png");
|
|
QPixmap iconAllTorExceptInitSync(":/assets/images/securityLevelSafer.png");
|
|
QPixmap iconAllTor(":/assets/images/securityLevelSafest.png");
|
|
ui->icon_allTorExceptNode->setPixmap(iconAllTorExceptNode.scaledToHeight(16, Qt::SmoothTransformation));
|
|
ui->icon_allTorExceptInitSync->setPixmap(iconAllTorExceptInitSync.scaledToHeight(16, Qt::SmoothTransformation));
|
|
ui->icon_allTor->setPixmap(iconAllTor.scaledToHeight(16, Qt::SmoothTransformation));
|
|
|
|
connect(ui->radio_configureManually, &QRadioButton::toggled, [this](bool checked){
|
|
ui->frame_privacyLevel->setVisible(checked);
|
|
this->adjustSize();
|
|
this->updateGeometry();
|
|
});
|
|
|
|
ui->btnGroup_privacyLevel->setId(ui->radio_allTorExceptNode, Config::allTorExceptNode);
|
|
ui->btnGroup_privacyLevel->setId(ui->radio_allTorExceptInitSync, Config::allTorExceptInitSync);
|
|
ui->btnGroup_privacyLevel->setId(ui->radio_allTor, Config::allTor);
|
|
|
|
int privacyLevel = config()->get(Config::torPrivacyLevel).toInt();
|
|
auto button = ui->btnGroup_privacyLevel->button(privacyLevel);
|
|
if (button) {
|
|
button->setChecked(true);
|
|
}
|
|
}
|
|
|
|
void PageNetworkTor::initializePage() {
|
|
// Fuck you Qt. No squish.
|
|
QTimer::singleShot(1, [this]{
|
|
ui->frame_privacyLevel->setVisible(false);
|
|
});
|
|
}
|
|
|
|
int PageNetworkTor::nextId() const {
|
|
return WalletWizard::Page_NetworkWebsocket;
|
|
}
|
|
|
|
bool PageNetworkTor::validatePage() {
|
|
int id = ui->btnGroup_privacyLevel->checkedId();
|
|
config()->set(Config::torPrivacyLevel, id);
|
|
|
|
emit initialNetworkConfigured();
|
|
|
|
return true;
|
|
} |