Adds immediate migration results in progress

This commit is contained in:
torsten committed 2026-08-19 11:18:24 +02:00
1 parent 8453e104c5
commit 3bb6e89496
2102 files changed
+17482 -15071

No files matched your search

@@ -41,7 +41,7 @@
#ifndef ELOG
#define ELOG ERROR_LOG()
#define ELOG ERROR_LOG(m_logger)
#endif
using err = std::runtime_error;
@@ -51,9 +51,8 @@ err error(const QString &msg) { return err(msg.toStdString()); }
namespace TakeHomePackageManager
{
Compressor::Compressor()
: QObject(nullptr)
{}
Compressor::Compressor() : QObject(nullptr),
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {}
void Compressor::go(ProcessOverlay *processOverlay, QIODevice &out, const QString &sourceDir, const QString &destRootDir) noexcept(false)
@@ -131,7 +130,7 @@ HttpProcess::HttpProcess(LtsWidgets::LtsDialog *dialog, const QString &statusMes
connect(m_process, &ProcessOverlay::signalCancel,
this, [this]()
{
DEBUG_LOG() << "m_wasCanceled!!";
DEBUG_LOG(m_logger) << "m_wasCanceled!!";
m_process->setCancelEnabled(false);
emit signalCancel();
});
@@ -143,7 +142,7 @@ HttpProcess::HttpProcess(LtsWidgets::LtsDialog *dialog, const QString &statusMes
HttpProcess::~HttpProcess()
{
DEBUG_LOG() << "~HttpProcess";
DEBUG_LOG(m_logger) << "~HttpProcess";
m_process->deleteLater();
m_nam->deleteLater();
}
@@ -361,7 +360,7 @@ void UploadProcess::go(const QString &rootFolder, const ExportedScriptInformatio
connect(this, &HttpProcess::signalCancel, &compressor, &Compressor::abort);
compressor.go(m_process, *tempFile.get(), srcDir, dstDir);
DEBUG_LOG() << "posting file of size " << tempFile->size();
DEBUG_LOG(m_logger) << "posting file of size " << tempFile->size();
tempFile->seek(0);
QNetworkReply *rep = post(L("/thp2"), tempFile.get(), {}, L("application/octet-stream"), { { L("x-thp-info"), QString::fromUtf8(QJsonDocument(esi.toJson().toObject()).toJson(QJsonDocument::JsonFormat::Compact)) } });
@@ -586,7 +585,7 @@ ExportedScriptsDialog::ExportedScriptsDialog(LtsSession::LtsSession *session, QW
connect(sock, &QWebSocket::disconnected,
this, [this, sock, openFn]()
{
WARNING_LOG() << "disconnected from ws... reconnecting in 3...";
WARNING_LOG(m_logger) << "disconnected from ws... reconnecting in 3...";
setWsConnectionStatus(WsConnectionStatus::Disconnected);
QTimer *t = new QTimer(sock);
@@ -607,7 +606,7 @@ ExportedScriptsDialog::ExportedScriptsDialog(LtsSession::LtsSession *session, QW
connect(sock, &QWebSocket::textMessageReceived,
this, [this](const QString &msg)
{
DEBUG_LOG() << "new msg: '" << msg << "'";
DEBUG_LOG(m_logger) << "new msg: '" << msg << "'";
m_lastServerContent = msg;
m_model->setServerContent(msg);
onSelectionChanged();
@@ -757,7 +756,7 @@ void ExportedScriptsDialog::setWsConnectionStatusLabel()
void ExportedScriptsDialog::initModel() noexcept(false)
{
DEBUG_LOG() << "(re)initModel !!";
DEBUG_LOG(m_logger) << "(re)initModel !!";
const QString rootDirectory(localThpDir());
@@ -768,7 +767,7 @@ void ExportedScriptsDialog::initModel() noexcept(false)
catch(...)
{
new LtsWidgets::LtsMessageDialogNew(this, tr("Couldn't Load THP(s)"));
WARNING_LOG()<<" data corrupted path: "<< localThpDir();
WARNING_LOG(m_logger)<<" data corrupted path: "<< localThpDir();
}
m_model->setOC(isOCApp());
@@ -805,12 +804,12 @@ void ExportedScriptsDialog::uploadScript()
}
catch(const std::runtime_error &err)
{
ERROR_LOG() << "Uploaded script FAILED: " << err.what();
ERROR_LOG(m_logger) << "Uploaded script FAILED: " << err.what();
new LtsWidgets::LtsMessageDialogNew(this, tr("Uploading script failed: %1").arg(QString::fromUtf8(err.what())));
return;
}
DEBUG_LOG() << "Uploaded script successfully";
DEBUG_LOG(m_logger) << "Uploaded script successfully";
new LtsWidgets::LtsMessageDialogNew(this, tr("Uploaded script successfully"));
}
@@ -855,7 +854,7 @@ void ExportedScriptsDialog::downloadScript()
}
catch(const std::runtime_error &err)
{
ERROR_LOG() << "Downloading script FAILED: " << err.what();
ERROR_LOG(m_logger) << "Downloading script FAILED: " << err.what();
new LtsWidgets::LtsMessageDialogNew(this, tr("Downloading script failed: %1").arg(QString::fromUtf8(err.what())));
return;
}
@@ -863,7 +862,7 @@ void ExportedScriptsDialog::downloadScript()
DEBUG_LOG() << "Downloaded script successfully";
DEBUG_LOG(m_logger) << "Downloaded script successfully";
new LtsWidgets::LtsMessageDialogNew(this, tr("Downloaded script successfully"));
}
@@ -888,7 +887,7 @@ void ExportedScriptsDialog::removeScriptFromServer()
}
catch (const std::runtime_error &err)
{
ERROR_LOG() << err.what();
ERROR_LOG(m_logger) << err.what();
new LtsWidgets::LtsMessageDialogNew(this, tr("Failed to remove script from server!"));
return;
}
@@ -941,7 +940,7 @@ void ExportedScriptsDialog::removeScriptLocal()
}
catch (const std::runtime_error &err)
{
ERROR_LOG() << err.what();
ERROR_LOG(m_logger) << err.what();
new LtsWidgets::LtsMessageDialogNew(this, tr("Failed to remove script locally!"));
return;
}
@@ -965,7 +964,7 @@ void ExportedScriptsDialog::openScript()
const auto path(QDir(scriptHtmlLocation(localThpDir(), esi.id())).path());
const auto url(QUrl::fromLocalFile(path));
const bool openUrlResult = QDesktopServices::openUrl(url);
DEBUG_LOG() << "path: " << path << " - url: " << url.toString() << " - success? " << openUrlResult;
DEBUG_LOG(m_logger) << "path: " << path << " - url: " << url.toString() << " - success? " << openUrlResult;
}
}
@@ -73,6 +73,8 @@ signals:
void signalCancel();
protected:
NGL::INGLLogger &m_logger;
void waitForAnswer(QNetworkReply *r, const int expectedResponseStatus) noexcept(false);
QNetworkReply *post(const QString &path, QIODevice *data, const QUrlQuery &q = QUrlQuery(), const QString &contentType = QStringLiteral("application/octet-stream"), const QMap<QString, QString> &additionalHeaders = {}) noexcept(false);