Вынес настройки ГУИ в отдельную кнопку

This commit is contained in:
2025-05-27 17:54:07 +03:00
parent d76bb562d9
commit 5191e12389
17 changed files with 302 additions and 78 deletions

View File

@@ -3,6 +3,7 @@
#include "instructorsandtraineeswidget.h"
#include "ui_instructorsandtraineeswidget.h"
#include "dialogauthorizationinstructor.h"
#include "dialogsettings.h"
InstructorsAndTraineesWidget::InstructorsAndTraineesWidget(QWidget *parent) :
QWidget(parent),
@@ -19,7 +20,7 @@ InstructorsAndTraineesWidget::InstructorsAndTraineesWidget(QWidget *parent) :
{
ui->setupUi(this);
ui->btnUpdateStyleSheet->setObjectName("btnUpdateStyleSheet");
ui->btnSettings->setObjectName("btnSettings");
#ifndef PROJECT_TYPE_DEBUG
ui->btnUpdateStyleSheet->setVisible(false);
#endif
@@ -182,7 +183,12 @@ void InstructorsAndTraineesWidget::slot_LanguageChanged(QString language)
qtLanguageTranslator.load(QString(QStringLiteral("translations/InstructorsAndTraineesWidget_")) + language, QStringLiteral("."));
qApp->installTranslator(&qtLanguageTranslator);
Q_EMIT signal_LanguageChanged(language);
emit signal_LanguageChanged(language);
}
void InstructorsAndTraineesWidget::slot_UpdateStyleSheet()
{
updateMyStyleSheet();
}
void InstructorsAndTraineesWidget::checkLoginResult(ServerAuthorization *serverAuth)
@@ -408,11 +414,6 @@ void InstructorsAndTraineesWidget::updateLabelLoggedInInstructor(QString login,
}
}
void InstructorsAndTraineesWidget::on_btnUpdateStyleSheet_clicked()
{
updateMyStyleSheet();
}
void InstructorsAndTraineesWidget::on_btnSetVersion_clicked()
{
connectorToServer->showVersionSelect();
@@ -445,3 +446,24 @@ void InstructorsAndTraineesWidget::on_tabWidget_currentChanged(int index)
ui->btnAssignTask->setEnabled(false);
}
}
void InstructorsAndTraineesWidget::on_btnSettings_clicked()
{
DialogSettings dlg(this);
connect(&dlg, &DialogSettings::signal_LanguageChanged, this, &InstructorsAndTraineesWidget::slot_LanguageChanged);
connect(&dlg, &DialogSettings::signal_UpdateStyleSheet, this, &InstructorsAndTraineesWidget::slot_UpdateStyleSheet);
switch( dlg.exec() )
{
case QDialog::Accepted:
{
break;
}
case QDialog::Rejected:
break;
default:
break;
}
}