|
|
|
|
@ -183,6 +183,7 @@ MainWindow::MainWindow(QWidget *parent, DbManager* db, const QString& cfgPath,
|
|
|
|
|
MainWindow::~MainWindow() { |
|
|
|
|
s_mainWindow = nullptr; |
|
|
|
|
if (m_messageNotification) m_messageNotification->dismiss("shutdown"); |
|
|
|
|
m_messageNotification.reset(); |
|
|
|
|
delete AvatarManager::instance(); |
|
|
|
|
delete GroupAvatarManager::instance(); |
|
|
|
|
gui_bridge_set_group_avatar_result_cb(nullptr); |
|
|
|
|
@ -816,8 +817,8 @@ void MainWindow::setupTray() {
|
|
|
|
|
m_trayIcon->setIcon(QIcon(":/icons/app_icon.png")); |
|
|
|
|
m_trayIcon->setToolTip("vibechat"); |
|
|
|
|
|
|
|
|
|
m_messageNotification = new MessageNotification(this); |
|
|
|
|
connect(m_messageNotification, &MessageNotification::activated, this, [this](const QString& target) { |
|
|
|
|
m_messageNotification = std::make_unique<MessageNotification>(); |
|
|
|
|
connect(m_messageNotification.get(), &MessageNotification::activated, this, [this](const QString& target) { |
|
|
|
|
if (isMinimized()) setWindowState(windowState() & ~Qt::WindowMinimized); |
|
|
|
|
show(); |
|
|
|
|
raise(); |
|
|
|
|
@ -873,7 +874,7 @@ void MainWindow::showIncomingMessageNotification(const QString& target, quint64
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
m_messageNotification->showMessage(target, m_db->getDisplayName(author), channel, m_trayIcon->geometry()); |
|
|
|
|
m_messageNotification->showMessage(target, m_db->getDisplayName(author), channel, m_trayIcon->geometry(), screen()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void MainWindow::closeEvent(QCloseEvent *event) { |
|
|
|
|
|