mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
Разные иконки в трее
This commit is contained in:
@@ -30,6 +30,8 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
connect(serverLMSWidget, &ServerLMSWidget::signal_Menu_ShowWindow, this, &MainWindow::slot_TrayMenu_ShowWindow);
|
||||
connect(serverLMSWidget, &ServerLMSWidget::signal_Menu_HideWindow, this, &MainWindow::slot_TrayMenu_HideWindow);
|
||||
|
||||
connect(serverLMSWidget, &ServerLMSWidget::signal_updateStateServer, this, &MainWindow::slot_updateStateServer);
|
||||
|
||||
qtLanguageTranslator.load(QString("translations/RRJServer_") + serverLMSWidget->getLanguage(), ".");
|
||||
qApp->installTranslator(&qtLanguageTranslator);
|
||||
|
||||
@@ -38,7 +40,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
* */
|
||||
trayIcon = new QSystemTrayIcon(this);
|
||||
//trayIcon->setIcon(this->style()->standardIcon(QStyle::SP_ComputerIcon));
|
||||
trayIcon->setIcon(QPixmap(":/resources/PngServerRRJ.png"));
|
||||
trayIcon->setIcon(QPixmap(":/resources/PngServerRRJ_stop.png"));
|
||||
|
||||
/* После чего создаем контекстное меню для иконки трея*/
|
||||
trayMenu = new QMenu(this);
|
||||
@@ -172,6 +174,25 @@ void MainWindow::slot_Tray_ShowMessage(QString textMsg, QSystemTrayIcon::Message
|
||||
icon, 100);
|
||||
}
|
||||
|
||||
void MainWindow::slot_updateStateServer(EStateServer stateServer, EStateBlockAutorization stateBlockAutorization)
|
||||
{
|
||||
if(stateServer == EStateServer::started)
|
||||
{
|
||||
if(stateBlockAutorization == EStateBlockAutorization::unblocked)
|
||||
{
|
||||
trayIcon->setIcon(QPixmap(":/resources/PngServerRRJ_start.png"));
|
||||
}
|
||||
else
|
||||
{
|
||||
trayIcon->setIcon(QPixmap(":/resources/PngServerRRJ_lock.png"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
trayIcon->setIcon(QPixmap(":/resources/PngServerRRJ_stop.png"));
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::slot_LazyInitialization()
|
||||
{
|
||||
serverLMSWidget->start();
|
||||
|
||||
Reference in New Issue
Block a user