mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJClient.git
synced 2026-03-29 06:35:40 +03:00
fead: load without animation
This commit is contained in:
81
updatenotifywidget.cpp
Normal file
81
updatenotifywidget.cpp
Normal file
@@ -0,0 +1,81 @@
|
||||
#include "updatenotifywidget.h"
|
||||
#include "ui_updatenotifywidget.h"
|
||||
#include "mainwindow.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
UpdateNotifyWidget::UpdateNotifyWidget(QWidget *parent) :
|
||||
ui(new Ui::UpdateNotifyWidget)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowFlag(Qt::SubWindow);
|
||||
}
|
||||
|
||||
void UpdateNotifyWidget::initialize(MainWindow *mainWindow,UpdateController *updateController)
|
||||
{
|
||||
setWindowTitle("Отправка новых файлов");
|
||||
this->mainWindow = mainWindow;
|
||||
this->updateController = updateController;
|
||||
fillList();
|
||||
|
||||
connect(updateController,&UpdateController::sigUpdateComplete,this,&UpdateNotifyWidget::showCompleteDialogBox);
|
||||
connect(this,&UpdateNotifyWidget::sigUpdateFilesOnServer,updateController,&UpdateController::updateFilesOnServer);
|
||||
}
|
||||
|
||||
void UpdateNotifyWidget::setUpdateList(QList<FileData> *fileDataList)
|
||||
{
|
||||
this->updateList = fileDataList;
|
||||
}
|
||||
|
||||
void UpdateNotifyWidget::addToList(FileData fileData)
|
||||
{
|
||||
ui->updateListWidget->addItem(fileData.path);
|
||||
}
|
||||
|
||||
|
||||
void UpdateNotifyWidget::on_StartLoadButton_clicked()
|
||||
{
|
||||
emit sigUpdateFilesOnServer(updateList);
|
||||
}
|
||||
|
||||
void UpdateNotifyWidget::on_CancelButton_clicked()
|
||||
{
|
||||
mainWindow->checkUpdate();
|
||||
close();
|
||||
}
|
||||
|
||||
void UpdateNotifyWidget::fillList()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
UpdateNotifyWidget::~UpdateNotifyWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void UpdateNotifyWidget::showCompleteDialogBox(bool flag)
|
||||
{
|
||||
QMessageBox *messageBox = new QMessageBox;
|
||||
|
||||
if(flag)
|
||||
{
|
||||
messageBox->setIcon(QMessageBox::Information);
|
||||
messageBox->setWindowTitle("Информация");
|
||||
messageBox->addButton(QMessageBox::Ok);
|
||||
messageBox->setText("Загрузка завершена");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
messageBox->setIcon(QMessageBox::Warning);
|
||||
messageBox->setWindowTitle("Ошибка");
|
||||
messageBox->addButton(QMessageBox::Ok);
|
||||
messageBox->setText("Произошла ошибка при загрузке");
|
||||
}
|
||||
|
||||
connect(messageBox,&QMessageBox::accepted,this,&UpdateNotifyWidget::hide);
|
||||
connect(messageBox,&QMessageBox::accepted,this,&UpdateNotifyWidget::on_CancelButton_clicked);
|
||||
|
||||
messageBox->show();
|
||||
}
|
||||
Reference in New Issue
Block a user