Улучшил индикацию

This commit is contained in:
krivoshein
2024-11-28 12:03:36 +03:00
parent f98b2e2beb
commit 7011ed1fe8
30 changed files with 639 additions and 317 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -3,5 +3,7 @@
<file>icons/instructor.png</file>
<file>icons/instructorAdmin.png</file>
<file>icons/trainee.png</file>
<file>icons/switchOff.png</file>
<file>icons/switchOn.png</file>
</qresource>
</RCC>

View File

@@ -25,6 +25,9 @@ ServerLMSWidget::ServerLMSWidget(InstructorsAndTraineesWidget* instructorsAndTra
{
ui->setupUi(this);
ui->btnStopServer->setEnabled(false);
ui->btnStartServer->setEnabled(true);
// Сделаем первоначальную инициализацию перевода для окна виджета
qtLanguageTranslator.load(QString("translations/ServerLMS_") + QString("ru_RU"), ".");
qApp->installTranslator(&qtLanguageTranslator);
@@ -67,7 +70,7 @@ ServerLMSWidget::ServerLMSWidget(InstructorsAndTraineesWidget* instructorsAndTra
connect(processingSystem,&ProcessingSystem::sigAddToMessanger,this,&ServerLMSWidget::slotAddToMessanger,Qt::QueuedConnection);
connect(this,&ServerLMSWidget::sigLog,logger,&Logger::addTextToLogger);
startServer();
on_btnStartServer_clicked();
first = true;
qDebug() << "WidgetThread: " << QThread::currentThreadId();
@@ -250,13 +253,26 @@ void ServerLMSWidget::slotAddToLog(QString msg)
void ServerLMSWidget::on_btnStartServer_clicked()
{
startServer();
updateController->calculateHash();
if(startServer())
{
QApplication::setOverrideCursor(Qt::WaitCursor);
updateController->calculateHash();
QApplication::restoreOverrideCursor();
ui->btnStartServer->setEnabled(false);
ui->btnStopServer->setEnabled(true);
ui->lblOnOff->setPixmap(QPixmap(QStringLiteral(":/icons/switchOn.png")));
}
}
void ServerLMSWidget::on_btnStopServer_clicked()
{
stopServer();
if(stopServer())
{
ui->btnStopServer->setEnabled(false);
ui->btnStartServer->setEnabled(true);
ui->lblOnOff->setPixmap(QPixmap(QStringLiteral(":/icons/switchOff.png")));
}
}
void ServerLMSWidget::on_btnTaskSet_clicked()

View File

@@ -94,6 +94,25 @@
</item>
<item row="5" 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">:/icons/switchOff.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
@@ -199,6 +218,8 @@
</item>
</layout>
</widget>
<resources/>
<resources>
<include location="resources.qrc"/>
</resources>
<connections/>
</ui>