mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJClient.git
synced 2026-03-28 05:25:39 +03:00
feat: add version check
This commit is contained in:
@@ -1,2 +1,2 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<AuthData Login="I1" Password="1111" InstructorName="Горинин Г.Г." ClientName="Горинин Г.Г." AccessType="instructor"/>
|
<AuthData Login="O1" Password="1111" InstructorName="" ClientName="Иванов И.И." AccessType="trainee"/>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<ServerSettingsContainer>
|
<ServerSettingsContainer>
|
||||||
<ServerSettings Port="6000" Language="RUS" AutoStart="0" Address="192.168.100.241"/>
|
<ServerSettings Language="RUS" Port="6000" Address="192.168.100.241" AutoStart="0"/>
|
||||||
<VersionData Version="modifyBase"/>
|
<VersionData Version="modifyBase"/>
|
||||||
</ServerSettingsContainer>
|
</ServerSettingsContainer>
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ClientNotify Code="CHECKVERSIONLIST"/>
|
<ClientAutorization Login="O1" Password="1111"/>
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ void UpdateNotifyWidget::addToList(FileData fileData)
|
|||||||
|
|
||||||
void UpdateNotifyWidget::showWithFill()
|
void UpdateNotifyWidget::showWithFill()
|
||||||
{
|
{
|
||||||
|
clearList();
|
||||||
|
|
||||||
if(versionContainer->getServerVersion() == baseNamePackage)
|
if(versionContainer->getServerVersion() == baseNamePackage)
|
||||||
{
|
{
|
||||||
@@ -70,6 +71,15 @@ void UpdateNotifyWidget::showWithFill()
|
|||||||
show();
|
show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UpdateNotifyWidget::clearList()
|
||||||
|
{
|
||||||
|
QLayoutItem* item;
|
||||||
|
while ( ( item = ui->labelsLayout->layout()->takeAt( 0 ) ) != NULL )
|
||||||
|
{
|
||||||
|
delete item->widget();
|
||||||
|
delete item;
|
||||||
|
}
|
||||||
|
}
|
||||||
QLabel* UpdateNotifyWidget::createLabel(QString text)
|
QLabel* UpdateNotifyWidget::createLabel(QString text)
|
||||||
{
|
{
|
||||||
QLabel *label = new QLabel;
|
QLabel *label = new QLabel;
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ private:
|
|||||||
VersionContainer *versionContainer;
|
VersionContainer *versionContainer;
|
||||||
int currentLoadingCount;
|
int currentLoadingCount;
|
||||||
QLabel* createLabel(QString text);
|
QLabel* createLabel(QString text);
|
||||||
|
void clearList();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // UPDATENOTIFYWIDGET_H
|
#endif // UPDATENOTIFYWIDGET_H
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -102,6 +102,9 @@ void MainWindow::initialize()
|
|||||||
checkAppAvailable();
|
checkAppAvailable();
|
||||||
|
|
||||||
//post
|
//post
|
||||||
|
QString title = tr("Тренажер процедур технического обслуживания самолета RRJ-95NEW-100");
|
||||||
|
ui->headerLabel->setText(title);
|
||||||
|
ui->versionLayoutWidget->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -171,6 +174,7 @@ void MainWindow::setNeedUpdate(bool flag,quint64 size, quint64 fileCount,quint64
|
|||||||
commonButtonGroupWidget->needUpdateState(flag);
|
commonButtonGroupWidget->needUpdateState(flag);
|
||||||
ui->autostartCheckBox->show();
|
ui->autostartCheckBox->show();
|
||||||
activateLoadingAnimation(false);
|
activateLoadingAnimation(false);
|
||||||
|
setTitle();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -180,12 +184,12 @@ void MainWindow::setNeedUpdate(bool flag,quint64 size, quint64 fileCount,quint64
|
|||||||
ui->unsafeChangingButton->hide();
|
ui->unsafeChangingButton->hide();
|
||||||
ui->offlineStartButton->setEnabled(true);
|
ui->offlineStartButton->setEnabled(true);
|
||||||
dataParser->changeVersion(versionContainer->getServerVersion());
|
dataParser->changeVersion(versionContainer->getServerVersion());
|
||||||
setTitle();
|
|
||||||
activateLoadingAnimation(false);
|
activateLoadingAnimation(false);
|
||||||
|
setTitle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::showServerListWidget(QList<StreamingVersionData *> *serverData)
|
void MainWindow:: showServerListWidget(QList<StreamingVersionData *> *serverData)
|
||||||
{
|
{
|
||||||
entryWidget->hide();
|
entryWidget->hide();
|
||||||
activateLoadingAnimation(false);
|
activateLoadingAnimation(false);
|
||||||
@@ -230,6 +234,7 @@ void MainWindow::checkLoginResult(ServerAuthorization *serverAuth)
|
|||||||
ui->settingsButton->hide();
|
ui->settingsButton->hide();
|
||||||
ui->offlineStartButton->show();
|
ui->offlineStartButton->show();
|
||||||
activateLoadingAnimation(true);
|
activateLoadingAnimation(true);
|
||||||
|
setTitle();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -278,14 +283,15 @@ void MainWindow::autoStart()
|
|||||||
|
|
||||||
void MainWindow::setTitle()
|
void MainWindow::setTitle()
|
||||||
{
|
{
|
||||||
|
ui->versionLayoutWidget->show();
|
||||||
ServerSettings *currentSettings = dataParser->getServerSettings();
|
ServerSettings *currentSettings = dataParser->getServerSettings();
|
||||||
StreamingVersionData *versionData = new StreamingVersionData;
|
StreamingVersionData *versionData = new StreamingVersionData;
|
||||||
versionData->setName(currentSettings->LocalVersionName);
|
versionData->setName(currentSettings->LocalVersionName);
|
||||||
|
|
||||||
QString title = tr("Тренажер процедур технического обслуживания самолета RRJ-95NEW-100");
|
|
||||||
title.append(" (" + currentSettings->LocalVersionName + ")");
|
|
||||||
ui->headerLabel->setText(title);
|
|
||||||
versionContainer->setLocalVersionData(versionData);
|
versionContainer->setLocalVersionData(versionData);
|
||||||
|
|
||||||
|
ui->valueClientVersion->setText(versionContainer->getLocalVersion());
|
||||||
|
ui->valueServerVersion->setText(versionContainer->getServerVersionData()->getViewName());
|
||||||
|
//title.append(" (" + currentSettings->LocalVersionName + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::loadStaticData()
|
void MainWindow::loadStaticData()
|
||||||
@@ -297,7 +303,6 @@ void MainWindow::loadStaticData()
|
|||||||
ui->autostartCheckBox->setChecked(currentSettings->isAutoStart);
|
ui->autostartCheckBox->setChecked(currentSettings->isAutoStart);
|
||||||
|
|
||||||
checkLanguage(currentSettings->Language);
|
checkLanguage(currentSettings->Language);
|
||||||
setTitle();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::showConnectionEmpty()
|
void MainWindow::showConnectionEmpty()
|
||||||
|
|||||||
@@ -469,7 +469,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>480</y>
|
<y>480</y>
|
||||||
<width>531</width>
|
<width>511</width>
|
||||||
<height>61</height>
|
<height>61</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@@ -512,9 +512,9 @@
|
|||||||
<widget class="QWidget" name="horizontalLayoutWidget">
|
<widget class="QWidget" name="horizontalLayoutWidget">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>740</x>
|
<x>697</x>
|
||||||
<y>50</y>
|
<y>50</y>
|
||||||
<width>41</width>
|
<width>91</width>
|
||||||
<height>42</height>
|
<height>42</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@@ -568,6 +568,92 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QWidget" name="versionLayoutWidget" native="true">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>540</x>
|
||||||
|
<y>459</y>
|
||||||
|
<width>251</width>
|
||||||
|
<height>81</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="versionLayout">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="textPairLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="titleClientVersion">
|
||||||
|
<property name="text">
|
||||||
|
<string>Версия:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="valueClientVersion">
|
||||||
|
<property name="text">
|
||||||
|
<string>value</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
|
</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>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="textPairLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="titleServerVersion">
|
||||||
|
<property name="text">
|
||||||
|
<string>Сервер:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="valueServerVersion">
|
||||||
|
<property name="text">
|
||||||
|
<string>value</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
<zorder>mainFrame</zorder>
|
<zorder>mainFrame</zorder>
|
||||||
<zorder>notificationLabel</zorder>
|
<zorder>notificationLabel</zorder>
|
||||||
<zorder>headerWidget</zorder>
|
<zorder>headerWidget</zorder>
|
||||||
@@ -577,6 +663,7 @@
|
|||||||
<zorder>verticalLayoutWidget_3</zorder>
|
<zorder>verticalLayoutWidget_3</zorder>
|
||||||
<zorder>horizontalLayoutWidget</zorder>
|
<zorder>horizontalLayoutWidget</zorder>
|
||||||
<zorder>LanguageWidget</zorder>
|
<zorder>LanguageWidget</zorder>
|
||||||
|
<zorder>versionLayoutWidget</zorder>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
|
|||||||
@@ -21,8 +21,3 @@ void MyWinHeader::mouseMoveEvent(QMouseEvent *event) {
|
|||||||
if(!isMousePressed) return;
|
if(!isMousePressed) return;
|
||||||
this->parentWidget()->window()->move(winX + event->globalX()-mouseX, winY + event->globalY()-mouseY);
|
this->parentWidget()->window()->move(winX + event->globalX()-mouseX, winY + event->globalY()-mouseY);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyWinHeader::changeText(QString *text){
|
|
||||||
setText(*text);
|
|
||||||
repaint();
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
#include <QtWidgets/QLabel>
|
#include <QtWidgets/QLabel>
|
||||||
#include <QtWidgets/QMainWindow>
|
#include <QtWidgets/QMainWindow>
|
||||||
#include <QtWidgets/QPushButton>
|
#include <QtWidgets/QPushButton>
|
||||||
|
#include <QtWidgets/QSpacerItem>
|
||||||
#include <QtWidgets/QVBoxLayout>
|
#include <QtWidgets/QVBoxLayout>
|
||||||
#include <QtWidgets/QWidget>
|
#include <QtWidgets/QWidget>
|
||||||
#include "mywinheader.h"
|
#include "mywinheader.h"
|
||||||
@@ -58,6 +59,16 @@ public:
|
|||||||
QHBoxLayout *additionalButtonLayout;
|
QHBoxLayout *additionalButtonLayout;
|
||||||
QPushButton *unsafeChangingButton;
|
QPushButton *unsafeChangingButton;
|
||||||
QPushButton *settingsButton;
|
QPushButton *settingsButton;
|
||||||
|
QWidget *versionLayoutWidget;
|
||||||
|
QVBoxLayout *versionLayout;
|
||||||
|
QHBoxLayout *textPairLayout;
|
||||||
|
QLabel *titleClientVersion;
|
||||||
|
QLabel *valueClientVersion;
|
||||||
|
QSpacerItem *horizontalSpacer;
|
||||||
|
QHBoxLayout *textPairLayout_2;
|
||||||
|
QLabel *titleServerVersion;
|
||||||
|
QLabel *valueServerVersion;
|
||||||
|
QSpacerItem *horizontalSpacer_2;
|
||||||
|
|
||||||
void setupUi(QMainWindow *MainWindow)
|
void setupUi(QMainWindow *MainWindow)
|
||||||
{
|
{
|
||||||
@@ -237,7 +248,7 @@ public:
|
|||||||
interactiveGroup->setContentsMargins(0, 0, 0, 0);
|
interactiveGroup->setContentsMargins(0, 0, 0, 0);
|
||||||
verticalLayoutWidget_3 = new QWidget(centralwidget);
|
verticalLayoutWidget_3 = new QWidget(centralwidget);
|
||||||
verticalLayoutWidget_3->setObjectName(QString::fromUtf8("verticalLayoutWidget_3"));
|
verticalLayoutWidget_3->setObjectName(QString::fromUtf8("verticalLayoutWidget_3"));
|
||||||
verticalLayoutWidget_3->setGeometry(QRect(10, 480, 531, 61));
|
verticalLayoutWidget_3->setGeometry(QRect(10, 480, 511, 61));
|
||||||
verticalLayout = new QVBoxLayout(verticalLayoutWidget_3);
|
verticalLayout = new QVBoxLayout(verticalLayoutWidget_3);
|
||||||
verticalLayout->setSpacing(3);
|
verticalLayout->setSpacing(3);
|
||||||
verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
|
verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
|
||||||
@@ -258,7 +269,7 @@ public:
|
|||||||
|
|
||||||
horizontalLayoutWidget = new QWidget(centralwidget);
|
horizontalLayoutWidget = new QWidget(centralwidget);
|
||||||
horizontalLayoutWidget->setObjectName(QString::fromUtf8("horizontalLayoutWidget"));
|
horizontalLayoutWidget->setObjectName(QString::fromUtf8("horizontalLayoutWidget"));
|
||||||
horizontalLayoutWidget->setGeometry(QRect(740, 50, 41, 42));
|
horizontalLayoutWidget->setGeometry(QRect(697, 50, 91, 42));
|
||||||
additionalButtonLayout = new QHBoxLayout(horizontalLayoutWidget);
|
additionalButtonLayout = new QHBoxLayout(horizontalLayoutWidget);
|
||||||
additionalButtonLayout->setObjectName(QString::fromUtf8("additionalButtonLayout"));
|
additionalButtonLayout->setObjectName(QString::fromUtf8("additionalButtonLayout"));
|
||||||
additionalButtonLayout->setContentsMargins(0, 0, 0, 0);
|
additionalButtonLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
@@ -280,6 +291,53 @@ public:
|
|||||||
|
|
||||||
additionalButtonLayout->addWidget(settingsButton);
|
additionalButtonLayout->addWidget(settingsButton);
|
||||||
|
|
||||||
|
versionLayoutWidget = new QWidget(centralwidget);
|
||||||
|
versionLayoutWidget->setObjectName(QString::fromUtf8("versionLayoutWidget"));
|
||||||
|
versionLayoutWidget->setGeometry(QRect(540, 459, 251, 81));
|
||||||
|
versionLayout = new QVBoxLayout(versionLayoutWidget);
|
||||||
|
versionLayout->setSpacing(5);
|
||||||
|
versionLayout->setObjectName(QString::fromUtf8("versionLayout"));
|
||||||
|
versionLayout->setContentsMargins(0, -1, -1, -1);
|
||||||
|
textPairLayout = new QHBoxLayout();
|
||||||
|
textPairLayout->setObjectName(QString::fromUtf8("textPairLayout"));
|
||||||
|
titleClientVersion = new QLabel(versionLayoutWidget);
|
||||||
|
titleClientVersion->setObjectName(QString::fromUtf8("titleClientVersion"));
|
||||||
|
|
||||||
|
textPairLayout->addWidget(titleClientVersion);
|
||||||
|
|
||||||
|
valueClientVersion = new QLabel(versionLayoutWidget);
|
||||||
|
valueClientVersion->setObjectName(QString::fromUtf8("valueClientVersion"));
|
||||||
|
valueClientVersion->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter);
|
||||||
|
|
||||||
|
textPairLayout->addWidget(valueClientVersion);
|
||||||
|
|
||||||
|
horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||||
|
|
||||||
|
textPairLayout->addItem(horizontalSpacer);
|
||||||
|
|
||||||
|
|
||||||
|
versionLayout->addLayout(textPairLayout);
|
||||||
|
|
||||||
|
textPairLayout_2 = new QHBoxLayout();
|
||||||
|
textPairLayout_2->setObjectName(QString::fromUtf8("textPairLayout_2"));
|
||||||
|
titleServerVersion = new QLabel(versionLayoutWidget);
|
||||||
|
titleServerVersion->setObjectName(QString::fromUtf8("titleServerVersion"));
|
||||||
|
|
||||||
|
textPairLayout_2->addWidget(titleServerVersion);
|
||||||
|
|
||||||
|
valueServerVersion = new QLabel(versionLayoutWidget);
|
||||||
|
valueServerVersion->setObjectName(QString::fromUtf8("valueServerVersion"));
|
||||||
|
valueServerVersion->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter);
|
||||||
|
|
||||||
|
textPairLayout_2->addWidget(valueServerVersion);
|
||||||
|
|
||||||
|
horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||||
|
|
||||||
|
textPairLayout_2->addItem(horizontalSpacer_2);
|
||||||
|
|
||||||
|
|
||||||
|
versionLayout->addLayout(textPairLayout_2);
|
||||||
|
|
||||||
MainWindow->setCentralWidget(centralwidget);
|
MainWindow->setCentralWidget(centralwidget);
|
||||||
mainFrame->raise();
|
mainFrame->raise();
|
||||||
notificationLabel->raise();
|
notificationLabel->raise();
|
||||||
@@ -290,6 +348,7 @@ public:
|
|||||||
verticalLayoutWidget_3->raise();
|
verticalLayoutWidget_3->raise();
|
||||||
horizontalLayoutWidget->raise();
|
horizontalLayoutWidget->raise();
|
||||||
LanguageWidget->raise();
|
LanguageWidget->raise();
|
||||||
|
versionLayoutWidget->raise();
|
||||||
|
|
||||||
retranslateUi(MainWindow);
|
retranslateUi(MainWindow);
|
||||||
|
|
||||||
@@ -312,6 +371,10 @@ public:
|
|||||||
inlineTextDebug->setText(QString());
|
inlineTextDebug->setText(QString());
|
||||||
unsafeChangingButton->setText(QString());
|
unsafeChangingButton->setText(QString());
|
||||||
settingsButton->setText(QString());
|
settingsButton->setText(QString());
|
||||||
|
titleClientVersion->setText(QCoreApplication::translate("MainWindow", "\320\222\320\265\321\200\321\201\320\270\321\217:", nullptr));
|
||||||
|
valueClientVersion->setText(QCoreApplication::translate("MainWindow", "value", nullptr));
|
||||||
|
titleServerVersion->setText(QCoreApplication::translate("MainWindow", "\320\241\320\265\321\200\320\262\320\265\321\200:", nullptr));
|
||||||
|
valueServerVersion->setText(QCoreApplication::translate("MainWindow", "value", nullptr));
|
||||||
} // retranslateUi
|
} // retranslateUi
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user