Browse Source

Open own group files from the conversation header

master
evgeny 2 days ago
parent
commit
8f908c320a
  1. 2
      tools/chatgui/src/mainwindow.cpp
  2. 13
      tools/chatgui/src/messagelist.cpp
  3. 2
      tools/chatgui/src/messagelist.h

2
tools/chatgui/src/mainwindow.cpp

@ -610,7 +610,7 @@ void MainWindow::setupConnects() {
m_messageList, &MessageList::reloadLocalNicks); m_messageList, &MessageList::reloadLocalNicks);
connect(m_accountList, &AccountList::filesRequested, this, &MainWindow::showMemberFiles); connect(m_accountList, &AccountList::filesRequested, this, &MainWindow::showMemberFiles);
connect(m_channelList, &ChannelList::filesRequested, this, [this](const QString& channel) { showMemberFiles(channel); }); connect(m_channelList, &ChannelList::filesRequested, this, [this](const QString& channel) { showMemberFiles(channel); });
connect(m_channelList, &ChannelList::ownFilesRequested, this, [this](const QString& channel) { connect(m_messageList, &MessageList::ownFilesRequested, this, [this](const QString& channel) {
quint64 owner = m_db ? m_db->myNodeId() : 0; quint64 owner = m_db ? m_db->myNodeId() : 0;
if (!channel.toULongLong() || !owner) { if (!channel.toULongLong() || !owner) {
DEBUG_WARN(DEBUG_CATEGORY_MEDIA, "file browser: own files unavailable channel=%s owner=%llu", DEBUG_WARN(DEBUG_CATEGORY_MEDIA, "file browser: own files unavailable channel=%s owner=%llu",

13
tools/chatgui/src/messagelist.cpp

@ -386,6 +386,18 @@ MessageList::MessageList(DbManager* db, AudioRecorder* recorder, QWidget *parent
m_talkingLabel->hide(); m_talkingLabel->hide();
hl->addWidget(m_talkingLabel); hl->addWidget(m_talkingLabel);
m_ownFilesButton = new QPushButton(header);
m_ownFilesButton->setObjectName("ownFilesButton");
m_ownFilesButton->setIcon(style()->standardIcon(QStyle::SP_DirOpenIcon));
m_ownFilesButton->setIconSize(QSize(24, 24));
m_ownFilesButton->setFixedSize(34, 30);
m_ownFilesButton->setCursor(Qt::PointingHandCursor);
m_ownFilesButton->setToolTip(QCoreApplication::translate("ChatGui", "My files in the selected group"));
m_ownFilesButton->setAccessibleName(m_ownFilesButton->toolTip());
m_ownFilesButton->hide();
hl->addWidget(m_ownFilesButton);
connect(m_ownFilesButton, &QPushButton::clicked, this, [this] { emit ownFilesRequested(m_currentChannelId); });
m_inviteBtn = new QPushButton(QStringLiteral("+"), header); m_inviteBtn = new QPushButton(QStringLiteral("+"), header);
m_inviteBtn->setAccessibleName(QCoreApplication::translate("ChatGui", "Invite to group")); m_inviteBtn->setAccessibleName(QCoreApplication::translate("ChatGui", "Invite to group"));
m_inviteBtn->setToolTip(QCoreApplication::translate("ChatGui", "Invite to group")); m_inviteBtn->setToolTip(QCoreApplication::translate("ChatGui", "Invite to group"));
@ -703,6 +715,7 @@ void MessageList::loadChannel(const QString& channelId) {
m_avatarCache.clear(); m_avatarCache.clear();
if (m_currentChannelId != channelId) { m_feedback.clear(); m_pendingPoll.clear(); } if (m_currentChannelId != channelId) { m_feedback.clear(); m_pendingPoll.clear(); }
m_currentChannelId = channelId; m_currentChannelId = channelId;
m_ownFilesButton->setVisible(channelId.toULongLong() != 0);
m_pollBtn->setVisible(!isDmChannel(channelId)); m_pollBtn->setVisible(!isDmChannel(channelId));
clearDmCallRoute(); clearDmCallRoute();
m_callBtn->setVisible(isDmChannel(channelId)); m_callBtn->setVisible(isDmChannel(channelId));

2
tools/chatgui/src/messagelist.h

@ -53,6 +53,7 @@ signals:
void openVideoRequested(const QString& filePath); void openVideoRequested(const QString& filePath);
void openImageRequested(const QString& filePath); void openImageRequested(const QString& filePath);
void inviteRequested(const QString& sourceChannel, quint64 peer, const QString& name); void inviteRequested(const QString& sourceChannel, quint64 peer, const QString& name);
void ownFilesRequested(const QString& channelId);
void linkActivated(const QString& link); void linkActivated(const QString& link);
private: private:
@ -74,6 +75,7 @@ private:
QLabel* m_talkingLabel = nullptr; /* шапка: кто говорит в рации */ QLabel* m_talkingLabel = nullptr; /* шапка: кто говорит в рации */
QPushButton* m_callBtn = nullptr; QPushButton* m_callBtn = nullptr;
QPushButton* m_inviteBtn = nullptr; QPushButton* m_inviteBtn = nullptr;
QPushButton* m_ownFilesButton = nullptr;
quint64 m_callPeer = 0; quint64 m_callPeer = 0;
quint64 m_callGroup = 0; quint64 m_callGroup = 0;
QPushButton* m_radioBtn = nullptr; /* шапка: переключатель рации */ QPushButton* m_radioBtn = nullptr; /* шапка: переключатель рации */

Loading…
Cancel
Save