diff --git a/StaticData/authData.xml b/StaticData/authData.xml
index 9429aff..4032548 100644
--- a/StaticData/authData.xml
+++ b/StaticData/authData.xml
@@ -1,2 +1,2 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/StaticData/settings.xml b/StaticData/settings.xml
index fe7e40f..b8b9e7d 100644
--- a/StaticData/settings.xml
+++ b/StaticData/settings.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/StaticData/temp.xml b/StaticData/temp.xml
index ed93f70..d67ab92 100644
--- a/StaticData/temp.xml
+++ b/StaticData/temp.xml
@@ -1,2 +1,2 @@
-
+
diff --git a/Widgets/updatenotifywidget.cpp b/Widgets/updatenotifywidget.cpp
index d0da5b0..757626e 100644
--- a/Widgets/updatenotifywidget.cpp
+++ b/Widgets/updatenotifywidget.cpp
@@ -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;
diff --git a/Widgets/updatenotifywidget.h b/Widgets/updatenotifywidget.h
index 49e8a4d..47d8bec 100644
--- a/Widgets/updatenotifywidget.h
+++ b/Widgets/updatenotifywidget.h
@@ -44,6 +44,7 @@ private:
VersionContainer *versionContainer;
int currentLoadingCount;
QLabel* createLabel(QString text);
+ void clearList();
};
#endif // UPDATENOTIFYWIDGET_H
diff --git a/debug/RRJClient.exe b/debug/RRJClient.exe
index eebf88d..5670448 100644
Binary files a/debug/RRJClient.exe and b/debug/RRJClient.exe differ
diff --git a/debug/mainwindow.o b/debug/mainwindow.o
index ef2f767..8b94717 100644
Binary files a/debug/mainwindow.o and b/debug/mainwindow.o differ
diff --git a/debug/moc_updatenotifywidget.o b/debug/moc_updatenotifywidget.o
index 0b31bda..ef08d1d 100644
Binary files a/debug/moc_updatenotifywidget.o and b/debug/moc_updatenotifywidget.o differ
diff --git a/debug/mywinheader.o b/debug/mywinheader.o
index 40af2a8..d18b7f3 100644
Binary files a/debug/mywinheader.o and b/debug/mywinheader.o differ
diff --git a/debug/updatenotifywidget.o b/debug/updatenotifywidget.o
index 350aaa1..3ab686c 100644
Binary files a/debug/updatenotifywidget.o and b/debug/updatenotifywidget.o differ
diff --git a/mainwindow.cpp b/mainwindow.cpp
index 4a8233a..03ddba8 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -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,12 +184,12 @@ 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();
}
}
-void MainWindow::showServerListWidget(QList *serverData)
+void MainWindow:: showServerListWidget(QList *serverData)
{
entryWidget->hide();
activateLoadingAnimation(false);
@@ -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()
diff --git a/mainwindow.ui b/mainwindow.ui
index deed7fa..d04cf5c 100644
--- a/mainwindow.ui
+++ b/mainwindow.ui
@@ -469,7 +469,7 @@
10
480
- 531
+ 511
61
@@ -512,9 +512,9 @@
- 740
+ 697
50
- 41
+ 91
42
@@ -568,6 +568,92 @@
+
+
+
+ 540
+ 459
+ 251
+ 81
+
+
+
+
+ 5
+
+
+ 0
+
+ -
+
+
-
+
+
+ Версия:
+
+
+
+ -
+
+
+ value
+
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+ -
+
+
-
+
+
+ Сервер:
+
+
+
+ -
+
+
+ value
+
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+
+
mainFrame
notificationLabel
headerWidget
@@ -577,6 +663,7 @@
verticalLayoutWidget_3
horizontalLayoutWidget
LanguageWidget
+ versionLayoutWidget
diff --git a/mywinheader.cpp b/mywinheader.cpp
index dfc39eb..86315f6 100644
--- a/mywinheader.cpp
+++ b/mywinheader.cpp
@@ -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();
-}
diff --git a/ui_mainwindow.h b/ui_mainwindow.h
index 7e2fdba..ac38d6f 100644
--- a/ui_mainwindow.h
+++ b/ui_mainwindow.h
@@ -18,6 +18,7 @@
#include
#include
#include
+#include
#include
#include
#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
};