Keep publisher shortcut available in every desktop group

This commit is contained in:
evgeny committed 2026-10-20 19:55:11 +02:00
1 parent 5b6ed6ee78
commit c4da659dcb
3 files changed
+10 -4

No files matched your search

+4 -3
View File
@@ -538,11 +538,12 @@ MessageList::MessageList(DbManager* db, AudioRecorder* recorder, QWidget *parent
m_streamPublishBtn->setToolTip(QCoreApplication::translate("ChatGui", "Manage stream"));
m_streamPublishBtn->setAccessibleName(m_streamPublishBtn->toolTip());
connect(m_streamPublishBtn, &QPushButton::clicked, this, [this] {
if (!m_streamPublisherGroup || m_currentChannelId.toULongLong() != m_streamPublisherGroup) {
if (!m_streamPublisherGroup) {
DEBUG_WARN(DEBUG_CATEGORY_STREAM, "desktop own stream action stale channel=%s publisher_group=%llx",
qPrintable(m_currentChannelId), (unsigned long long)m_streamPublisherGroup); return;
}
DEBUG_INFO(DEBUG_CATEGORY_STREAM, "desktop own stream header clicked group=%llx", (unsigned long long)m_streamPublisherGroup);
DEBUG_INFO(DEBUG_CATEGORY_STREAM, "desktop own stream header clicked channel=%s publisher_group=%llx",
qPrintable(m_currentChannelId), (unsigned long long)m_streamPublisherGroup);
emit streamPublishRequested(m_streamPublisherGroup);
});
hl->addWidget(m_streamPublishBtn);
@@ -1594,7 +1595,7 @@ void MessageList::clearStreams() {
/* Кнопка следует за локальным publisher, а не за запаздывающим/недоступным сетевым каталогом. */
void MessageList::setStreamPublisherGroup(quint64 group) {
m_streamPublisherGroup = group;
const bool visible = group && group == m_currentChannelId.toULongLong();
const bool visible = group && m_currentChannelId.toULongLong() != 0;
if (visible == !m_streamPublishBtn->isHidden()) return;
m_streamPublishBtn->setVisible(visible);
DEBUG_INFO(DEBUG_CATEGORY_STREAM, "desktop own stream header channel=%s publisher_group=%llx visible=%d",
+1 -1
View File
@@ -53,7 +53,7 @@ public:
void onStreamSources(const uint8_t* data, int len);
void clearStreams();
void watchStreams();
/* Обновляет кнопку своей публикации в её канале; group=0 скрывает после завершения. GUI-поток. */
/* Показывает кнопку своей публикации во всех каналах; group=0 скрывает после завершения. GUI-поток. */
void setStreamPublisherGroup(quint64 group);
signals: