mirror of
https://github.com/feather-wallet/feather.git
synced 2025-02-02 03:06:34 +00:00
TorInfoDialog: validate port
This commit is contained in:
parent
801041aeaa
commit
2d07483577
1 changed files with 4 additions and 0 deletions
|
@ -8,6 +8,7 @@
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
#include <QRegularExpressionValidator>
|
||||||
|
|
||||||
#include "utils/ColorScheme.h"
|
#include "utils/ColorScheme.h"
|
||||||
#include "utils/Icons.h"
|
#include "utils/Icons.h"
|
||||||
|
@ -37,6 +38,9 @@ TorInfoDialog::TorInfoDialog(QSharedPointer<AppContext> ctx, QWidget *parent)
|
||||||
initPrivacyLevel();
|
initPrivacyLevel();
|
||||||
onConnectionStatusChanged(torManager()->torConnected);
|
onConnectionStatusChanged(torManager()->torConnected);
|
||||||
|
|
||||||
|
auto *portValidator = new QRegularExpressionValidator{QRegularExpression("[0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]")};
|
||||||
|
ui->line_port->setValidator(portValidator);
|
||||||
|
|
||||||
connect(torManager(), &TorManager::connectionStateChanged, this, &TorInfoDialog::onConnectionStatusChanged);
|
connect(torManager(), &TorManager::connectionStateChanged, this, &TorInfoDialog::onConnectionStatusChanged);
|
||||||
connect(torManager(), &TorManager::logsUpdated, this, &TorInfoDialog::onLogsUpdated);
|
connect(torManager(), &TorManager::logsUpdated, this, &TorInfoDialog::onLogsUpdated);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue