dogecoin/src/qt/peerdialog.h
Shafil Alam e0d1683bff Add a form dialog for adding peers
Fixed tabIndex and width in debugwindow.ui

Added Qt UI files for each dialog

Added Qt UI files

Added separate thread for peer dialogs to run RPC commands

Fixed tabIndex

Remove unneeded includes

Fixed error

Replaced RPCExecutor with g_connman

Replaced RPCExecutor with g_connman

Added two input fields for peer address and port

Remove peerThread

Validate IP addresses

Remove Peer now uses selected IP address in peerWidget

Interpret RPC response

Remove redundant include

Use a regular expression to validate IPs

Disconnect node if it has been discovered

Use port based on current chain

Change peerAddress -> peerPort

Allowed DNS names to be entered

Update src/qt/peerdialog.cpp

Co-authored-by: Ross Nicoll <rnicoll@rnicoll.name>

Fix typo

Co-authored-by: Ross Nicoll <rnicoll@rnicoll.name>

Use LookupHost to check address

Co-authored-by: Ross Nicoll <rnicoll@rnicoll.name>

Fix syntax typo
2021-06-05 15:23:01 -04:00

63 lines
1.2 KiB
C++

// Copyright (c) 2011-2016 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_QT_PEERDIALOG_H
#define BITCOIN_QT_PEERDIALOG_H
#include <QObject>
#include <QWidget>
#include <string>
#include "guiutil.h"
class PeerTools;
namespace Ui {
class AddPeerDialog;
class RemovePeerDialog;
class TestPeerDialog;
}
/** Class to manage peers */
class PeerTools : public QObject
{
Q_OBJECT
public:
static QString ManagePeer(QString type, QString peer);
static bool CheckPeerAddress(QString address);
static bool CheckIPAddress(QString ip);
static bool CheckDNS(QString dns);
static QString GetPort();
};
/** "Add peer" dialog box */
class AddPeerDialog : public QWidget
{
Q_OBJECT
public:
explicit AddPeerDialog(QWidget *parent);
~AddPeerDialog();
private:
Ui::AddPeerDialog *ui;
private Q_SLOTS:
void on_addPeer_clicked();
};
/** "Test peer" dialog box */
class TestPeerDialog : public QWidget
{
Q_OBJECT
public:
explicit TestPeerDialog(QWidget *parent);
~TestPeerDialog();
private:
Ui::TestPeerDialog *ui;
private Q_SLOTS:
void on_testPeer_clicked();
};
#endif