Вынес кнопки редакторов Обучаимых Инструкторов

This commit is contained in:
2025-05-29 16:10:57 +03:00
parent 1b8974b0d6
commit f8a69c6f22
9 changed files with 87 additions and 2 deletions

View File

@@ -15,6 +15,8 @@ ViewerInstructors::ViewerInstructors(ConnectorToServer* connectorToServer, QWidg
preparationTreeWidget();
setNotLoggedInVisible(true);
ui->btnEditorInstructors->setVisible(false);
}
ViewerInstructors::~ViewerInstructors()

View File

@@ -29,7 +29,7 @@ Q_SIGNALS:
//сигнал о блокировке авторизации
void signal_BlockAutorization(bool block);
private Q_SLOTS:
public Q_SLOTS:
void on_btnEditorInstructors_clicked();
private:

View File

@@ -104,6 +104,9 @@ InstructorsAndTraineesWidget::InstructorsAndTraineesWidget(QWidget *parent) :
messangerWidget->setMaximumWidth(500);
ui->btnAuthorizationInstructor->setEnabled(false);
ui->btnEditorTrainees->setEnabled(false);
ui->btnEditorInstructors->setEnabled(false);
}
InstructorsAndTraineesWidget::~InstructorsAndTraineesWidget()
@@ -202,6 +205,10 @@ void InstructorsAndTraineesWidget::checkLoginResult(ServerAuthorization *serverA
viewerInstructors->setAuthComplited(true);
viewerTrainees->setAuthComplited(true);
ui->btnEditorTrainees->setEnabled(true);
if(adminMode)
ui->btnEditorInstructors->setEnabled(true);
Q_EMIT signal_NeedUpdateUI(true, true);
//ui->btnSetVersion->show();
ui->btnAuthorizationInstructor->setText(tr("Deauthorization Instructor"));
@@ -234,6 +241,9 @@ void InstructorsAndTraineesWidget::checkDeLoginResult(ServerDeAuthorization *ser
viewerInstructors->setAuthComplited(false);
viewerTrainees->setAuthComplited(false);
ui->btnEditorTrainees->setEnabled(false);
ui->btnEditorInstructors->setEnabled(false);
//Q_EMIT signal_NeedUpdateUI(true, false);
ui->btnAuthorizationInstructor->setText(tr("Authorization Instructor"));
@@ -273,6 +283,9 @@ void InstructorsAndTraineesWidget::slot_ConnectedToServer(bool state)
viewerInstructors->setAuthComplited(false);
viewerTrainees->setAuthComplited(false);
ui->btnEditorTrainees->setEnabled(false);
ui->btnEditorInstructors->setEnabled(false);
viewerTrainees->deactivate();
viewerInstructors->deactivate();
@@ -429,3 +442,13 @@ void InstructorsAndTraineesWidget::on_btnSettings_clicked()
break;
}
}
void InstructorsAndTraineesWidget::on_btnEditorTrainees_clicked()
{
this->viewerTrainees->on_btnEditorTrainees_clicked();
}
void InstructorsAndTraineesWidget::on_btnEditorInstructors_clicked()
{
this->viewerInstructors->on_btnEditorInstructors_clicked();
}

View File

@@ -72,6 +72,10 @@ private Q_SLOTS:
void on_btnSettings_clicked();
void on_btnEditorTrainees_clicked();
void on_btnEditorInstructors_clicked();
private:
//Авторизация инструктора локальная
bool authorizationInstructorDialog(QWidget* parent = nullptr);

View File

@@ -218,6 +218,58 @@
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btnEditorTrainees">
<property name="minimumSize">
<size>
<width>58</width>
<height>58</height>
</size>
</property>
<property name="text">
<string>Editor Trainees</string>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/resources/icons/DB-trainees.png</normaloff>:/resources/icons/DB-trainees.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btnEditorInstructors">
<property name="minimumSize">
<size>
<width>58</width>
<height>58</height>
</size>
</property>
<property name="text">
<string>Editor Instructors</string>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/resources/icons/DB-instructors.png</normaloff>:/resources/icons/DB-instructors.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btnSettings">
<property name="minimumSize">

View File

@@ -50,5 +50,6 @@
<file>resources/icons/settings.png</file>
<file>resources/icons/style.png</file>
<file>resources/icons/updateVersion.png</file>
<file>resources/icons/editorDB.png</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

View File

@@ -28,6 +28,8 @@ ViewerTrainees::ViewerTrainees(ConnectorToServer* connectorToServer, QWidget *pa
preparationTreeWidget();
setNotLoggedInVisible(true);
ui->btnEditorTrainees->setVisible(false);
}
ViewerTrainees::~ViewerTrainees()

View File

@@ -31,9 +31,10 @@ Q_SIGNALS:
//сигнал о блокировке авторизации
void signal_BlockAutorization(bool block);
private Q_SLOTS:
public Q_SLOTS:
//void on_treeWidget_itemClicked(QTreeWidgetItem *item, int column);
void on_btnEditorTrainees_clicked();
private Q_SLOTS:
void on_treeWidget_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
public Q_SLOTS: