mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
66 lines
1.7 KiB
C++
66 lines
1.7 KiB
C++
#include <QMessageBox>
|
||
#include "editorinstructors.h"
|
||
#include "viewerinstructors.h"
|
||
#include "ui_viewerinstructors.h"
|
||
|
||
ViewerInstructors::ViewerInstructors(InterfaceDataBaseLMS* db, QWidget *parent) :
|
||
InstructorsView(db, CommonView::TypeView::onlyView, parent),
|
||
ui(new Ui::ViewerInstructors)
|
||
{
|
||
ui->setupUi(this);
|
||
|
||
ui->horizontalLayout_1->addWidget(treeWidget);
|
||
|
||
treeWidget->setSelectionMode(QAbstractItemView::NoSelection);
|
||
|
||
preparationTreeWidget(/*ui->treeWidget*/);
|
||
setNotLoggedInVisible(true);
|
||
}
|
||
|
||
ViewerInstructors::~ViewerInstructors()
|
||
{
|
||
delete ui;
|
||
}
|
||
|
||
void ViewerInstructors::changeEvent(QEvent *event)
|
||
{
|
||
// В случае получения события изменения языка приложения
|
||
if (event->type() == QEvent::LanguageChange)
|
||
{// переведём окно заново
|
||
ui->retranslateUi(this);
|
||
|
||
reSetHeadTreeWidget();
|
||
//loadInstructorsFromDB();
|
||
slot_NeedUpdateUI(true, false);
|
||
}
|
||
}
|
||
|
||
void ViewerInstructors::on_btnEditorInstructors_clicked()
|
||
{
|
||
Q_EMIT signal_BlockAutorization(true);
|
||
|
||
EditorInstructors editorInstructors(dbLMS, adminMode);
|
||
QDialog* dialog = new QDialog(this);
|
||
QHBoxLayout *layout = new QHBoxLayout(dialog);
|
||
layout->addWidget(&editorInstructors);
|
||
dialog->setWindowTitle(tr("Editor of instructors"));
|
||
dialog->setMinimumSize(1600, 800);
|
||
dialog->exec();
|
||
|
||
loadInstructorsFromDB();
|
||
|
||
Q_EMIT signal_BlockAutorization(false);
|
||
}
|
||
|
||
void ViewerInstructors::updateButtons()
|
||
{
|
||
if(adminMode && authComplited)
|
||
{
|
||
ui->btnEditorInstructors->setEnabled(true);
|
||
}
|
||
else
|
||
{
|
||
ui->btnEditorInstructors->setEnabled(false);
|
||
}
|
||
}
|