diff --git a/InstructorsAndTrainees/CMakeLists.txt b/InstructorsAndTrainees/CMakeLists.txt
index e66266b..6c951b7 100644
--- a/InstructorsAndTrainees/CMakeLists.txt
+++ b/InstructorsAndTrainees/CMakeLists.txt
@@ -151,27 +151,27 @@ target_link_libraries(InstructorsAndTrainees PRIVATE libDataBaseLMS.dll)
if(PROJECT_TYPE_DEBUG)
add_custom_command(TARGET InstructorsAndTrainees
- POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${REPO_PATH}/BUILDS/Debug64/InstructorsAndTrainees/libInstructorsAndTrainees.dll
- ${REPO_PATH}/BUILDS/Debug64/GUIdataBaseLMS)
-
- add_custom_command(TARGET InstructorsAndTrainees
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${REPO_PATH}/BUILDS/Debug64/InstructorsAndTrainees/libInstructorsAndTrainees.dll
- ${REPO_PATH}/BUILDS/Debug64/TrayServerLMS)
+ ${REPO_PATH}/BUILDS/Debug64/InstructorsAndTrainees/libInstructorsAndTrainees.dll
+ ${REPO_PATH}/BUILDS/Debug64/GUIdataBaseLMS)
+
+ add_custom_command(TARGET InstructorsAndTrainees
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ ${REPO_PATH}/BUILDS/Debug64/InstructorsAndTrainees/libInstructorsAndTrainees.dll
+ ${REPO_PATH}/BUILDS/Debug64/TrayServerLMS)
else()
add_custom_command(TARGET InstructorsAndTrainees
- POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${REPO_PATH}/BUILDS/Release64/InstructorsAndTrainees/libInstructorsAndTrainees.dll
- ${REPO_PATH}/BUILDS/Release64/GUIdataBaseLMS)
- add_custom_command(TARGET InstructorsAndTrainees
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${REPO_PATH}/BUILDS/Release64/InstructorsAndTrainees/libInstructorsAndTrainees.dll
- ${REPO_PATH}/BUILDS/Release64/TrayServerLMS)
+ ${REPO_PATH}/BUILDS/Release64/InstructorsAndTrainees/libInstructorsAndTrainees.dll
+ ${REPO_PATH}/BUILDS/Release64/GUIdataBaseLMS)
+ add_custom_command(TARGET InstructorsAndTrainees
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ ${REPO_PATH}/BUILDS/Release64/InstructorsAndTrainees/libInstructorsAndTrainees.dll
+ ${REPO_PATH}/BUILDS/Release64/TrayServerLMS)
endif()
#Только для TSMP!
diff --git a/InstructorsAndTrainees/dialogsettings.ui b/InstructorsAndTrainees/dialogsettings.ui
index 9c38188..bb28e7e 100644
--- a/InstructorsAndTrainees/dialogsettings.ui
+++ b/InstructorsAndTrainees/dialogsettings.ui
@@ -26,7 +26,7 @@
Settings
-
+
:/resources/icons/lms.png:/resources/icons/lms.png
@@ -76,6 +76,16 @@
+ -
+
+
+ 2
+
+
+ Qt::Horizontal
+
+
+
-
@@ -232,7 +242,7 @@
Save
-
+
:/resources/icons/circleGreen.png:/resources/icons/circleGreen.png
@@ -291,7 +301,7 @@
Version
-
+
:/resources/icons/updateVersion.png:/resources/icons/updateVersion.png
@@ -323,7 +333,7 @@
Style
-
+
:/resources/icons/style.png:/resources/icons/style.png
@@ -359,6 +369,8 @@
-
+
+
+
diff --git a/ServerLMS/dialogcheckdb.cpp b/ServerLMS/dialogcheckdb.cpp
index bb718c5..1b45be2 100644
--- a/ServerLMS/dialogcheckdb.cpp
+++ b/ServerLMS/dialogcheckdb.cpp
@@ -81,6 +81,7 @@ void DialogCheckDB::on_btnRepare_clicked()
if(!resDriver)
{
QMessageBox::critical(this, tr("Error!"), tr("Install PostgreSQL."));
+ this->reject();
return;
}
@@ -88,8 +89,9 @@ void DialogCheckDB::on_btnRepare_clicked()
{
if(!providerDBLMS->createUser())
{
- QMessageBox::critical(this, tr("Error!"), tr("Failed to create user!"));
check();
+ QMessageBox::critical(this, tr("Error!"), tr("Failed to create user!"));
+ this->reject();
return;
}
}
@@ -98,8 +100,9 @@ void DialogCheckDB::on_btnRepare_clicked()
{
if(!providerDBLMS->createDB())
{
- QMessageBox::critical(this, tr("Error!"), tr("Failed to create Database!"));
check();
+ QMessageBox::critical(this, tr("Error!"), tr("Failed to create Database!"));
+ this->reject();
return;
}
}
diff --git a/ServerLMS/dialogcheckdb.ui b/ServerLMS/dialogcheckdb.ui
index e8fe577..c046dc4 100644
--- a/ServerLMS/dialogcheckdb.ui
+++ b/ServerLMS/dialogcheckdb.ui
@@ -7,7 +7,7 @@
0
0
400
- 300
+ 250
@@ -45,7 +45,7 @@
-
-
+
Qt::Horizontal
@@ -229,6 +229,9 @@
+ -
+
+
-
diff --git a/ServerLMS/dialogsettingstray.cpp b/ServerLMS/dialogsettingstray.cpp
index 5baec07..c492ab9 100644
--- a/ServerLMS/dialogsettingstray.cpp
+++ b/ServerLMS/dialogsettingstray.cpp
@@ -34,7 +34,7 @@ DialogSettingsTray::DialogSettingsTray(ProviderDBLMS* providerDBLMS, QWidget *pa
/* Устанавливаем Валидатор на QLineEdit */
ui->editHostName->setValidator(ipValidator);
- settings = new ServerDBSettings;
+ settings = new ServerDBSettings();
//Задаём два пункта с текстом локалей в комбобоксе
ui->cmbLanguage->addItems(QStringList() << "English" << "Русский");
@@ -50,7 +50,17 @@ DialogSettingsTray::DialogSettingsTray(ProviderDBLMS* providerDBLMS, QWidget *pa
ui->cmbLanguage->setCurrentText("Русский");
ui->editNameDB->setText(settings->NameDB);
+
+ if(settings->HostName == "localhost")
+ {
+ ui->checkLocalhost->setChecked(true);
+ }
+ else
+ {
+ ui->checkLocalhost->setChecked(false);
+ }
ui->editHostName->setText(settings->HostName);
+
ui->editPort->setText(settings->Port);
ui->editUserName->setText(settings->UserName);
ui->editPassword->setText(settings->Password);
@@ -240,6 +250,20 @@ void DialogSettingsTray::on_editPassword_textChanged(const QString &arg1)
flSettingsServerChanged = true;
}
+void DialogSettingsTray::on_checkLocalhost_stateChanged(int arg1)
+{
+ if(arg1)
+ {
+ ui->editHostName->setText("localhost");
+ ui->editHostName->setEnabled(false);
+ }
+ else
+ {
+ ui->editHostName->setText("0.0.0.0");
+ ui->editHostName->setEnabled(true);
+ }
+}
+
void DialogSettingsTray::on_btnCheckDB_clicked()
{
//Проверяем, установлен ли PostgreSQL
@@ -249,7 +273,7 @@ void DialogSettingsTray::on_btnCheckDB_clicked()
return;
}
- //TODO Запрос Логина и Пароля Суперюзера PostgreSQL (postgres)
+ //Запрос Логина и Пароля Суперюзера PostgreSQL (postgres)
QString UserNamePostgres;
QString PasswordPostgres;
@@ -296,7 +320,17 @@ void DialogSettingsTray::on_btnCheckDB_clicked()
}
else
{
- QMessageBox::critical(this, tr("Error!"), tr("The superuser login or password is incorrect!"));
+ if(settings->HostName == "localhost")
+ QMessageBox::critical(this, tr("Error!"), tr("Error connecting to PostgreSQL!") + "\n\n" +
+ tr("Possible reasons:") + "\n" +
+ tr("*superuser PostgreSQL login or password is incorrect;") + "\n" +
+ tr("*Port is incorrect."));
+ else
+ QMessageBox::critical(this, tr("Error!"), tr("Error connecting to PostgreSQL!") + "\n\n" +
+ tr("Possible reasons:") + "\n" +
+ tr("*superuser PostgreSQL login or password is incorrect;") + "\n" +
+ tr("*Port is incorrect;") + "\n" +
+ tr("*file 'pg_hba.conf' does not contain an entry for the IP address:") + settings->HostName + ".");
return;
}
}
diff --git a/ServerLMS/dialogsettingstray.h b/ServerLMS/dialogsettingstray.h
index 72f0916..183579c 100644
--- a/ServerLMS/dialogsettingstray.h
+++ b/ServerLMS/dialogsettingstray.h
@@ -58,6 +58,8 @@ private slots:
void on_btnCheckDB_clicked();
+ void on_checkLocalhost_stateChanged(int arg1);
+
private:
bool saveSettings();
diff --git a/ServerLMS/dialogsettingstray.ui b/ServerLMS/dialogsettingstray.ui
index 7f78a77..068919b 100644
--- a/ServerLMS/dialogsettingstray.ui
+++ b/ServerLMS/dialogsettingstray.ui
@@ -6,8 +6,8 @@
0
0
- 400
- 427
+ 450
+ 400
@@ -51,38 +51,24 @@
+ -
+
+
+ 2
+
+
+ Qt::Horizontal
+
+
+
-
- Data Base
+ Database
-
-
-
-
-
-
-
-
- DB name
-
-
-
- -
-
-
-
- 170
- 16777215
-
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
-
-
-
-
@@ -92,6 +78,26 @@
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ Localhost
+
+
+
-
@@ -131,6 +137,33 @@
+ -
+
+
-
+
+
+ Database name
+
+
+
+ -
+
+
+ false
+
+
+
+ 170
+ 16777215
+
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+
+
-
-
@@ -142,6 +175,9 @@
-
+
+ false
+
170
@@ -160,12 +196,15 @@
-
- Password
+ User password
-
+
+ false
+
170
diff --git a/ServerLMS/serverlmswidget.cpp b/ServerLMS/serverlmswidget.cpp
index 3e8f06b..59924a6 100644
--- a/ServerLMS/serverlmswidget.cpp
+++ b/ServerLMS/serverlmswidget.cpp
@@ -110,6 +110,8 @@ void ServerLMSWidget::slot_AddMessageToLog(QString message)
void ServerLMSWidget::start()
{
startInitialization();
+ if(hasError() == 100)
+ return;
tryConnectionToDB();
}
@@ -172,7 +174,7 @@ void ServerLMSWidget::on_btnSettings_clicked()
dlg.setWindowFlags(dlg.windowFlags() & ~Qt::WindowContextHelpButtonHint);
connect(&dlg, &DialogSettingsTray::signal_LanguageChanged, this, &ServerLMSWidget::slot_LanguageChanged);
- //connect(&dlg, &DialogSettingsTray::signal_UpdateStyleSheet, this, &InstructorsAndTraineesWidget::slot_UpdateStyleSheet);
+ //connect(&dlg, &DialogSettingsTray::signal_UpdateStyleSheet, this, &ServerLMSWidget::slot_UpdateStyleSheet);
switch( dlg.exec() )
diff --git a/TrayServerLMS/mainwindow.cpp b/TrayServerLMS/mainwindow.cpp
index 2213fae..74c89c5 100644
--- a/TrayServerLMS/mainwindow.cpp
+++ b/TrayServerLMS/mainwindow.cpp
@@ -9,48 +9,16 @@ MainWindow::MainWindow(QWidget *parent) :
ui(new Ui::MainWindow),
serverLMSWidget(nullptr),
trayIcon(nullptr),
- menu(nullptr),
+ trayMenu(nullptr),
action_ShowWindow(nullptr),
action_HideWindow(nullptr),
action_Exit(nullptr)
{
ui->setupUi(this);
- /* Инициализируем иконку трея, устанавливаем иконку,
- * а также задаем всплывающую подсказку
- * */
- trayIcon = new QSystemTrayIcon(this);
- //trayIcon->setIcon(this->style()->standardIcon(QStyle::SP_ComputerIcon));
- trayIcon->setIcon(QPixmap(":/resources/database-management.png"));
- trayIcon->setToolTip(tr("Server LMS"));
-
- /* После чего создаем контекстное меню*/
- menu = new QMenu(this);
- action_ShowWindow = new QAction(tr("Expand window"), this);
- action_HideWindow = new QAction(tr("Minimize window"), this);
- action_Exit = new QAction(tr("Exit"), this);
-
- /* подключаем сигналы нажатий на пункты меню к соответсвующим слотам.
- * */
- connect(action_ShowWindow, SIGNAL(triggered()), this, SLOT(slot_Menu_ShowWindow()));
- connect(action_HideWindow, SIGNAL(triggered()), this, SLOT(slot_Menu_HideWindow()));
- connect(action_Exit, SIGNAL(triggered()), this, SLOT(slot_Menu_Exit()));
-
- menu->addAction(action_ShowWindow);
- menu->addAction(action_HideWindow);
- menu->addAction(action_Exit);
-
- /* Устанавливаем контекстное меню на иконку
- * и показываем иконку приложения в трее
- * */
- trayIcon->setContextMenu(menu);
- trayIcon->show();
-
- /* Также подключаем сигнал нажатия на иконку к обработчику
- * данного нажатия
- * */
- connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
- this, SLOT(slot_Activated(QSystemTrayIcon::ActivationReason)));
+ //Скрываем ненужные элементы окна
+ ui->menubar->setVisible(false);
+ ui->statusbar->setVisible(false);
serverLMSWidget = new ServerLMSWidget(this);
@@ -59,17 +27,61 @@ MainWindow::MainWindow(QWidget *parent) :
connect(serverLMSWidget, &ServerLMSWidget::signal_LanguageChanged, this, &MainWindow::slot_LanguageChanged);
connect(serverLMSWidget, &ServerLMSWidget::signal_Tray_ShowMessage, this, &MainWindow::slot_Tray_ShowMessage);
- connect(serverLMSWidget, &ServerLMSWidget::signal_Menu_ShowWindow, this, &MainWindow::slot_Menu_ShowWindow);
- connect(serverLMSWidget, &ServerLMSWidget::signal_Menu_HideWindow, this, &MainWindow::slot_Menu_HideWindow);
+ connect(serverLMSWidget, &ServerLMSWidget::signal_Menu_ShowWindow, this, &MainWindow::slot_TrayMenu_ShowWindow);
+ connect(serverLMSWidget, &ServerLMSWidget::signal_Menu_HideWindow, this, &MainWindow::slot_TrayMenu_HideWindow);
qtLanguageTranslator.load(QString("translations/TrayServerLMS_") + serverLMSWidget->getLanguage(), ".");
qApp->installTranslator(&qtLanguageTranslator);
+ /* Инициализируем иконку трея, устанавливаем иконку,
+ * а также задаем всплывающую подсказку
+ * */
+ trayIcon = new QSystemTrayIcon(this);
+ //trayIcon->setIcon(this->style()->standardIcon(QStyle::SP_ComputerIcon));
+ trayIcon->setIcon(QPixmap(":/resources/database-management.png"));
+
+ /* После чего создаем контекстное меню для иконки трея*/
+ trayMenu = new QMenu(this);
+ action_ShowWindow = new QAction(this);
+ action_HideWindow = new QAction(this);
+ action_Exit = new QAction(this);
+
+ /* подключаем сигналы нажатий на пункты меню к соответсвующим слотам.
+ * */
+ connect(action_ShowWindow, &QAction::triggered, this, &MainWindow::slot_TrayMenu_ShowWindow);
+ connect(action_HideWindow, &QAction::triggered, this, &MainWindow::slot_TrayMenu_HideWindow);
+ connect(action_Exit, &QAction::triggered, this, &MainWindow::slot_TrayMenu_Exit);
+
+ trayMenu->addAction(action_ShowWindow);
+ trayMenu->addAction(action_HideWindow);
+ trayMenu->addAction(action_Exit);
+
+ updateTrayTitles();
+
+ /* Устанавливаем контекстное меню на иконку
+ * и показываем иконку приложения в трее
+ * */
+ trayIcon->setContextMenu(trayMenu);
+ trayIcon->show();
+
slot_Tray_ShowMessage(tr("Starting the server..."));
serverLMSWidget->start();
errorCheck();
+
+ QTimer::singleShot(1000,this,&MainWindow::slot_Connect);
+}
+
+MainWindow::~MainWindow()
+{
+ delete serverLMSWidget;
+ delete trayIcon;
+ delete trayMenu;
+ delete action_ShowWindow;
+ delete action_HideWindow;
+ delete action_Exit;
+ delete ui;
}
/* Метод, который обрабатывает событие закрытия окна приложения
@@ -77,64 +89,15 @@ MainWindow::MainWindow(QWidget *parent) :
void MainWindow::closeEvent(QCloseEvent * event)
{
/* Если окно видимо, то завершение приложения
- * игнорируется, а окно просто скрывается, что сопровождается
- * соответствующим всплывающим сообщением
+ * игнорируется, а окно просто скрывается
*/
if(this->isVisible())
{
event->ignore();
- slot_Menu_HideWindow();
+ slot_TrayMenu_HideWindow();
}
}
-/* Метод, который обрабатывает нажатие на иконку приложения в трее
- * */
-void MainWindow::slot_Activated(QSystemTrayIcon::ActivationReason reason)
-{
- switch (reason){
- case QSystemTrayIcon::Trigger:
- /* если окно видимо, то оно скрывается,
- * и наоборот, если скрыто, то разворачивается на экран
- * */
- if(!this->isVisible())
- {
- slot_Menu_ShowWindow();
- }
- else
- {
- slot_Menu_HideWindow();
- }
- break;
- default:
- break;
- }
-}
-
-void MainWindow::slot_MessageClicked()
-{
- if(!this->isVisible())
- {
- slot_Menu_ShowWindow();
- }
-}
-
-
-void MainWindow::exit()
-{
- QApplication::exit(0);
-}
-
-MainWindow::~MainWindow()
-{
- delete serverLMSWidget;
- delete trayIcon;
- delete menu;
- delete action_ShowWindow;
- delete action_HideWindow;
- delete action_Exit;
- delete ui;
-}
-
void MainWindow::changeEvent(QEvent *event)
{
// В случае получения события изменения языка приложения
@@ -142,56 +105,67 @@ void MainWindow::changeEvent(QEvent *event)
{// переведём окно заново
ui->retranslateUi(this);
- trayIcon->setToolTip(tr("Server LMS"));
- action_ShowWindow->setText(tr("Expand window"));
- action_HideWindow->setText(tr("Minimize window"));
- action_Exit->setText(tr("Exit"));
+ //и все, что связано с треем
+ updateTrayTitles();
}
}
-void MainWindow::errorCheck()
+/* Метод, который обрабатывает нажатие на иконку приложения в трее
+ * */
+void MainWindow::slot_TrayIconActivated(QSystemTrayIcon::ActivationReason reason)
{
- if(serverLMSWidget->hasError() == 100)
- {
- slot_Menu_ShowWindow();
-
- QMessageBox msgBox;
-
- msgBox.setWindowTitle(tr("Error!"));
- msgBox.setIcon(QMessageBox::Critical);
- msgBox.setText(tr("No Client files found!"));
- msgBox.setInformativeText(tr("* check Application for the presence of a folder with a build \n"
- "* check SharedData for a folder with the base version and the name base"));
- msgBox.setStandardButtons(QMessageBox::Close);
- msgBox.show();
- int ret = msgBox.exec();
-
- if (ret == QMessageBox::Close)
+ switch (reason){
+ case QSystemTrayIcon::Trigger:
+ /* если окно видимо, то оно скрывается,
+ * и наоборот, если скрыто, то разворачивается на экран
+ * */
+ if(!this->isVisible())
{
- //выключение с задержкой, так как eventLoop инициализируется позже
- QTimer::singleShot(1000,this,&MainWindow::slot_Menu_Exit);
+ slot_TrayMenu_ShowWindow();
}
+ else
+ {
+ slot_TrayMenu_HideWindow();
+ }
+ break;
+ default:
+ break;
}
}
-void MainWindow::slot_Menu_ShowWindow()
+/* Метод, который обрабатывает нажатие на сообщение из трея
+ * */
+void MainWindow::slot_TrayMessageClicked()
{
+ if(!this->isVisible())
+ {
+ slot_TrayMenu_ShowWindow();
+ }
+}
+
+void MainWindow::slot_TrayMenu_ShowWindow()
+{
+ //TODO под вопросом?
+ if(!serverLMSWidget->isEnabledTo(this))
+ return;
this->show();
action_ShowWindow->setEnabled(false);
action_HideWindow->setEnabled(true);
}
-void MainWindow::slot_Menu_HideWindow()
+void MainWindow::slot_TrayMenu_HideWindow()
{
this->hide();
action_ShowWindow->setEnabled(true);
action_HideWindow->setEnabled(false);
+ /*
slot_Tray_ShowMessage(tr("The application is minimized to the tray.\n"
"To maximize the application window, click the application icon in the tray."));
+ */
}
-void MainWindow::slot_Menu_Exit()
+void MainWindow::slot_TrayMenu_Exit()
{
this->hide();
this->close();
@@ -205,8 +179,58 @@ void MainWindow::slot_Tray_ShowMessage(QString textMsg, QSystemTrayIcon::Message
icon, 100);
}
+void MainWindow::slot_Connect()
+{
+ /* Также подключаем сигнал нажатия на иконку к обработчику
+ * данного нажатия
+ * */
+ connect(trayIcon, &QSystemTrayIcon::activated, this, &MainWindow::slot_TrayIconActivated);
+ /* Также подключаем сигнал нажатия на всплывающее сообщение к обработчику
+ * данного нажатия
+ * */
+ connect(trayIcon, &QSystemTrayIcon::messageClicked, this, &MainWindow::slot_TrayMessageClicked);
+}
+
void MainWindow::slot_LanguageChanged(QString language)
{
qtLanguageTranslator.load(QString(QStringLiteral("translations/TrayServerLMS_")) + language, QStringLiteral("."));
qApp->installTranslator(&qtLanguageTranslator);
}
+
+void MainWindow::exit()
+{
+ QApplication::exit(0);
+}
+
+void MainWindow::errorCheck()
+{
+ if(serverLMSWidget->hasError() == 100)
+ {
+ slot_TrayMenu_ShowWindow();
+
+ QMessageBox msgBox(this);
+
+ msgBox.setWindowTitle(tr("Error!"));
+ msgBox.setIcon(QMessageBox::Critical);
+ msgBox.setText(tr("No Client files found!"));
+ msgBox.setInformativeText(tr("* check Application for the presence of a folder with a build \n"
+ "* check SharedData for a folder with the base version and the name base"));
+ msgBox.setStandardButtons(QMessageBox::Close);
+ msgBox.show();
+ int ret = msgBox.exec();
+
+ if (ret == QMessageBox::Close)
+ {
+ //выключение с задержкой, так как eventLoop инициализируется позже
+ QTimer::singleShot(1000,this,&MainWindow::slot_TrayMenu_Exit);
+ }
+ }
+}
+
+void MainWindow::updateTrayTitles()
+{
+ trayIcon->setToolTip(tr("Server LMS"));
+ action_ShowWindow->setText(tr("Expand window"));
+ action_HideWindow->setText(tr("Minimize window"));
+ action_Exit->setText(tr("Exit"));
+}
diff --git a/TrayServerLMS/mainwindow.h b/TrayServerLMS/mainwindow.h
index 4bf6026..11a1635 100644
--- a/TrayServerLMS/mainwindow.h
+++ b/TrayServerLMS/mainwindow.h
@@ -41,25 +41,23 @@ public slots:
void slot_LanguageChanged(QString language);
//Слот нажатия на иконку приложения в трее
- void slot_Activated(QSystemTrayIcon::ActivationReason reason);
+ void slot_TrayIconActivated(QSystemTrayIcon::ActivationReason reason);
//Слот нажатия на сообщение
- void slot_MessageClicked();
+ void slot_TrayMessageClicked();
//Слоты нажатия на пункты меню
- void slot_Menu_ShowWindow();
- void slot_Menu_HideWindow();
- void slot_Menu_Exit();
+ void slot_TrayMenu_ShowWindow();
+ void slot_TrayMenu_HideWindow();
+ void slot_TrayMenu_Exit();
//Слот вывода сообщения из трея
void slot_Tray_ShowMessage(QString textMsg, QSystemTrayIcon::MessageIcon iconMsg = QSystemTrayIcon::Information);
-signals:
- //сигнал об изменении языка интерфейса
- void signal_LanguageChanged(QString language);
-
+ void slot_Connect();
private:
void exit();
void errorCheck();
+ void updateTrayTitles();
private:
Ui::MainWindow *ui;
@@ -68,7 +66,7 @@ private:
//Трей
QSystemTrayIcon* trayIcon;
- QMenu * menu;
+ QMenu * trayMenu;
QAction * action_ShowWindow;
QAction * action_HideWindow;
QAction * action_Exit;
diff --git a/TrayServerLMS/mainwindow.ui b/TrayServerLMS/mainwindow.ui
index 9b34282..2857fae 100644
--- a/TrayServerLMS/mainwindow.ui
+++ b/TrayServerLMS/mainwindow.ui
@@ -6,7 +6,7 @@
0
0
- 1198
+ 1200
800
@@ -35,16 +35,23 @@
-
+
+
+ false
+
+