Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+2
-2
@@ -208,11 +208,11 @@ void ExportedScriptsModel::setServerContent(const QString &jsonObject)
|
||||
}
|
||||
catch(const std::runtime_error &err)
|
||||
{
|
||||
ERROR_LOG() << "something went wrong: " << err.what();
|
||||
ERROR_LOG(m_logger) << "something went wrong: " << err.what();
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
ERROR_LOG() << "something went wrong";
|
||||
ERROR_LOG(m_logger) << "something went wrong";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -43,6 +43,8 @@ public:
|
||||
void writeScriptsJson() noexcept(false);
|
||||
|
||||
protected:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
|
||||
private:
|
||||
|
||||
+2
@@ -32,5 +32,7 @@ public:
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
}
|
||||
+17
-18
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
+2
@@ -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);
|
||||
|
||||
+12
-12
@@ -63,7 +63,7 @@ WARNING_LOG(x)
|
||||
#endif
|
||||
|
||||
#ifndef ELOG
|
||||
#define ELOG ERROR_LOG()
|
||||
#define ELOG ERROR_LOG(m_logger)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ USB2Dialog::USB2Dialog(LtsSession::LtsSession *session, QWidget *parent)
|
||||
|
||||
m_ui->setupUi(this);
|
||||
|
||||
WARNING_LOG()<<" USB2Dialog::USB2Dialog() START ";
|
||||
WARNING_LOG(m_logger)<<" USB2Dialog::USB2Dialog() START ";
|
||||
connect(m_ui->pbCHange, &QPushButton::clicked,
|
||||
this, &USB2Dialog::slotChangePath);
|
||||
|
||||
@@ -135,13 +135,13 @@ USB2Dialog::USB2Dialog(LtsSession::LtsSession *session, QWidget *parent)
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
WARNING_LOG()<<" data corrupted path: "<< localThpDir();
|
||||
WARNING_LOG(m_logger)<<" data corrupted path: "<< localThpDir();
|
||||
new LtsWidgets::LtsMessageDialogNew(this, tr("Couldn't Load THP(s)"));
|
||||
}
|
||||
|
||||
setOnlineHelpFilename(QStringLiteral("Script_Editor-Export_Script_Administration"));
|
||||
|
||||
WARNING_LOG()<<" USB2Dialog::USB2Dialog() END ";
|
||||
WARNING_LOG(m_logger)<<" USB2Dialog::USB2Dialog() END ";
|
||||
}
|
||||
|
||||
|
||||
@@ -185,15 +185,15 @@ void USB2Dialog::unmountUSB(const QString &device)
|
||||
while (process.canReadLine())
|
||||
{
|
||||
QString outputLine = QString::fromUtf8(process.readLine());
|
||||
DEBUG_LOG() << "OutputLine: " << outputLine;
|
||||
DEBUG_LOG(m_logger) << "OutputLine: " << outputLine;
|
||||
auto outputDevicePath = outputLine.split(QStringLiteral(" ")).last();
|
||||
DEBUG_LOG() << "OutputDevicePath: " << outputDevicePath;
|
||||
DEBUG_LOG(m_logger) << "OutputDevicePath: " << outputDevicePath;
|
||||
|
||||
auto outputPathStripped = outputDevicePath.replace(QLatin1String("\\x20"), QLatin1String(" "));
|
||||
DEBUG_LOG() << "OutputPathStripped: " << outputPathStripped;
|
||||
DEBUG_LOG(m_logger) << "OutputPathStripped: " << outputPathStripped;
|
||||
|
||||
auto outputDeviceName = outputPathStripped.split(QStringLiteral("/")).last();
|
||||
DEBUG_LOG() << "OutputDeviceName: " << outputDeviceName;
|
||||
DEBUG_LOG(m_logger) << "OutputDeviceName: " << outputDeviceName;
|
||||
|
||||
if (outputDeviceName.trimmed().compare(device.trimmed()) == 0)
|
||||
{
|
||||
@@ -201,7 +201,7 @@ void USB2Dialog::unmountUSB(const QString &device)
|
||||
|
||||
auto serialPort = outputLine.split(QStringLiteral(" ")).first();
|
||||
QString absPath = QStringLiteral("/dev/") + serialPort;
|
||||
DEBUG_LOG() << "Serial Port: " << absPath;
|
||||
DEBUG_LOG(m_logger) << "Serial Port: " << absPath;
|
||||
process.start(QStringLiteral("udisksctl"), QStringList() << QStringLiteral("unmount") << QStringLiteral("-b") << absPath);
|
||||
process.waitForFinished();
|
||||
reset();
|
||||
@@ -328,7 +328,7 @@ void USB2Dialog::slotUnmount()
|
||||
|
||||
for(const auto &folder : std::as_const(folderNames))
|
||||
{
|
||||
DEBUG_LOG() << "Folder: " << folder << " USB Root: " << m_usbRoot;
|
||||
DEBUG_LOG(m_logger) << "Folder: " << folder << " USB Root: " << m_usbRoot;
|
||||
|
||||
if(m_usbRoot.contains(folder))
|
||||
{
|
||||
@@ -479,7 +479,7 @@ void USB2Dialog::slotRemove()
|
||||
if (mil.size() < 1)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "mil.size()" << mil.size();
|
||||
DEBUG_LOG(m_logger) << "mil.size()" << mil.size();
|
||||
|
||||
QStringList scriptIdList;
|
||||
for (const QModelIndex &idx : mil)
|
||||
@@ -604,7 +604,7 @@ void USB2Dialog::retranslate()
|
||||
|
||||
void USB2Dialog::initLocalModel() noexcept(false)
|
||||
{
|
||||
DEBUG_LOG() << "(re)initModel !!";
|
||||
DEBUG_LOG(m_logger) << "(re)initModel !!";
|
||||
|
||||
|
||||
|
||||
|
||||
+2
@@ -52,6 +52,8 @@ private slots:
|
||||
void slotUnmount();
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
void removeScript(const QString &scriptId);
|
||||
void reset();
|
||||
void initLocalModel() noexcept(false);
|
||||
|
||||
Reference in new issue
Block a user