- Замена контекстного меню 'Пригласить' на кнопку + (18x18) справа снизу каждого канала с hover-эффектом - InviteDialog: авто-копирование ссылки в буфер (Clipboard + Selection) при открытии - JoinDialog: параметр autoJoinLink — если в буфере валидная utun:// ссылка, диалог сразу стартует подключение
42 lines
985 B
C++
42 lines
985 B
C++
#pragma once
|
|
|
|
#include <QDialog>
|
|
#include <QLineEdit>
|
|
#include <QLabel>
|
|
#include <QPushButton>
|
|
#include <QTimer>
|
|
#include <cstdint>
|
|
|
|
class UtunNode;
|
|
class DbManager;
|
|
|
|
class JoinDialog : public QDialog {
|
|
Q_OBJECT
|
|
public:
|
|
explicit JoinDialog(UtunNode* node, DbManager* db, QWidget* parent = nullptr,
|
|
const QString& autoJoinLink = QString());
|
|
~JoinDialog() override;
|
|
|
|
signals:
|
|
void joined(const QString& channelId);
|
|
|
|
private slots:
|
|
void onConnectClicked();
|
|
void onLinkTextChanged();
|
|
|
|
private:
|
|
void setStatus(const QString& text, bool isError = false);
|
|
void onConnectResult(uint64_t nodeId, uint64_t channelId, int result);
|
|
|
|
UtunNode* m_node;
|
|
DbManager* m_db;
|
|
QLineEdit* m_linkEdit;
|
|
QLabel* m_statusLabel;
|
|
QPushButton* m_connectBtn;
|
|
QPushButton* m_cancelBtn;
|
|
QTimer* m_decodeTimer;
|
|
bool m_connecting = false;
|
|
uint64_t m_pendingNodeId = 0;
|
|
uint64_t m_pendingChannelId = 0;
|
|
};
|