Files
utun2/tools/chatgui/src/creategroupdialog.cpp
T
Evgeny e285a93b7f chatgui: create group, unified logging, fix uasync_post epoll bug
- Add CreateGroupDialog with group name input
- Generate X25519+Ed25519 keypairs, random uint64 channel_id,
  Ed25519 signature, write to DB via uasync thread
- chat_core_create_channel(): create msg table, topo_node_sqlite_channel_put()
- GUI_EVT_CHANNEL_UPDATED notification to reload channel list
- Per-category debug config: debug_level= + debug_categories= in [gui]
- Unified logging via debug_config: all threads write to same file/console
- debug_enable_console(1) to mirror file output to stderr
- DEBUG_LEVEL_DISABLED=-1: truly disable category, NONE=0 fallback to global
- Fix uasync_post under epoll: process_posted_tasks was never called
- Fix MainWindow constructor parameter ordering (dbPath vs debugFile)
- debug_ui.h: append mode ('a' instead of 'w')
2026-07-12 17:39:20 +03:00

52 lines
1.4 KiB
C++

#include "creategroupdialog.h"
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QPushButton>
CreateGroupDialog::CreateGroupDialog(QWidget* parent)
: QDialog(parent)
, m_nameEdit(new QLineEdit(this))
{
setWindowTitle("Создать группу");
setMinimumWidth(350);
setModal(true);
auto* layout = new QVBoxLayout(this);
auto* nameLabel = new QLabel("Название группы:", this);
layout->addWidget(nameLabel);
m_nameEdit->setPlaceholderText("Введите название...");
m_nameEdit->setMaxLength(128);
layout->addWidget(m_nameEdit);
layout->addSpacing(12);
auto* btnLayout = new QHBoxLayout();
btnLayout->addStretch();
auto* cancelBtn = new QPushButton("Отмена", this);
connect(cancelBtn, &QPushButton::clicked, this, &QDialog::reject);
btnLayout->addWidget(cancelBtn);
auto* createBtn = new QPushButton("Создать", this);
createBtn->setDefault(true);
connect(createBtn, &QPushButton::clicked, this, [this]() {
if (m_nameEdit->text().trimmed().isEmpty()) {
m_nameEdit->setFocus();
return;
}
accept();
});
btnLayout->addWidget(createBtn);
layout->addLayout(btnLayout);
m_nameEdit->setFocus();
}
QString CreateGroupDialog::groupName() const {
return m_nameEdit->text().trimmed();
}