aboutsummaryrefslogtreecommitdiff
path: root/src/widgets/direct_connect_dialog.h
blob: b2ac9be3f2b934d222e27d9d9c807e0b5c508702 (plain)
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
#pragma once

#include <QComboBox>
#include <QDialog>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QRegularExpression>
#include <QSpinBox>
#include <QTimer>

class NetworkManager;

class DirectConnectDialog : public QDialog
{
  Q_OBJECT

public:
  DirectConnectDialog(NetworkManager *netManager, QWidget *parent = nullptr);

private:
  static const QString UI_FILE_PATH;
  static const QRegularExpression SCHEME_PATTERN;
  static const int CONNECT_TIMEOUT;

  NetworkManager *net_manager;
  QTimer m_connect_timeout;

  QWidget *ui_widget;

  QLineEdit *ui_direct_hostname_edit;

  QLabel *ui_direct_connection_status_lbl;
  QPushButton *ui_direct_connect_button;
  QPushButton *ui_direct_cancel_button;

private Q_SLOTS:
  void onConnectPressed();
  void onServerConnected();
  void onConnectTimeout();
};