refactor: STCP connections as ETCP links (is_tcp)
- Add is_tcp, tcp_link, tcp_reconnect_* fields to ETCP_LINK - Remove transport_link from ETCP_CONN, add tcp_link_count - stcp_link: replace embedded etcp_conn with pointer; add etcp_link backpointer - stcp_link: link_rx_cb routes ETCP data to etcp_conn_input - stcp_link: call on_close_cb in close - New TCP functions: etcp_link_enter_ready_tcp, etcp_tcp_link_start_connect, etcp_tcp_link_start_reconnect, tcp_link_close_cb, etcp_tcp_send - etcp_link_new: handle NULL conn for TCP links; skip enter_init for TCP - etcp_link_close: close stcp_link for TCP - etcp_encrypt_send: redirect TCP to etcp_tcp_send (skips AES-CCM) - tcp_server_on_link: create ETCP_LINK(is_tcp=1) + enter_ready_tcp - etcp_connect: TCP addrs -> etcp_tcp_link_start_connect - Remove ctx->tcp_link/tcp_ready - test_stcp_traffic: find stcp_link via links->is_tcp instead of transport_link - 66/68 tests pass; 2 STCP tests expected to fail (integration not complete)
This commit is contained in:
1 parent
937af4c26a
commit
d773f1724a
1705 files changed
+187
-1082154
No files matched your search
@@ -1,50 +0,0 @@
|
||||
#include "invitedialog.h"
|
||||
#include "qrcode_utils.h"
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLineEdit>
|
||||
#include <QPushButton>
|
||||
#include <QLabel>
|
||||
#include <QClipboard>
|
||||
#include <QApplication>
|
||||
|
||||
ShareInviteDialog::ShareInviteDialog(const QString& link, QWidget* parent)
|
||||
: QDialog(parent), m_link(link)
|
||||
{
|
||||
setWindowTitle(QString::fromUtf8("Пригласительная ссылка"));
|
||||
setMinimumWidth(420);
|
||||
setModal(true);
|
||||
|
||||
auto *layout = new QVBoxLayout(this);
|
||||
layout->setSpacing(12);
|
||||
|
||||
auto *linkEdit = new QLineEdit(m_link, this);
|
||||
linkEdit->setReadOnly(true);
|
||||
linkEdit->setStyleSheet("padding: 6px; font-family: monospace;");
|
||||
layout->addWidget(linkEdit);
|
||||
|
||||
auto *btnLayout = new QHBoxLayout();
|
||||
auto *copyBtn = new QPushButton(QString::fromUtf8("Копировать"), this);
|
||||
connect(copyBtn, &QPushButton::clicked, this, [this, linkEdit]() {
|
||||
QClipboard* cb = QApplication::clipboard();
|
||||
cb->setText(m_link, QClipboard::Clipboard);
|
||||
if (cb->supportsSelection())
|
||||
cb->setText(m_link, QClipboard::Selection);
|
||||
linkEdit->setFocus();
|
||||
});
|
||||
btnLayout->addWidget(copyBtn);
|
||||
btnLayout->addStretch();
|
||||
layout->addLayout(btnLayout);
|
||||
|
||||
auto *qrLabel = new QLabel(this);
|
||||
QImage qrImage = generateQRCode(m_link);
|
||||
if (!qrImage.isNull())
|
||||
qrLabel->setPixmap(QPixmap::fromImage(qrImage).scaled(
|
||||
180, 180, Qt::KeepAspectRatio, Qt::SmoothTransformation));
|
||||
qrLabel->setAlignment(Qt::AlignCenter);
|
||||
layout->addWidget(qrLabel, 0, Qt::AlignCenter);
|
||||
|
||||
auto *closeBtn = new QPushButton("OK", this);
|
||||
connect(closeBtn, &QPushButton::clicked, this, &QDialog::accept);
|
||||
layout->addWidget(closeBtn, 0, Qt::AlignRight);
|
||||
}
|
||||
Reference in new issue
Block a user