Блокировка доработал

This commit is contained in:
2025-10-03 10:51:17 +03:00
parent a70c8b5be1
commit 17f6119954
12 changed files with 97 additions and 53 deletions

View File

@@ -64,11 +64,11 @@ bool ProviderDBLMS::authorizationTrainee(QString login, QString password, QStrin
return false;
}
Q_EMIT signal_BlockAutorization(true);
//Q_EMIT signal_BlockAutorization(true);
bool res = dbLMS->authorizationTrainee(login, password, classroom_name, computer_name);
Q_EMIT signal_BlockAutorization(false);
//Q_EMIT signal_BlockAutorization(false);
mtxAccess.unlock();
return res;
@@ -84,11 +84,11 @@ bool ProviderDBLMS::deAuthorizationTrainee(QString login)
return false;
}
Q_EMIT signal_BlockAutorization(true);
//Q_EMIT signal_BlockAutorization(true);
bool res = dbLMS->deAuthorizationTrainee(login);
Q_EMIT signal_BlockAutorization(false);
//Q_EMIT signal_BlockAutorization(false);
mtxAccess.unlock();
return res;
@@ -120,11 +120,11 @@ bool ProviderDBLMS::authorizationInstructor(QString login, QString password)
return false;
}
Q_EMIT signal_BlockAutorization(true);
//Q_EMIT signal_BlockAutorization(true);
bool res = dbLMS->authorizationInstructor(login, password);
Q_EMIT signal_BlockAutorization(false);
//Q_EMIT signal_BlockAutorization(false);
mtxAccess.unlock();
return res;
@@ -140,11 +140,11 @@ bool ProviderDBLMS::deAuthorizationInstructor(QString login)
return false;
}
Q_EMIT signal_BlockAutorization(true);
//Q_EMIT signal_BlockAutorization(true);
bool res = dbLMS->deAuthorizationInstructor(login);
Q_EMIT signal_BlockAutorization(false);
//Q_EMIT signal_BlockAutorization(false);
mtxAccess.unlock();
return res;

View File

@@ -7,5 +7,10 @@
<file>resources/icons/switchOn.png</file>
<file>resources/blankXML/ListTasksAMM.xml</file>
<file>resources/blankXML/ListTasksFIM.xml</file>
<file>resources/icons/circleGreen.png</file>
<file>resources/icons/circleRed.png</file>
<file>resources/icons/lock.png</file>
<file>resources/icons/unlock.png</file>
<file>resources/icons/open.png</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -122,9 +122,15 @@ void ServerLMSWidget::addToLog(QString message)
void ServerLMSWidget::slot_BlockAutorization(bool block)
{
if(block)
{
server->blockAutorization();
ui->lblBlockAuth->setPixmap(QPixmap(QStringLiteral(":/resources/icons/lock.png")));
}
else
{
server->unBlockAutorization();
ui->lblBlockAuth->setPixmap(QPixmap(QStringLiteral(":/resources/icons/open.png")));
}
}
void ServerLMSWidget::slot_LanguageChanged(QString language)
@@ -153,6 +159,7 @@ void ServerLMSWidget::on_btnStopServer_clicked()
ui->btnStopServer->setEnabled(false);
ui->btnStartServer->setEnabled(true);
ui->lblOnOff->setPixmap(QPixmap(QStringLiteral(":/resources/icons/switchOff.png")));
slot_BlockAutorization(false);
}
}

View File

@@ -85,38 +85,6 @@
</item>
<item row="4" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="lblOnOff">
<property name="maximumSize">
<size>
<width>40</width>
<height>40</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="resources.qrc">:/resources/icons/switchOff.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<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="btnStartServer">
<property name="minimumSize">
@@ -173,6 +141,80 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblOnOff">
<property name="maximumSize">
<size>
<width>40</width>
<height>40</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="resources.qrc">:/resources/icons/switchOff.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<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>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Block Authorization</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblBlockAuth">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<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">:/resources/icons/open.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>