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:
@@ -2,5 +2,8 @@
|
||||
<qresource prefix="/">
|
||||
<file>resources/PngServerRRJ.png</file>
|
||||
<file>resources/IcoServerRRJ.ico</file>
|
||||
<file>resources/PngServerRRJ_lock.png</file>
|
||||
<file>resources/PngServerRRJ_start.png</file>
|
||||
<file>resources/PngServerRRJ_stop.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -52,6 +52,8 @@ public slots:
|
||||
|
||||
//Слот вывода сообщения из трея
|
||||
void slot_Tray_ShowMessage(QString textMsg, QSystemTrayIcon::MessageIcon iconMsg = QSystemTrayIcon::Information);
|
||||
//Слот изменения иконки трея
|
||||
void slot_updateStateServer(EStateServer stateServer, EStateBlockAutorization stateBlockAutorization);
|
||||
|
||||
//Слот отложенной инициализации
|
||||
void slot_LazyInitialization();
|
||||
|
||||
BIN
ProgramServerMPS/resources/PngServerRRJ_lock.png
Normal file
BIN
ProgramServerMPS/resources/PngServerRRJ_lock.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
BIN
ProgramServerMPS/resources/PngServerRRJ_start.png
Normal file
BIN
ProgramServerMPS/resources/PngServerRRJ_start.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
BIN
ProgramServerMPS/resources/PngServerRRJ_stop.png
Normal file
BIN
ProgramServerMPS/resources/PngServerRRJ_stop.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
Reference in New Issue
Block a user