Files
RRJServer/ProgramServerMPS/mainwindow.h
2025-12-05 11:48:24 +03:00

78 lines
2.3 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QTranslator>
#include <QEvent>
#include <QCloseEvent>
#include <QSystemTrayIcon>
#include <QAction>
#include "serverlmswidget.h"
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
protected:
/* Метод получения событий в главном окне приложения
* В нём будет производиться проверка события смены перевода приложения
*/
void changeEvent(QEvent * event) override;
/* Виртуальная функция родительского класса в нашем классе
* переопределяется для изменения поведения приложения,
* чтобы оно сворачивалось в трей, когда мы этого хотим
*/
void closeEvent(QCloseEvent * event) override;
public slots:
//Слот обработки смены языка
void slot_LanguageChanged(QString language);
//Слот нажатия на иконку приложения в трее
void slot_TrayIconActivated(QSystemTrayIcon::ActivationReason reason);
//Слот нажатия на сообщение
void slot_TrayMessageClicked();
//Слоты нажатия на пункты меню
void slot_TrayMenu_ShowWindow();
void slot_TrayMenu_HideWindow();
void slot_TrayMenu_Exit();
//Слот вывода сообщения из трея
void slot_Tray_ShowMessage(QString textMsg, QSystemTrayIcon::MessageIcon iconMsg = QSystemTrayIcon::Information);
//Слот отложенной инициализации
void slot_LazyInitialization();
void slot_hasError(int code);
private:
void exit();
void errorCheck();
void updateTrayTitles();
private:
Ui::MainWindow *ui;
ServerLMSWidget* serverLMSWidget;
QTranslator qtLanguageTranslator;
//Трей
QSystemTrayIcon* trayIcon;
QMenu * trayMenu;
QAction * action_ShowWindow;
QAction * action_HideWindow;
QAction * action_Exit;
};
#endif // MAINWINDOW_H