Browse Source

Forward member invitation actions to main window

master
evgeny 1 week ago
parent
commit
44e75e661e
  1. 8
      tools/chatgui/src/accountlist.cpp
  2. 1
      tools/chatgui/src/accountlist.h

8
tools/chatgui/src/accountlist.cpp

@ -81,7 +81,13 @@ AccountList::AccountList(DbManager* db, QWidget *parent)
layout->addWidget(m_header);
m_listView->setModel(m_model);
m_listView->setItemDelegate(new AccountDelegate(m_listView));
auto* delegate = new AccountDelegate(m_listView);
m_listView->setItemDelegate(delegate);
connect(delegate, &AccountDelegate::inviteRequested, this, [this](const QModelIndex& index) {
const quint64 peer = m_model->nodeIdAt(index.row());
if (peer && m_db && peer != m_db->myNodeId())
emit inviteRequested(m_channelId, peer, index.data(Qt::DisplayRole).toString());
});
m_listView->setEditTriggers(QAbstractItemView::NoEditTriggers);
m_listView->setSelectionMode(QAbstractItemView::SingleSelection);
m_listView->setMouseTracking(true);

1
tools/chatgui/src/accountlist.h

@ -71,6 +71,7 @@ signals:
void memberRenamed();
void callRequested(const QString& channelId, quint64 nodeId, const QString& name);
void pmRequested(const QString& channelId, quint64 nodeId, const QString& name);
void inviteRequested(const QString& channelId, quint64 nodeId, const QString& name);
private slots:
void onMemberClicked(const QModelIndex& index);

Loading…
Cancel
Save