mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJClient.git
synced 2026-03-28 05:25:39 +03:00
feat: restore changes func
This commit is contained in:
@@ -15,6 +15,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
, ui(new Ui::MainWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
isRecovery = false;
|
||||
setWindowFlag(Qt::FramelessWindowHint);
|
||||
painting();
|
||||
initialize();
|
||||
@@ -80,7 +81,7 @@ void MainWindow::createObjects()
|
||||
recognizeSystem = new RecognizeSystem;
|
||||
recognizeSystem->moveToThread(connectionThread);
|
||||
|
||||
screenChecker = new ScreenChecker(dataParser,ui->displayLayout);
|
||||
screenChecker = new ScreenChecker(this,dataParser,ui->displayLayout);
|
||||
externalExecuter = new ExternalExecuter;
|
||||
|
||||
hashComparer = new HashComparer(dataParser);
|
||||
@@ -154,12 +155,19 @@ void MainWindow::setNeedUpdate(bool flag,quint64 size, quint64 fileCount)
|
||||
fileCountForUpdate = fileCount;
|
||||
QString availableSizeText;
|
||||
|
||||
if (flag){
|
||||
if (flag && isRecovery)
|
||||
{
|
||||
ui->inlineTextDebug->setText("Восстановление версии...");
|
||||
|
||||
}
|
||||
else if(flag)
|
||||
{
|
||||
QString result = tr("Доступно обновление: ") + Tools::convertFileSize(size);
|
||||
result += tr("Количество файлов: ") + QString::number(fileCount);
|
||||
ui->inlineTextDebug->setText(result);
|
||||
ui->updateButton->show();
|
||||
ui->autostartCheckBox->show();
|
||||
stopLoadingMovie();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -167,10 +175,10 @@ void MainWindow::setNeedUpdate(bool flag,quint64 size, quint64 fileCount)
|
||||
autoStart();
|
||||
ui->loadingProgressBar->hide();
|
||||
ui->startButton->show();
|
||||
ui->offlineStartButton->setEnabled(true);
|
||||
stopLoadingMovie();
|
||||
}
|
||||
|
||||
|
||||
stopLoadingMovie();
|
||||
ui->updateButton->setEnabled(flag);
|
||||
ui->startButton->setEnabled(!flag);
|
||||
}
|
||||
@@ -367,6 +375,7 @@ void MainWindow::on_loginButton_clicked()
|
||||
void MainWindow::on_updateButton_clicked()
|
||||
{
|
||||
emit sigSendCommand("update");
|
||||
|
||||
ui->updateButton->hide();
|
||||
ui->loadingProgressBar->setValue(0);
|
||||
ui->loadingProgressBar->show();
|
||||
@@ -433,11 +442,28 @@ void MainWindow::on_loadToServerButton_clicked()
|
||||
|
||||
void MainWindow::on_undoChangesButton_clicked()
|
||||
{
|
||||
isRecovery = true;
|
||||
emit sigSendCommand("check");
|
||||
|
||||
ui->loadingProgressBar->show();
|
||||
ui->offlineStartButton->hide();
|
||||
ui->offlineStartButton->setEnabled(false);
|
||||
|
||||
ui->updateButtonGroup_2->hide();
|
||||
ui->updateWidget->hide();
|
||||
|
||||
startLoadingAnim();
|
||||
|
||||
//delay
|
||||
|
||||
QTime dieTime= QTime::currentTime().addSecs(10);
|
||||
while (QTime::currentTime() < dieTime)
|
||||
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
|
||||
|
||||
startLoadingAnim();
|
||||
ui->updateButton->hide();
|
||||
on_updateButton_clicked();
|
||||
isRecovery = false;
|
||||
stopLoadingMovie();
|
||||
}
|
||||
|
||||
void MainWindow::on_startWithCurrentChangesButton_clicked()
|
||||
@@ -488,9 +514,11 @@ void MainWindow::showCompleteDialogBox(bool flag)
|
||||
{
|
||||
ui->inlineTextDebug->setText(tr("Загрузка завершена"));
|
||||
startLoadingAnim();
|
||||
|
||||
QTime dieTime= QTime::currentTime().addSecs(10);
|
||||
while (QTime::currentTime() < dieTime)
|
||||
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
|
||||
|
||||
stopLoadingMovie();
|
||||
checkUpdate();
|
||||
}
|
||||
@@ -551,7 +579,6 @@ void MainWindow::painting()
|
||||
movieLabel->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum);
|
||||
movieLabel->setMovie(movie);
|
||||
startLoadingAnim();
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::startLoadingAnim()
|
||||
|
||||
Reference in New Issue
Block a user