mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJClient.git
synced 2026-03-28 05:25:39 +03:00
ref: segregate systems, codestyle, busy message
This commit is contained in:
90
Widgets/updatenotifywidget.cpp
Normal file
90
Widgets/updatenotifywidget.cpp
Normal file
@@ -0,0 +1,90 @@
|
||||
#include "updatenotifywidget.h"
|
||||
#include "ui_updatenotifywidget.h"
|
||||
#include "mainwindow.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
UpdateNotifyWidget::UpdateNotifyWidget(QWidget *) :
|
||||
ui(new Ui::UpdateNotifyWidget)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
// setWindowFlag(Qt::FramelessWindowHint);
|
||||
// setAttribute(Qt::WA_ShowModal,true);
|
||||
}
|
||||
|
||||
void UpdateNotifyWidget::initialize(MainWindow *mainWindow,VersionContainer *verContainer)
|
||||
{
|
||||
this->mainWindow = mainWindow;
|
||||
this->versionContainer = verContainer;
|
||||
currentLoadingCount = 0;
|
||||
hide();
|
||||
|
||||
auto pos = mainWindow->pos();
|
||||
pos.setY(pos.y() + 40);
|
||||
move(pos);
|
||||
}
|
||||
|
||||
void UpdateNotifyWidget::addToList(FileData fileData)
|
||||
{
|
||||
QString itemName = fileData.path;
|
||||
itemName = itemName.remove(streamingAssetsPath);
|
||||
ui->updateListWidget->addItem(itemName);
|
||||
}
|
||||
|
||||
void UpdateNotifyWidget::showWithFill()
|
||||
{
|
||||
QString list = tr("Возможные действия:\n"
|
||||
" 1. Выгрузить изменения на сервер\n"
|
||||
" 2. Отменить изменения с загрузкой версии с сервера \n"
|
||||
" 3. Запустить без отправки файлов, но с текущими изменениями");
|
||||
|
||||
|
||||
ui->updateActionListLabel->setText(list);
|
||||
|
||||
show();
|
||||
}
|
||||
|
||||
void UpdateNotifyWidget::on_loadToServerButton_clicked()
|
||||
{
|
||||
if(versionContainer->getServerVersion() == baseNamePackage)
|
||||
{
|
||||
showWarning("В базовую версию загрузка невозможна!");
|
||||
return;
|
||||
}
|
||||
|
||||
mainWindow->loadToServer();
|
||||
}
|
||||
|
||||
void UpdateNotifyWidget::on_undoChangesButton_clicked()
|
||||
{
|
||||
mainWindow->undoCurrentChanges();
|
||||
}
|
||||
|
||||
void UpdateNotifyWidget::on_startWithCurrentChangesButton_clicked()
|
||||
{
|
||||
mainWindow->startUnityClient();
|
||||
}
|
||||
|
||||
void UpdateNotifyWidget::showWarning(QString text)
|
||||
{
|
||||
QMessageBox warning;
|
||||
warning.setText(text);
|
||||
warning.setIcon(QMessageBox::Warning);
|
||||
warning.setWindowTitle(tr("Ошибка"));
|
||||
warning.exec();
|
||||
}
|
||||
|
||||
UpdateNotifyWidget::~UpdateNotifyWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void UpdateNotifyWidget::on_closeButton_clicked()
|
||||
{
|
||||
close();
|
||||
}
|
||||
|
||||
void UpdateNotifyWidget::on_updateActionListLabel_linkActivated(const QString &link)
|
||||
{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user