Fixed system tray icon update bug
This commit is contained in:
@@ -89,13 +89,14 @@ void MainWidget::deviceDisconnect()
|
|||||||
|
|
||||||
void MainWidget::deviceConnected(QString message)
|
void MainWidget::deviceConnected(QString message)
|
||||||
{
|
{
|
||||||
Q_UNUSED(message);
|
|
||||||
#ifndef Q_OS_WIN32
|
#ifndef Q_OS_WIN32
|
||||||
trayIcon->setIcon(QIcon(":/main/resources/images/psv_icon.png"));
|
trayIcon->setIcon(QIcon(":/main/resources/images/psv_icon.png"));
|
||||||
#else
|
#else
|
||||||
trayIcon->setIcon(QIcon(":/main/resources/images/psv_icon_16.png"));
|
trayIcon->setIcon(QIcon(":/main/resources/images/psv_icon_16.png"));
|
||||||
#endif
|
#endif
|
||||||
qDebug("Icon changed - connected");
|
qDebug("Icon changed - connected");
|
||||||
|
setTrayTooltip(message);
|
||||||
|
receiveMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWidget::prepareApplication()
|
void MainWidget::prepareApplication()
|
||||||
@@ -110,8 +111,6 @@ void MainWidget::connectSignals()
|
|||||||
connect(&dialog, SIGNAL(finished(int)), this, SLOT(dialogResult(int)));
|
connect(&dialog, SIGNAL(finished(int)), this, SLOT(dialogResult(int)));
|
||||||
connect(&manager, SIGNAL(stopped()), qApp, SLOT(quit()));
|
connect(&manager, SIGNAL(stopped()), qApp, SLOT(quit()));
|
||||||
connect(&manager, SIGNAL(deviceConnected(QString)), this, SLOT(deviceConnected(QString)));
|
connect(&manager, SIGNAL(deviceConnected(QString)), this, SLOT(deviceConnected(QString)));
|
||||||
connect(&manager, SIGNAL(deviceConnected(QString)), this, SLOT(receiveMessage(QString)));
|
|
||||||
connect(&manager, SIGNAL(deviceConnected(QString)), this, SLOT(setTrayTooltip(QString)));
|
|
||||||
connect(&manager, SIGNAL(deviceDisconnected()), this, SLOT(deviceDisconnect()));
|
connect(&manager, SIGNAL(deviceDisconnected()), this, SLOT(deviceDisconnect()));
|
||||||
connect(&manager, SIGNAL(messageSent(QString)), this, SLOT(receiveMessage(QString)));
|
connect(&manager, SIGNAL(messageSent(QString)), this, SLOT(receiveMessage(QString)));
|
||||||
|
|
||||||
@@ -177,6 +176,7 @@ void MainWidget::createTrayIcon()
|
|||||||
trayIconMenu->addSeparator();
|
trayIconMenu->addSeparator();
|
||||||
trayIconMenu->addAction(about);
|
trayIconMenu->addAction(about);
|
||||||
trayIconMenu->addAction(about_qt);
|
trayIconMenu->addAction(about_qt);
|
||||||
|
trayIconMenu->addSeparator();
|
||||||
trayIconMenu->addAction(quit);
|
trayIconMenu->addAction(quit);
|
||||||
|
|
||||||
trayIcon = new QSystemTrayIcon(this);
|
trayIcon = new QSystemTrayIcon(this);
|
||||||
@@ -188,7 +188,7 @@ void MainWidget::createTrayIcon()
|
|||||||
#endif
|
#endif
|
||||||
trayIcon->show();
|
trayIcon->show();
|
||||||
// try to avoid the iconTray Qt bug
|
// try to avoid the iconTray Qt bug
|
||||||
Sleeper::sleep(1);
|
//Sleeper::sleep(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWidget::receiveMessage(QString message)
|
void MainWidget::receiveMessage(QString message)
|
||||||
|
Reference in New Issue
Block a user