mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJClient.git
synced 2026-03-28 05:25:39 +03:00
ref: change initialize logic
*complete without change animation
This commit is contained in:
@@ -8,18 +8,14 @@ CommonButtonGroupWidget::CommonButtonGroupWidget(QWidget *parent) :
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
void CommonButtonGroupWidget::initialize(ExternalExecuter *extExec,SendSystem *sendSystem)
|
||||
void CommonButtonGroupWidget::initialize()
|
||||
{
|
||||
externalExecuter = extExec;
|
||||
this->sendSystem = sendSystem;
|
||||
ui->loadingProgressBar->setValue(0);
|
||||
ui->loadingProgressBar->hide();
|
||||
ui->updateButton->hide();
|
||||
ui->startButton->hide();
|
||||
ui->startButton->setEnabled(false);
|
||||
|
||||
connect(this,&CommonButtonGroupWidget::sigSendPacket,sendSystem,&SendSystem::sendPacketType,Qt::AutoConnection);
|
||||
connect(this,&CommonButtonGroupWidget::sigSendXMLAnswer,sendSystem,&SendSystem::xmlAnswer,Qt::AutoConnection);
|
||||
ui->startButton->setEnabled(false);
|
||||
show();
|
||||
}
|
||||
|
||||
void CommonButtonGroupWidget::updateProgressBar(float value)
|
||||
@@ -41,6 +37,7 @@ void CommonButtonGroupWidget::lastVerInstalledState()
|
||||
show();
|
||||
ui->updateButton->hide();
|
||||
ui->loadingProgressBar->hide();
|
||||
ui->startButton->setEnabled(true);
|
||||
ui->startButton->show();
|
||||
}
|
||||
|
||||
@@ -88,8 +85,7 @@ void CommonButtonGroupWidget::on_updateButton_clicked()
|
||||
|
||||
void CommonButtonGroupWidget::on_startButton_clicked()
|
||||
{
|
||||
externalExecuter->callApp();
|
||||
emit sigSendXMLAnswer(cmd_Disable);
|
||||
emit sigStartUnityClient();
|
||||
}
|
||||
|
||||
CommonButtonGroupWidget::~CommonButtonGroupWidget()
|
||||
|
||||
@@ -8,17 +8,13 @@ namespace Ui {
|
||||
class CommonButtonGroupWidget;
|
||||
}
|
||||
|
||||
class TCPClient;
|
||||
class ExternalExecuter;
|
||||
class SendSystem;
|
||||
|
||||
class CommonButtonGroupWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit CommonButtonGroupWidget(QWidget *parent = nullptr);
|
||||
void initialize(ExternalExecuter *extExec,SendSystem *sendSystem);
|
||||
void initialize();
|
||||
void loadCompleteState();
|
||||
void lastVerInstalledState();
|
||||
void disconnectState();
|
||||
@@ -32,6 +28,7 @@ signals:
|
||||
void sigSendPacket(PacketType packet);
|
||||
void sigSendXMLAnswer(QString answer);
|
||||
void sigUpdateCommonWidget();
|
||||
void sigStartUnityClient();
|
||||
|
||||
private slots:
|
||||
void on_updateButton_clicked();
|
||||
@@ -42,8 +39,6 @@ public:
|
||||
|
||||
private:
|
||||
Ui::CommonButtonGroupWidget *ui;
|
||||
ExternalExecuter *externalExecuter;
|
||||
SendSystem *sendSystem;
|
||||
};
|
||||
|
||||
#endif // COMMONBUTTONGROUPWIDGET_H
|
||||
|
||||
@@ -12,9 +12,8 @@ UpdateNotifyWidget::UpdateNotifyWidget(QWidget *) :
|
||||
// setAttribute(Qt::WA_ShowModal,true);
|
||||
}
|
||||
|
||||
void UpdateNotifyWidget::initialize(VersionContainer *verContainer,QPoint startPos)
|
||||
void UpdateNotifyWidget::initialize(QPoint startPos)
|
||||
{
|
||||
this->versionContainer = verContainer;
|
||||
currentLoadingCount = 0;
|
||||
hide();
|
||||
|
||||
@@ -23,6 +22,11 @@ void UpdateNotifyWidget::initialize(VersionContainer *verContainer,QPoint startP
|
||||
move(pos);
|
||||
}
|
||||
|
||||
void UpdateNotifyWidget::setVersionContainer(VersionContainer *versionContainer)
|
||||
{
|
||||
this->versionContainer = versionContainer;
|
||||
}
|
||||
|
||||
void UpdateNotifyWidget::addToList(FileData fileData)
|
||||
{
|
||||
QString itemName = fileData.path;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
namespace Ui {
|
||||
class UpdateNotifyWidget;
|
||||
}
|
||||
class InstructorButtonGroupWidget;
|
||||
|
||||
|
||||
class UpdateNotifyWidget : public QWidget
|
||||
{
|
||||
@@ -19,14 +19,14 @@ class UpdateNotifyWidget : public QWidget
|
||||
|
||||
public:
|
||||
explicit UpdateNotifyWidget(QWidget *parent = nullptr);
|
||||
void initialize(VersionContainer *versionContainer,QPoint startPos);
|
||||
void initialize(QPoint startPos);
|
||||
void addToList(FileData fileData);
|
||||
void showWithFill();
|
||||
|
||||
~UpdateNotifyWidget();
|
||||
|
||||
void showTryChangeBase();
|
||||
|
||||
void setVersionContainer(VersionContainer *versionContainer);
|
||||
signals:
|
||||
void sigLoadToServerBehaviour();
|
||||
void sigUndoCurrentChanges();
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
#include "versionselectwidget.h"
|
||||
#include "ui_versionselectwidget.h"
|
||||
#include "Widgets/newversionwidget.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
VersionSelectWidget::VersionSelectWidget(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::VersionSelectWidget),
|
||||
selectedVersion(nullptr)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
void VersionSelectWidget::initialize(SendSystem *sendSystem,VersionContainer *versionContainer,NotifyController *notifyController)
|
||||
{
|
||||
connect(this,&VersionSelectWidget::sigSendSwitchVersion,sendSystem,&SendSystem::sendChangeVersion,Qt::AutoConnection);
|
||||
connect(this,&VersionSelectWidget::sigSendCopyVersion,sendSystem,&SendSystem::sendCopyVersion,Qt::AutoConnection);
|
||||
connect(this,&VersionSelectWidget::sigSendDeleteVersion,sendSystem,&SendSystem::sendDeleteVersion,Qt::AutoConnection);
|
||||
connect(this,&VersionSelectWidget::sigSendNotify,notifyController,&NotifyController::showWarning,Qt::AutoConnection);
|
||||
this->versionContainer = versionContainer;
|
||||
hide();
|
||||
}
|
||||
|
||||
void VersionSelectWidget::fillView(QList<StreamingVersionData *> *serverData)
|
||||
{
|
||||
show();
|
||||
ui->verListView->clear();
|
||||
serverDataList = serverData;
|
||||
ui->verValue->setText(versionContainer->getServerVersionData()->getViewName());
|
||||
|
||||
foreach(StreamingVersionData *data,*serverData)
|
||||
{
|
||||
ui->verListView->addItem(data->getViewName());
|
||||
}
|
||||
}
|
||||
|
||||
void VersionSelectWidget::on_verListView_itemDoubleClicked(QListWidgetItem *item)
|
||||
{
|
||||
foreach(StreamingVersionData *data,*serverDataList)
|
||||
{
|
||||
if(data->getViewName() == item->text())
|
||||
{
|
||||
QString info = "Имя версии: " + data->getViewName() + "\n";
|
||||
info.append("Создан: " + data->getCreateData().toString());
|
||||
ui->infoValue->setText(info);
|
||||
selectedVersion = data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void VersionSelectWidget::on_createDuplicateButton_clicked()
|
||||
{
|
||||
NewVersionWidget *newVersionWidget = new NewVersionWidget;
|
||||
newVersionWidget->initialize(selectedVersion->getViewName());
|
||||
newVersionWidget->show();
|
||||
|
||||
connect(newVersionWidget,&NewVersionWidget::sigSendCopy,this,&VersionSelectWidget::sendCopyEmit);
|
||||
}
|
||||
|
||||
void VersionSelectWidget::sendCopyEmit(QString newName)
|
||||
{
|
||||
QString result = selectedVersion->getViewName() + ";" + newName;
|
||||
|
||||
if (selectedVersion == nullptr)
|
||||
{
|
||||
sigSendNotify(tr("Версия не выбрана"));
|
||||
return;
|
||||
}
|
||||
|
||||
//versionContainer->setLocalVersionData(selectedVersion);
|
||||
emit sigSendCopyVersion(result);
|
||||
}
|
||||
|
||||
void VersionSelectWidget::on_DeleteVersionButton_clicked()
|
||||
{
|
||||
if (selectedVersion == nullptr)
|
||||
{
|
||||
sigSendNotify(tr("Версия не выбрана"));
|
||||
return;
|
||||
}
|
||||
|
||||
emit sigSendDeleteVersion(selectedVersion);
|
||||
}
|
||||
|
||||
void VersionSelectWidget::on_switchServerVersionButton_clicked()
|
||||
{
|
||||
if (selectedVersion == nullptr)
|
||||
{
|
||||
sigSendNotify(tr("Версия не выбрана"));
|
||||
return;
|
||||
}
|
||||
|
||||
versionContainer->setServerVersionData(selectedVersion);
|
||||
ui->verValue->setText(selectedVersion->getViewName());
|
||||
emit sigSendSwitchVersion(selectedVersion);
|
||||
}
|
||||
|
||||
|
||||
|
||||
VersionSelectWidget::~VersionSelectWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
#ifndef VERSIONSELECTWIDGET_H
|
||||
#define VERSIONSELECTWIDGET_H
|
||||
|
||||
#include <QListWidget>
|
||||
#include <QWidget>
|
||||
|
||||
#include <Core/notifycontroller.h>
|
||||
#include <Core/sendsystem.h>
|
||||
#include <Core/versioncontainer.h>
|
||||
#include <Data/streamingversiondata.h>
|
||||
namespace Ui {
|
||||
class VersionSelectWidget;
|
||||
}
|
||||
|
||||
class VersionSelectWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit VersionSelectWidget(QWidget *parent = nullptr);
|
||||
|
||||
void initialize(SendSystem *sendSystem,VersionContainer *versionContainer,NotifyController *notifyController);
|
||||
void fillView(QList<StreamingVersionData*> *serverData);
|
||||
|
||||
~VersionSelectWidget();
|
||||
private slots:
|
||||
void on_verListView_itemDoubleClicked(QListWidgetItem *item);
|
||||
void on_createDuplicateButton_clicked();
|
||||
void on_DeleteVersionButton_clicked();
|
||||
void on_switchServerVersionButton_clicked();
|
||||
void sendCopyEmit(QString newName);
|
||||
|
||||
signals:
|
||||
void sigSendDeleteVersion(StreamingVersionData *streaming);
|
||||
void sigSendSwitchVersion(StreamingVersionData *selectVersion);
|
||||
void sigSendCopyVersion(QString versionPair);
|
||||
void sigSendNotify(QString message);
|
||||
|
||||
private:
|
||||
Ui::VersionSelectWidget *ui;
|
||||
SendSystem *sendSystem;
|
||||
QList<StreamingVersionData*> *serverDataList;
|
||||
VersionContainer *versionContainer;
|
||||
NotifyController *notifyController;
|
||||
StreamingVersionData *selectedVersion;
|
||||
};
|
||||
|
||||
#endif // VERSIONSELECTWIDGET_H
|
||||
@@ -1,240 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>VersionSelectWidget</class>
|
||||
<widget class="QWidget" name="VersionSelectWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>786</width>
|
||||
<height>229</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="verticalLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>301</width>
|
||||
<height>171</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="actualServerListLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="verListTitle">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Calibri</family>
|
||||
<pointsize>12</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::PreventContextMenu</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Доступные версии на сервере</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="verListView"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="horizontalLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>180</y>
|
||||
<width>781</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="ButtonLayout" stretch="0,0,0">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMinimumSize</enum>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="createDuplicateButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Создать копию</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="DeleteVersionButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="sizeIncrement">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Удалить</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="switchServerVersionButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Переключить версию сервера</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>170</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="verticalLayoutWidget_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>310</x>
|
||||
<y>0</y>
|
||||
<width>471</width>
|
||||
<height>131</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="infoViewTitle">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Информация:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="infoValue">
|
||||
<property name="text">
|
||||
<string>Тут будет информация о версии...</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="horizontalLayoutWidget_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>310</x>
|
||||
<y>140</y>
|
||||
<width>471</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="ServerInfoLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="verTitle">
|
||||
<property name="text">
|
||||
<string>Текущая версия сервера:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="verValue">
|
||||
<property name="text">
|
||||
<string>none</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -9,10 +9,16 @@ WaitAnimationWidget::WaitAnimationWidget(QWidget *parent) :
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
void WaitAnimationWidget::setMovie(QMovie *movie)
|
||||
void WaitAnimationWidget::initialize(ResourceManager *resourceManager)
|
||||
{
|
||||
ui->MovieLabel->setMovie(movie);
|
||||
loadingMovie = movie;
|
||||
loadingMovie = resourceManager->getMovie();
|
||||
ui->MovieLabel->setMovie(loadingMovie);
|
||||
}
|
||||
|
||||
void WaitAnimationWidget::slotActivateLoadingAnimation(bool flag)
|
||||
{
|
||||
if (flag)showWithPlay();
|
||||
else hideWithStop();
|
||||
}
|
||||
|
||||
void WaitAnimationWidget::showWithPlay()
|
||||
@@ -31,3 +37,5 @@ WaitAnimationWidget::~WaitAnimationWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <QMovie>
|
||||
#include <QWidget>
|
||||
#include <UI/resourcemanager.h>
|
||||
|
||||
namespace Ui {
|
||||
class WaitAnimationWidget;
|
||||
@@ -14,11 +15,14 @@ class WaitAnimationWidget : public QWidget
|
||||
|
||||
public:
|
||||
explicit WaitAnimationWidget(QWidget *parent = nullptr);
|
||||
void setMovie(QMovie *movie);
|
||||
void initialize(ResourceManager *resourceManager);
|
||||
void showWithPlay();
|
||||
void hideWithStop();
|
||||
~WaitAnimationWidget();
|
||||
|
||||
public slots:
|
||||
void slotActivateLoadingAnimation(bool flag);
|
||||
|
||||
private:
|
||||
Ui::WaitAnimationWidget *ui;
|
||||
QMovie *loadingMovie;
|
||||
|
||||
Reference in New Issue
Block a user