Перекомпоновал ui
|
Before Width: | Height: | Size: 659 B After Width: | Height: | Size: 2.6 KiB |
BIN
DB_IaT/InstructorsAndTrainees/icons/admin.png.bak
Normal file
|
After Width: | Height: | Size: 659 B |
|
Before Width: | Height: | Size: 392 B After Width: | Height: | Size: 1.4 KiB |
BIN
DB_IaT/InstructorsAndTrainees/icons/circleGray.png.bak
Normal file
|
After Width: | Height: | Size: 392 B |
|
Before Width: | Height: | Size: 784 B After Width: | Height: | Size: 1.9 KiB |
BIN
DB_IaT/InstructorsAndTrainees/icons/circleGreen.png.bak
Normal file
|
After Width: | Height: | Size: 784 B |
@@ -9,7 +9,7 @@ ViewerInstructors::ViewerInstructors(InterfaceDataBaseLMS* db, QWidget *parent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->horizontalLayout_2->addWidget(treeWidget);
|
||||
ui->horizontalLayout_1->addWidget(treeWidget);
|
||||
|
||||
preparationTreeWidget(/*ui->treeWidget*/);
|
||||
setNotLoggedInVisible(true);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_0">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="font">
|
||||
@@ -34,9 +34,25 @@
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_1"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnEditorInstructors">
|
||||
<property name="enabled">
|
||||
@@ -66,19 +82,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
@@ -34,10 +34,12 @@ InstructorsAndTraineesWidget::InstructorsAndTraineesWidget(QWidget *parent) :
|
||||
ui->verticalLayout->addWidget(viewerTrainees);
|
||||
ui->verticalLayout->addWidget(viewerInstructors);
|
||||
|
||||
viewerTrainees->setMinimumSize(1600, 500);
|
||||
viewerInstructors->setMinimumSize(1600, 400);
|
||||
viewerTrainees->setMinimumSize(1600, 600);
|
||||
viewerInstructors->setMinimumSize(1600, 300);
|
||||
|
||||
ui->btnAuthorizationInstructor->setEnabled(false);
|
||||
|
||||
ui->btnConnectionToDB->click();
|
||||
}
|
||||
|
||||
InstructorsAndTraineesWidget::~InstructorsAndTraineesWidget()
|
||||
@@ -116,7 +118,7 @@ bool InstructorsAndTraineesWidget::authorizationInstructorLocal(QWidget* parent)
|
||||
viewerInstructors->setAuthComplited(true);
|
||||
viewerTrainees->setAuthComplited(true);
|
||||
|
||||
Q_EMIT signal_NeedUpdateUI(true, true);
|
||||
//Q_EMIT signal_NeedUpdateUI(true, true);
|
||||
|
||||
QMessageBox::information(parent, tr("Instructor authorization"), tr("Successfully!"));
|
||||
|
||||
@@ -308,13 +310,12 @@ QList<Trainee> InstructorsAndTraineesWidget::getListTrainees()
|
||||
*/
|
||||
|
||||
void InstructorsAndTraineesWidget::on_btnConnectionToDB_clicked()
|
||||
{
|
||||
mtxAccess.lock();
|
||||
|
||||
{
|
||||
bool stateIsChecked = ui->btnConnectionToDB->isChecked();
|
||||
|
||||
if(stateIsChecked)
|
||||
{//Подключение к БД
|
||||
mtxAccess.lock();
|
||||
if(! dbLMS->DBisConnected())
|
||||
{
|
||||
if(dbLMS->ConnectionToDB())
|
||||
@@ -322,6 +323,8 @@ void InstructorsAndTraineesWidget::on_btnConnectionToDB_clicked()
|
||||
ui->btnConnectionToDB->setText(tr("Disconnection DB"));
|
||||
ui->btnAuthorizationInstructor->setEnabled(true);
|
||||
|
||||
ui->lblDBisConnected->setPixmap(QPixmap(QStringLiteral(":/icons/circleGreen.png")));
|
||||
|
||||
Q_EMIT signal_NeedUpdateUI(true, true);
|
||||
|
||||
Q_EMIT signal_BlockAutorization(false);
|
||||
@@ -329,6 +332,7 @@ void InstructorsAndTraineesWidget::on_btnConnectionToDB_clicked()
|
||||
Q_EMIT signal_InitMessanger(dbLMS->getListTrainees());
|
||||
}
|
||||
}
|
||||
mtxAccess.unlock();
|
||||
}
|
||||
else
|
||||
{//Отключение от БД
|
||||
@@ -336,20 +340,22 @@ void InstructorsAndTraineesWidget::on_btnConnectionToDB_clicked()
|
||||
if(stateIsCheckedAuthorization)
|
||||
ui->btnAuthorizationInstructor->click();
|
||||
|
||||
mtxAccess.lock();
|
||||
if(dbLMS->DBisConnected())
|
||||
{
|
||||
Q_EMIT signal_BlockAutorization(true);
|
||||
|
||||
dbLMS->DisConnectionFromDB();
|
||||
ui->btnConnectionToDB->setText(tr("Connection DB"));
|
||||
|
||||
ui->btnConnectionToDB->setText(tr("Connection DB"));
|
||||
ui->btnAuthorizationInstructor->setEnabled(false);
|
||||
|
||||
ui->lblDBisConnected->setPixmap(QPixmap(QStringLiteral(":/icons/circleGray.png")));
|
||||
|
||||
Q_EMIT signal_NeedUpdateUI(true, true);
|
||||
}
|
||||
}
|
||||
|
||||
mtxAccess.unlock();
|
||||
mtxAccess.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::on_btnAuthorizationInstructor_clicked()
|
||||
|
||||
@@ -70,11 +70,36 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblDBisConnected">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="resources.qrc">:/icons/circleGray.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnAuthorizationInstructor">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>140</width>
|
||||
<width>170</width>
|
||||
<height>58</height>
|
||||
</size>
|
||||
</property>
|
||||
@@ -103,14 +128,14 @@
|
||||
<widget class="QLabel" name="lblLoggedIn">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
|
||||
@@ -128,6 +128,7 @@ void TraineesView::loadTraineesFromDB()
|
||||
ItemGroup->setText(ColumnsTreeTrainees::clmn_Trainee, group.getName());
|
||||
ItemGroup->setIcon(ColumnsTreeTrainees::clmn_Trainee, QIcon(QStringLiteral(":/icons/group.png")));
|
||||
setItemColor(ItemGroup, QColor(170, 190, 170));
|
||||
//((QAbstractItemView*)ItemGroup)->setIconSize(QSize(32, 32));
|
||||
|
||||
//Обучаемые
|
||||
for(Trainee trainee : listTrainees)
|
||||
|
||||
@@ -10,7 +10,7 @@ ViewerTrainees::ViewerTrainees(InterfaceDataBaseLMS* db, QWidget *parent) :
|
||||
|
||||
connect(treeWidget, &QTreeWidget::currentItemChanged, this, &ViewerTrainees::on_treeWidget_currentItemChanged);
|
||||
|
||||
ui->horizontalLayout_2->addWidget(treeWidget);
|
||||
ui->horizontalLayout_1->addWidget(treeWidget);
|
||||
|
||||
preparationTreeWidget(/*ui->treeWidget*/);
|
||||
setNotLoggedInVisible(true);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="2" rowspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_0">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="font">
|
||||
@@ -34,9 +34,25 @@
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_1"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnEditorTrainees">
|
||||
<property name="enabled">
|
||||
@@ -66,19 +82,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||