mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-27 19:45:43 +03:00
Settings 1
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
MainWindow::MainWindow(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::MainWindow),
|
||||
m_serverLMSWidget(nullptr),
|
||||
serverLMSWidget(nullptr),
|
||||
trayIcon(nullptr),
|
||||
menu(nullptr),
|
||||
action_ShowWindow(nullptr),
|
||||
@@ -18,11 +18,11 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
//Задаём два пункта с текстом локалей в комбобоксе
|
||||
ui->cmbLanguage->addItems(QStringList() << "English" << "Русский");
|
||||
|
||||
m_serverLMSWidget = new ServerLMSWidget(this);
|
||||
serverLMSWidget = new ServerLMSWidget(this);
|
||||
|
||||
ui->verticalLayout_1->addWidget(m_serverLMSWidget);
|
||||
ui->verticalLayout_1->addWidget(serverLMSWidget);
|
||||
|
||||
connect(this, &MainWindow::signal_LanguageChanged, m_serverLMSWidget, &ServerLMSWidget::slot_LanguageChanged);
|
||||
connect(serverLMSWidget, &ServerLMSWidget::signal_LanguageChanged, this, &MainWindow::slot_LanguageChanged);
|
||||
|
||||
//this->move(0, 0);
|
||||
//this->showNormal();
|
||||
@@ -115,7 +115,7 @@ void MainWindow::exit()
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
delete m_serverLMSWidget;
|
||||
delete serverLMSWidget;
|
||||
delete trayIcon;
|
||||
delete ui;
|
||||
}
|
||||
@@ -146,7 +146,7 @@ void MainWindow::on_cmbLanguage_currentIndexChanged(const QString &arg1)
|
||||
|
||||
void MainWindow::errorCheck()
|
||||
{
|
||||
if(m_serverLMSWidget->hasError() == 100)
|
||||
if(serverLMSWidget->hasError() == 100)
|
||||
{
|
||||
QMessageBox msgBox;
|
||||
|
||||
@@ -193,3 +193,9 @@ void MainWindow::slot_Menu_Exit()
|
||||
this->hide();
|
||||
this->close();
|
||||
}
|
||||
|
||||
void MainWindow::slot_LanguageChanged(QString language)
|
||||
{
|
||||
qtLanguageTranslator.load(QString(QStringLiteral("translations/TrayServerLMS_")) + language, QStringLiteral("."));
|
||||
qApp->installTranslator(&qtLanguageTranslator);
|
||||
}
|
||||
|
||||
@@ -36,6 +36,10 @@ protected:
|
||||
*/
|
||||
void closeEvent(QCloseEvent * event) override;
|
||||
|
||||
public slots:
|
||||
//Слот обработки смены языка
|
||||
void slot_LanguageChanged(QString language);
|
||||
|
||||
private slots:
|
||||
//Слот нажатия на иконку приложения в трее
|
||||
void slot_IconActivated(QSystemTrayIcon::ActivationReason reason);
|
||||
@@ -60,7 +64,7 @@ private:
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
ServerLMSWidget* m_serverLMSWidget;
|
||||
ServerLMSWidget* serverLMSWidget;
|
||||
QTranslator qtLanguageTranslator;
|
||||
|
||||
QSystemTrayIcon* trayIcon;
|
||||
|
||||
Reference in New Issue
Block a user