mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-27 19:45:43 +03:00
feat: add versionChanger for GUI
This commit is contained in:
37
InstructorsAndTrainees/widgets/newversionwidget.cpp
Normal file
37
InstructorsAndTrainees/widgets/newversionwidget.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
#include "newversionwidget.h"
|
||||
#include "ui_newversionwidget.h"
|
||||
|
||||
NewVersionWidget::NewVersionWidget(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::NewVersionWidget)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowFlags(Qt::SubWindow);
|
||||
setAttribute(Qt::WA_ShowModal,true);
|
||||
}
|
||||
|
||||
void NewVersionWidget::initialize(VersionSelectWidget *versionSelectWidget, QString prevName)
|
||||
{
|
||||
this->versionSelectWidget = versionSelectWidget;
|
||||
ui->prevVerValue->setText(prevName);
|
||||
}
|
||||
|
||||
|
||||
void NewVersionWidget::on_createButton_clicked()
|
||||
{
|
||||
if(ui->lineEdit->text() != "")
|
||||
{
|
||||
versionSelectWidget->sendCopyEmit(ui->lineEdit->text());
|
||||
hide();
|
||||
}
|
||||
}
|
||||
|
||||
void NewVersionWidget::on_cancelButton_clicked()
|
||||
{
|
||||
hide();
|
||||
}
|
||||
|
||||
NewVersionWidget::~NewVersionWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
31
InstructorsAndTrainees/widgets/newversionwidget.h
Normal file
31
InstructorsAndTrainees/widgets/newversionwidget.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef NEWVERSIONWIDGET_H
|
||||
#define NEWVERSIONWIDGET_H
|
||||
|
||||
#include <Widgets/versionselectwidget.h>
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
class NewVersionWidget;
|
||||
}
|
||||
|
||||
class VersionSelectWidget;
|
||||
class NewVersionWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit NewVersionWidget(QWidget *parent = nullptr);
|
||||
void initialize(VersionSelectWidget *versionSelectWidget,QString prevName);
|
||||
~NewVersionWidget();
|
||||
|
||||
private slots:
|
||||
void on_createButton_clicked();
|
||||
|
||||
void on_cancelButton_clicked();
|
||||
|
||||
private:
|
||||
Ui::NewVersionWidget *ui;
|
||||
VersionSelectWidget *versionSelectWidget;
|
||||
};
|
||||
|
||||
#endif // NEWVERSIONWIDGET_H
|
||||
219
InstructorsAndTrainees/widgets/newversionwidget.ui
Normal file
219
InstructorsAndTrainees/widgets/newversionwidget.ui
Normal file
@@ -0,0 +1,219 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>NewVersionWidget</class>
|
||||
<widget class="QWidget" name="NewVersionWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>325</width>
|
||||
<height>200</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Создать копию...</string>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QFrame" name="NewVerBackground">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="baseVerLayout">
|
||||
<property name="leftMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="prevVerTitle">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Базовая версия:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="prevVerValue">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="newNameLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="newNameVersionTitle">
|
||||
<property name="text">
|
||||
<string>Новое название:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>60</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Minimum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="createButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Создать</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Minimum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="cancelButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Отмена</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Minimum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
107
InstructorsAndTrainees/widgets/versionselectwidget.cpp
Normal file
107
InstructorsAndTrainees/widgets/versionselectwidget.cpp
Normal file
@@ -0,0 +1,107 @@
|
||||
#include "versionselectwidget.h"
|
||||
#include "ui_versionselectwidget.h"
|
||||
#include "ui_versionselectwidget.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
VersionSelectWidget::VersionSelectWidget(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::VersionSelectWidget),
|
||||
selectedVersion(nullptr)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowFlags(Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint);
|
||||
setAttribute(Qt::WA_ShowModal,true);
|
||||
}
|
||||
|
||||
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();
|
||||
setWindowTitle(tr("Управление версиями"));
|
||||
}
|
||||
|
||||
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(this,selectedVersion->getViewName());
|
||||
newVersionWidget->show();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
50
InstructorsAndTrainees/widgets/versionselectwidget.h
Normal file
50
InstructorsAndTrainees/widgets/versionselectwidget.h
Normal file
@@ -0,0 +1,50 @@
|
||||
#ifndef VERSIONSELECTWIDGET_H
|
||||
#define VERSIONSELECTWIDGET_H
|
||||
|
||||
#include <QListWidget>
|
||||
#include <QWidget>
|
||||
|
||||
#include <Core/sendsystem.h>
|
||||
#include <Core/versioncontainer.h>
|
||||
#include <Core/notifycontroller.h>
|
||||
#include <streamingversiondata.h>
|
||||
#include <Widgets/newversionwidget.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);
|
||||
void sendCopyEmit(QString newName);
|
||||
|
||||
~VersionSelectWidget();
|
||||
private slots:
|
||||
void on_verListView_itemDoubleClicked(QListWidgetItem *item);
|
||||
void on_createDuplicateButton_clicked();
|
||||
void on_DeleteVersionButton_clicked();
|
||||
void on_switchServerVersionButton_clicked();
|
||||
|
||||
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
|
||||
239
InstructorsAndTrainees/widgets/versionselectwidget.ui
Normal file
239
InstructorsAndTrainees/widgets/versionselectwidget.ui
Normal file
@@ -0,0 +1,239 @@
|
||||
<?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>606</width>
|
||||
<height>229</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<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">
|
||||
<property name="leftMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<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>601</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="ButtonLayout" stretch="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="leftMargin">
|
||||
<number>5</number>
|
||||
</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>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="verticalLayoutWidget_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>310</x>
|
||||
<y>0</y>
|
||||
<width>291</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>291</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>
|
||||
35
InstructorsAndTrainees/widgets/waitanimationwidget.cpp
Normal file
35
InstructorsAndTrainees/widgets/waitanimationwidget.cpp
Normal file
@@ -0,0 +1,35 @@
|
||||
#include "waitanimationwidget.h"
|
||||
#include "ui_waitanimationwidget.h"
|
||||
|
||||
WaitAnimationWidget::WaitAnimationWidget(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::WaitAnimationWidget),
|
||||
loadingMovie(nullptr)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
void WaitAnimationWidget::initialize(QMovie *movie,QWidget *parent)
|
||||
{
|
||||
ui->MovieLabel->setMovie(movie);
|
||||
loadingMovie = movie;
|
||||
setFixedSize(parent->width(),parent->height());
|
||||
hide();
|
||||
}
|
||||
|
||||
void WaitAnimationWidget::showWithPlay()
|
||||
{
|
||||
show();
|
||||
loadingMovie->start();
|
||||
}
|
||||
|
||||
void WaitAnimationWidget::hideWithStop()
|
||||
{
|
||||
hide();
|
||||
loadingMovie->stop();
|
||||
}
|
||||
|
||||
WaitAnimationWidget::~WaitAnimationWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
27
InstructorsAndTrainees/widgets/waitanimationwidget.h
Normal file
27
InstructorsAndTrainees/widgets/waitanimationwidget.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef WAITANIMATIONWIDGET_H
|
||||
#define WAITANIMATIONWIDGET_H
|
||||
|
||||
#include <QMovie>
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
class WaitAnimationWidget;
|
||||
}
|
||||
|
||||
class WaitAnimationWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit WaitAnimationWidget(QWidget *parent = nullptr);
|
||||
void initialize(QMovie *movie,QWidget *parent);
|
||||
void showWithPlay();
|
||||
void hideWithStop();
|
||||
~WaitAnimationWidget();
|
||||
|
||||
private:
|
||||
Ui::WaitAnimationWidget *ui;
|
||||
QMovie *loadingMovie;
|
||||
};
|
||||
|
||||
#endif // WAITANIMATIONWIDGET_H
|
||||
73
InstructorsAndTrainees/widgets/waitanimationwidget.ui
Normal file
73
InstructorsAndTrainees/widgets/waitanimationwidget.ui
Normal file
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>WaitAnimationWidget</class>
|
||||
<widget class="QWidget" name="WaitAnimationWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>635</width>
|
||||
<height>293</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>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color:rgba(0,0,0,50%);</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="mainLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="MovieLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color:rgba(0,0,0,50%)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../resources.qrc">:/resources/icons/762.gif</pixmap>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../resources.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
Reference in New Issue
Block a user