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"?>
|
||||
<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'?>
|
||||
<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"/>
|
||||
</ServerSettingsContainer>
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
<?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()
|
||||
{
|
||||
clearList();
|
||||
|
||||
if(versionContainer->getServerVersion() == baseNamePackage)
|
||||
{
|
||||
@@ -70,6 +71,15 @@ void UpdateNotifyWidget::showWithFill()
|
||||
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 *label = new QLabel;
|
||||
|
||||
@@ -44,6 +44,7 @@ private:
|
||||
VersionContainer *versionContainer;
|
||||
int currentLoadingCount;
|
||||
QLabel* createLabel(QString text);
|
||||
void clearList();
|
||||
};
|
||||
|
||||
#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();
|
||||
|
||||
//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);
|
||||
ui->autostartCheckBox->show();
|
||||
activateLoadingAnimation(false);
|
||||
setTitle();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -180,8 +184,8 @@ void MainWindow::setNeedUpdate(bool flag,quint64 size, quint64 fileCount,quint64
|
||||
ui->unsafeChangingButton->hide();
|
||||
ui->offlineStartButton->setEnabled(true);
|
||||
dataParser->changeVersion(versionContainer->getServerVersion());
|
||||
setTitle();
|
||||
activateLoadingAnimation(false);
|
||||
setTitle();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -230,6 +234,7 @@ void MainWindow::checkLoginResult(ServerAuthorization *serverAuth)
|
||||
ui->settingsButton->hide();
|
||||
ui->offlineStartButton->show();
|
||||
activateLoadingAnimation(true);
|
||||
setTitle();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -278,14 +283,15 @@ void MainWindow::autoStart()
|
||||
|
||||
void MainWindow::setTitle()
|
||||
{
|
||||
ui->versionLayoutWidget->show();
|
||||
ServerSettings *currentSettings = dataParser->getServerSettings();
|
||||
StreamingVersionData *versionData = new StreamingVersionData;
|
||||
versionData->setName(currentSettings->LocalVersionName);
|
||||
|
||||
QString title = tr("Тренажер процедур технического обслуживания самолета RRJ-95NEW-100");
|
||||
title.append(" (" + currentSettings->LocalVersionName + ")");
|
||||
ui->headerLabel->setText(title);
|
||||
versionContainer->setLocalVersionData(versionData);
|
||||
|
||||
ui->valueClientVersion->setText(versionContainer->getLocalVersion());
|
||||
ui->valueServerVersion->setText(versionContainer->getServerVersionData()->getViewName());
|
||||
//title.append(" (" + currentSettings->LocalVersionName + ")");
|
||||
}
|
||||
|
||||
void MainWindow::loadStaticData()
|
||||
@@ -297,7 +303,6 @@ void MainWindow::loadStaticData()
|
||||
ui->autostartCheckBox->setChecked(currentSettings->isAutoStart);
|
||||
|
||||
checkLanguage(currentSettings->Language);
|
||||
setTitle();
|
||||
}
|
||||
|
||||
void MainWindow::showConnectionEmpty()
|
||||
|
||||
@@ -469,7 +469,7 @@
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>480</y>
|
||||
<width>531</width>
|
||||
<width>511</width>
|
||||
<height>61</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -512,9 +512,9 @@
|
||||
<widget class="QWidget" name="horizontalLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>740</x>
|
||||
<x>697</x>
|
||||
<y>50</y>
|
||||
<width>41</width>
|
||||
<width>91</width>
|
||||
<height>42</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -568,6 +568,92 @@
|
||||
</item>
|
||||
</layout>
|
||||
</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>notificationLabel</zorder>
|
||||
<zorder>headerWidget</zorder>
|
||||
@@ -577,6 +663,7 @@
|
||||
<zorder>verticalLayoutWidget_3</zorder>
|
||||
<zorder>horizontalLayoutWidget</zorder>
|
||||
<zorder>LanguageWidget</zorder>
|
||||
<zorder>versionLayoutWidget</zorder>
|
||||
</widget>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
|
||||
@@ -21,8 +21,3 @@ void MyWinHeader::mouseMoveEvent(QMouseEvent *event) {
|
||||
if(!isMousePressed) return;
|
||||
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/QMainWindow>
|
||||
#include <QtWidgets/QPushButton>
|
||||
#include <QtWidgets/QSpacerItem>
|
||||
#include <QtWidgets/QVBoxLayout>
|
||||
#include <QtWidgets/QWidget>
|
||||
#include "mywinheader.h"
|
||||
@@ -58,6 +59,16 @@ public:
|
||||
QHBoxLayout *additionalButtonLayout;
|
||||
QPushButton *unsafeChangingButton;
|
||||
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)
|
||||
{
|
||||
@@ -237,7 +248,7 @@ public:
|
||||
interactiveGroup->setContentsMargins(0, 0, 0, 0);
|
||||
verticalLayoutWidget_3 = new QWidget(centralwidget);
|
||||
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->setSpacing(3);
|
||||
verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
|
||||
@@ -258,7 +269,7 @@ public:
|
||||
|
||||
horizontalLayoutWidget = new QWidget(centralwidget);
|
||||
horizontalLayoutWidget->setObjectName(QString::fromUtf8("horizontalLayoutWidget"));
|
||||
horizontalLayoutWidget->setGeometry(QRect(740, 50, 41, 42));
|
||||
horizontalLayoutWidget->setGeometry(QRect(697, 50, 91, 42));
|
||||
additionalButtonLayout = new QHBoxLayout(horizontalLayoutWidget);
|
||||
additionalButtonLayout->setObjectName(QString::fromUtf8("additionalButtonLayout"));
|
||||
additionalButtonLayout->setContentsMargins(0, 0, 0, 0);
|
||||
@@ -280,6 +291,53 @@ public:
|
||||
|
||||
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);
|
||||
mainFrame->raise();
|
||||
notificationLabel->raise();
|
||||
@@ -290,6 +348,7 @@ public:
|
||||
verticalLayoutWidget_3->raise();
|
||||
horizontalLayoutWidget->raise();
|
||||
LanguageWidget->raise();
|
||||
versionLayoutWidget->raise();
|
||||
|
||||
retranslateUi(MainWindow);
|
||||
|
||||
@@ -312,6 +371,10 @@ public:
|
||||
inlineTextDebug->setText(QString());
|
||||
unsafeChangingButton->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
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user