diff --git a/InstructorsAndTrainees/instructors/viewerinstructors.cpp b/InstructorsAndTrainees/instructors/viewerinstructors.cpp
index 2ba92ec..2415f5d 100644
--- a/InstructorsAndTrainees/instructors/viewerinstructors.cpp
+++ b/InstructorsAndTrainees/instructors/viewerinstructors.cpp
@@ -15,6 +15,8 @@ ViewerInstructors::ViewerInstructors(ConnectorToServer* connectorToServer, QWidg
preparationTreeWidget();
setNotLoggedInVisible(true);
+
+ ui->btnEditorInstructors->setVisible(false);
}
ViewerInstructors::~ViewerInstructors()
diff --git a/InstructorsAndTrainees/instructors/viewerinstructors.h b/InstructorsAndTrainees/instructors/viewerinstructors.h
index 8d551b5..0451222 100644
--- a/InstructorsAndTrainees/instructors/viewerinstructors.h
+++ b/InstructorsAndTrainees/instructors/viewerinstructors.h
@@ -29,7 +29,7 @@ Q_SIGNALS:
//сигнал о блокировке авторизации
void signal_BlockAutorization(bool block);
-private Q_SLOTS:
+public Q_SLOTS:
void on_btnEditorInstructors_clicked();
private:
diff --git a/InstructorsAndTrainees/instructorsandtraineeswidget.cpp b/InstructorsAndTrainees/instructorsandtraineeswidget.cpp
index ea4da54..839c4b1 100644
--- a/InstructorsAndTrainees/instructorsandtraineeswidget.cpp
+++ b/InstructorsAndTrainees/instructorsandtraineeswidget.cpp
@@ -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();
+}
diff --git a/InstructorsAndTrainees/instructorsandtraineeswidget.h b/InstructorsAndTrainees/instructorsandtraineeswidget.h
index dac149e..9433a06 100644
--- a/InstructorsAndTrainees/instructorsandtraineeswidget.h
+++ b/InstructorsAndTrainees/instructorsandtraineeswidget.h
@@ -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);
diff --git a/InstructorsAndTrainees/instructorsandtraineeswidget.ui b/InstructorsAndTrainees/instructorsandtraineeswidget.ui
index f5e9d72..d3ec39d 100644
--- a/InstructorsAndTrainees/instructorsandtraineeswidget.ui
+++ b/InstructorsAndTrainees/instructorsandtraineeswidget.ui
@@ -218,6 +218,58 @@
+ -
+
+
+
+ 58
+ 58
+
+
+
+ Editor Trainees
+
+
+
+ :/resources/icons/DB-trainees.png:/resources/icons/DB-trainees.png
+
+
+
+ 32
+ 32
+
+
+
+ Qt::ToolButtonTextUnderIcon
+
+
+
+ -
+
+
+
+ 58
+ 58
+
+
+
+ Editor Instructors
+
+
+
+ :/resources/icons/DB-instructors.png:/resources/icons/DB-instructors.png
+
+
+
+ 32
+ 32
+
+
+
+ Qt::ToolButtonTextUnderIcon
+
+
+
-
diff --git a/InstructorsAndTrainees/resources.qrc b/InstructorsAndTrainees/resources.qrc
index 9f49790..dc5c23a 100644
--- a/InstructorsAndTrainees/resources.qrc
+++ b/InstructorsAndTrainees/resources.qrc
@@ -50,5 +50,6 @@
resources/icons/settings.png
resources/icons/style.png
resources/icons/updateVersion.png
+ resources/icons/editorDB.png
diff --git a/InstructorsAndTrainees/resources/icons/editorDB.png b/InstructorsAndTrainees/resources/icons/editorDB.png
new file mode 100644
index 0000000..c701ab6
Binary files /dev/null and b/InstructorsAndTrainees/resources/icons/editorDB.png differ
diff --git a/InstructorsAndTrainees/trainees/viewertrainees.cpp b/InstructorsAndTrainees/trainees/viewertrainees.cpp
index d34c51b..27ae4c8 100644
--- a/InstructorsAndTrainees/trainees/viewertrainees.cpp
+++ b/InstructorsAndTrainees/trainees/viewertrainees.cpp
@@ -28,6 +28,8 @@ ViewerTrainees::ViewerTrainees(ConnectorToServer* connectorToServer, QWidget *pa
preparationTreeWidget();
setNotLoggedInVisible(true);
+
+ ui->btnEditorTrainees->setVisible(false);
}
ViewerTrainees::~ViewerTrainees()
diff --git a/InstructorsAndTrainees/trainees/viewertrainees.h b/InstructorsAndTrainees/trainees/viewertrainees.h
index 40cd3e7..ec323c2 100644
--- a/InstructorsAndTrainees/trainees/viewertrainees.h
+++ b/InstructorsAndTrainees/trainees/viewertrainees.h
@@ -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: