You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.6 KiB
47 lines
1.6 KiB
/* Список каналов и PM с unread/online; загружает данные DbManager и принимает обновления bridge. |
|
* Выбор и действия пользователя передаёт наружу signals; виджет используется в GUI-потоке. */ |
|
#pragma once |
|
|
|
#include <QWidget> |
|
#include <QListView> |
|
#include <QStandardItemModel> |
|
#include <QString> |
|
#include <QHash> |
|
#include <QTimer> |
|
|
|
class DbManager; |
|
|
|
class ChannelList : public QWidget { |
|
Q_OBJECT |
|
public: |
|
explicit ChannelList(DbManager* db = nullptr, QWidget *parent = nullptr); |
|
|
|
void loadChannels(); |
|
void refreshDmPresence(); |
|
void onDmCallRoute(const uint8_t* data, int len); |
|
void clearDmPresence(); |
|
void selectChannel(const QString& channelId); |
|
void setChannelPeersOnline(const QString& channelId, int count); |
|
void setAutoConnectActive(bool active); |
|
void setChannelUnreadCount(const QString& channelId, int count); |
|
int getChannelUnreadCount(const QString& channelId) const; |
|
|
|
signals: |
|
void channelSelected(const QString& channelId); |
|
void inviteRequested(const QString& channelId); |
|
void inviteByLinkRequested(const QString& channelId); |
|
void channelSettingsRequested(const QString& channelId); |
|
void filesRequested(const QString& channelId); |
|
void joinRequested(); |
|
void createGroupRequested(); |
|
void settingsRequested(); |
|
void connMonitorRequested(); |
|
|
|
private: |
|
QListView *m_listView; |
|
QStandardItemModel *m_model; |
|
DbManager *m_db; |
|
bool m_autoConnectActive = false; |
|
QHash<QString, bool> m_dmOnline; |
|
QTimer* m_dmPresenceTimer; |
|
};
|
|
|