aboutsummaryrefslogtreecommitdiff
path: root/src/qt/peerdialog.h
blob: 45d3215c4cbbdb51cea33f41aa4db1cfbce20327 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// 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