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.
63 lines
1.9 KiB
63 lines
1.9 KiB
#pragma once |
|
|
|
#include <QMainWindow> |
|
#include <QSystemTrayIcon> |
|
#include <QMenu> |
|
|
|
class ChannelList; |
|
class MessageList; |
|
class AccountList; |
|
class DbManager; |
|
class UtunNode; |
|
|
|
class MainWindow : public QMainWindow { |
|
Q_OBJECT |
|
public: |
|
explicit MainWindow(QWidget *parent, DbManager* db, const QString& cfgPath, |
|
const QString& dbPath = QString(), |
|
const QString& debugFile = QString(), |
|
const QString& debugLevel = QString(), |
|
const QString& debugCategories = QString()); |
|
~MainWindow() override; |
|
|
|
protected: |
|
void closeEvent(QCloseEvent *event) override; |
|
|
|
private slots: |
|
void onTrayActivated(QSystemTrayIcon::ActivationReason reason); |
|
void showInviteDialog(const QString& channelId); |
|
void showJoinDialog(); |
|
void onCreateGroupRequested(); |
|
void showSettings(); |
|
|
|
public: |
|
void onMessageReceived(const char* ch_id); |
|
void onMembersChanged(const char* ch_id); |
|
void onAutoConnectStatus(uint8_t status, uint16_t total, uint16_t totalNodes, uint16_t connected); |
|
void onChannelPeersOnline(const char* ch_id, int ch_id_len, uint16_t online); |
|
void reloadChannels(); |
|
|
|
private: |
|
void setupUi(); |
|
void setupTray(); |
|
void setupNode(); |
|
void setupMessaging(); |
|
void setupSoundFromConfig(); |
|
void setupBridgeCallbacks(); |
|
void setupConnects(); |
|
|
|
ChannelList *m_channelList; |
|
MessageList *m_messageList; |
|
AccountList *m_accountList; |
|
QSystemTrayIcon *m_trayIcon; |
|
QMenu *m_trayMenu; |
|
DbManager *m_db; |
|
UtunNode *m_node = nullptr; |
|
QString m_cfgPath; |
|
QString m_cfgDbPath; |
|
QString m_cfgDebugFile; |
|
QString m_cfgDebugLevel; |
|
QString m_cfgDebugCategories; |
|
QString m_pendingChannelSelect; |
|
QString m_currentChannelId; |
|
};
|
|
|