Activate the existing VibeChat window on repeated launches
This commit is contained in:
1 parent
50017b7f74
commit
d7f30d7bb1
7 files changed
+473
-28
No files matched your search
@@ -1,5 +1,6 @@
|
||||
#include <QCoreApplication>
|
||||
#include "mainwindow.h"
|
||||
#include "single_instance.h"
|
||||
#include "streamplayer_window.h"
|
||||
#include "stream_publish_engine.h"
|
||||
#include "stream_publish_window.h"
|
||||
@@ -943,10 +944,7 @@ void MainWindow::setupTray() {
|
||||
|
||||
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();
|
||||
activateWindow();
|
||||
showAndActivateWindow(this);
|
||||
reloadChannels();
|
||||
m_channelList->selectChannel(target);
|
||||
if (m_currentChannelId != target) GUI_WARN("notification: target no longer available target=%s", qPrintable(target));
|
||||
@@ -961,10 +959,7 @@ void MainWindow::setupTray() {
|
||||
|
||||
QAction *showAction = m_trayMenu->addAction(QCoreApplication::translate("ChatGui", "Show"));
|
||||
connect(showAction, &QAction::triggered, this, [this]() {
|
||||
if (isMinimized()) setWindowState(windowState() & ~Qt::WindowMinimized);
|
||||
show();
|
||||
raise();
|
||||
activateWindow();
|
||||
showAndActivateWindow(this);
|
||||
});
|
||||
|
||||
QAction *quitAction = m_trayMenu->addAction(QCoreApplication::translate("ChatGui", "Quit"));
|
||||
@@ -1028,10 +1023,7 @@ void MainWindow::onShutdownCheck() {
|
||||
void MainWindow::onTrayActivated(QSystemTrayIcon::ActivationReason reason) {
|
||||
if (reason == QSystemTrayIcon::Trigger ||
|
||||
reason == QSystemTrayIcon::DoubleClick) {
|
||||
if (isMinimized()) setWindowState(windowState() & ~Qt::WindowMinimized);
|
||||
show();
|
||||
raise();
|
||||
activateWindow();
|
||||
showAndActivateWindow(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user