Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+13
-13
@@ -22,7 +22,7 @@ PresentationManagementDialog::PresentationManagementDialog(QWidget *parent)
|
||||
, m_ftc(nullptr)
|
||||
, m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
{
|
||||
DEBUG_LOG() << "PresentationManagementDialog ctor";
|
||||
DEBUG_LOG(m_logger) << "PresentationManagementDialog ctor";
|
||||
m_ui->setupUi(this);
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ void PresentationManagementDialog::enaDisa()
|
||||
|
||||
void PresentationManagementDialog::slotAdd()
|
||||
{
|
||||
DEBUG_LOG() << "PresentationManagementDialog::slotAdd";
|
||||
DEBUG_LOG(m_logger) << "PresentationManagementDialog::slotAdd";
|
||||
PresentationEditDialog *dialog = new PresentationEditDialog(this);
|
||||
if (!dialog->init(-1 , m_dtc, m_ftc, m_opmDtc))
|
||||
{
|
||||
@@ -101,7 +101,7 @@ void PresentationManagementDialog::slotAdd()
|
||||
|
||||
void PresentationManagementDialog::slotEdit()
|
||||
{
|
||||
DEBUG_LOG() << "PresentationManagementDialog::slotEdit";
|
||||
DEBUG_LOG(m_logger) << "PresentationManagementDialog::slotEdit";
|
||||
PresentationEditDialog *dialog = new PresentationEditDialog(this);
|
||||
|
||||
|
||||
@@ -126,13 +126,13 @@ void PresentationManagementDialog::slotEdit()
|
||||
|
||||
void PresentationManagementDialog::slotRemove()
|
||||
{
|
||||
DEBUG_LOG() << "PresentationManagementDialog::slotRemove";
|
||||
DEBUG_LOG(m_logger) << "PresentationManagementDialog::slotRemove";
|
||||
QModelIndex selIndex = m_ui->widget->currentIndex();
|
||||
if (!selIndex.isValid())
|
||||
return;
|
||||
|
||||
Core::RemoveElementRequest req(m_model->getRowData(selIndex.row()).id());
|
||||
DEBUG_LOG() << "Removing presentation id = " << req.id();
|
||||
DEBUG_LOG(m_logger) << "Removing presentation id = " << req.id();
|
||||
|
||||
m_requestHelper->startSingleRequest([req, this]()
|
||||
{
|
||||
@@ -140,18 +140,18 @@ void PresentationManagementDialog::slotRemove()
|
||||
});
|
||||
|
||||
if (m_requestHelper->failed())
|
||||
ERROR_LOG() << "Failed to remove presentation";
|
||||
ERROR_LOG(m_logger) << "Failed to remove presentation";
|
||||
}
|
||||
|
||||
void PresentationManagementDialog::slotDelete()
|
||||
{
|
||||
DEBUG_LOG() << "PresentationManagementDialog::slotDelete";
|
||||
DEBUG_LOG(m_logger) << "PresentationManagementDialog::slotDelete";
|
||||
changeStatus(FileStatus::Deleted);
|
||||
}
|
||||
|
||||
void PresentationManagementDialog::slotRestore()
|
||||
{
|
||||
DEBUG_LOG() << "PresentationManagementDialog::slotRestore";
|
||||
DEBUG_LOG(m_logger) << "PresentationManagementDialog::slotRestore";
|
||||
changeStatus(FileStatus::Valid);
|
||||
}
|
||||
|
||||
@@ -172,14 +172,14 @@ void PresentationManagementDialog::changeStatus(const FileStatus &fs)
|
||||
req.fileStatus(fs);
|
||||
req.operatorId(LtsSessionData::LtsSessionData::getInstance()->getOperatorId());
|
||||
req.lastModified(QDateTime::currentMSecsSinceEpoch());
|
||||
DEBUG_LOG() << "Changing status for presentation id = " << pre.id();
|
||||
DEBUG_LOG(m_logger) << "Changing status for presentation id = " << pre.id();
|
||||
m_requestHelper->startSingleRequest([this, req]()
|
||||
{
|
||||
return m_ftc->presentationChangeStatusRequest(PresentationChangeStatusRequest(req), this);
|
||||
});
|
||||
|
||||
if (m_requestHelper->failed())
|
||||
ERROR_LOG() << "Failed to change status for presentation";
|
||||
ERROR_LOG(m_logger) << "Failed to change status for presentation";
|
||||
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ bool PresentationManagementDialog::init(const ScriptsDialogMode &dlgMode,
|
||||
const std::shared_ptr<OperatorManagement::Interface::Dtc> &opmDtc,
|
||||
LtsSession::LtsSession *session)
|
||||
{
|
||||
DEBUG_LOG() << "PresentationManagementDialog::init";
|
||||
DEBUG_LOG(m_logger) << "PresentationManagementDialog::init";
|
||||
m_modeDialog = dlgMode;
|
||||
m_dtc = dtc;
|
||||
m_ftc = ftc;
|
||||
@@ -221,12 +221,12 @@ bool PresentationManagementDialog::init(const ScriptsDialogMode &dlgMode,
|
||||
|
||||
const QMap<qint32, PresentationManagement::Presentation> presentations = dtc->presentations();
|
||||
for (const auto &p : presentations)
|
||||
DEBUG_LOG() << "Presentation: id = " << p.id() << ", name = " << p.name().c_str() << ", desc = " << p.description().c_str();
|
||||
DEBUG_LOG(m_logger) << "Presentation: id = " << p.id() << ", name = " << p.name().c_str() << ", desc = " << p.description().c_str();
|
||||
|
||||
connect(m_ui->widget, &LtsDataView::LtsDataView::signalSelectionChanged, this, &PresentationManagementDialog::enaDisa, Qt::UniqueConnection);
|
||||
|
||||
m_loadedScriptId = m_session->getSavegame()[QStringLiteral("ScriptId")].toInt();
|
||||
ERROR_LOG() << "Loaded script id = " << m_loadedScriptId;
|
||||
ERROR_LOG(m_logger) << "Loaded script id = " << m_loadedScriptId;
|
||||
|
||||
if (m_modeDialog != ScriptsDialogMode::modeView)
|
||||
{
|
||||
|
||||
+2
@@ -45,6 +45,8 @@ public:
|
||||
LtsSession::LtsSession *session);
|
||||
|
||||
protected:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onPresentationRemoveReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
|
||||
void onPresentationChangeStatusReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
|
||||
|
||||
|
||||
+17
-17
@@ -38,7 +38,7 @@ PreMobileDialog::PreMobileDialog(QWidget *parent)
|
||||
, m_avScriptsCount(0)
|
||||
, m_avScriptsActualDone(0)
|
||||
{
|
||||
DEBUG_LOG() << "PreMobileDialog ctor";
|
||||
DEBUG_LOG(m_logger) << "PreMobileDialog ctor";
|
||||
connect(&m_copyExercise, &DBAdministration::CopyExercise::copyDbFailed, this, &PreMobileDialog::onCopyDbFailed);
|
||||
connect(&m_copyExercise, &DBAdministration::CopyExercise::copyDbFinished, this, &PreMobileDialog::onCopyDbFinished);
|
||||
|
||||
@@ -49,7 +49,7 @@ PreMobileDialog::PreMobileDialog(QWidget *parent)
|
||||
m_progressBar = new QProgressBar();
|
||||
m_label = new QLabel();
|
||||
connect(m_label, &QLabel::destroyed, this, [this]()
|
||||
{ERROR_LOG() << "Label destroyed";});
|
||||
{ERROR_LOG(m_logger) << "Label destroyed";});
|
||||
m_widgetProgressBar->layout()->addWidget(m_label);
|
||||
m_widgetProgressBar->layout()->addWidget(m_progressBar);
|
||||
m_progressBar->setMinimum(0);
|
||||
@@ -116,7 +116,7 @@ void PreMobileDialog::slotDownload()
|
||||
connect(&m_copyExercise, &DBAdministration::CopyExercise::nextProgress, this, &PreMobileDialog::onProgressBar);
|
||||
|
||||
if (!m_copyExercise.doCopy(exerciseId))
|
||||
ERROR_LOG() << "Failed to copy database from " << DBAdministration::Settings::serverDatabaseHost() << " to " << hostname;
|
||||
ERROR_LOG(m_logger) << "Failed to copy database from " << DBAdministration::Settings::serverDatabaseHost() << " to " << hostname;
|
||||
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ bool PreMobileDialog::init(const std::shared_ptr<Interface::Dtc> &dtc,
|
||||
const std::shared_ptr<AudioVideoManagement::DataInterface> &avmDataIfc,
|
||||
LtsSession::LtsSession *session)
|
||||
{
|
||||
DEBUG_LOG() << "PreMobileDialog::init";
|
||||
DEBUG_LOG(m_logger) << "PreMobileDialog::init";
|
||||
m_session = session;
|
||||
m_avmDataIfc = avmDataIfc;
|
||||
m_dtc = dtc;
|
||||
@@ -186,7 +186,7 @@ bool PreMobileDialog::init(const std::shared_ptr<Interface::Dtc> &dtc,
|
||||
|
||||
const QMap<qint32, PresentationManagement::Presentation> presentations = dtc->presentations();
|
||||
for (const auto &p : presentations)
|
||||
DEBUG_LOG() << "Presentation: id = " << p.id() << ", name = " << p.name().c_str() << ", desc = " << p.description().c_str();
|
||||
DEBUG_LOG(m_logger) << "Presentation: id = " << p.id() << ", name = " << p.name().c_str() << ", desc = " << p.description().c_str();
|
||||
|
||||
connect(m_ui->widget, &LtsDataView::LtsDataView::signalSelectionChanged, this, &PreMobileDialog::enaDisa, Qt::UniqueConnection);
|
||||
|
||||
@@ -246,7 +246,7 @@ void PreMobileDialog::handlePresentationContent(const GetPresentationContentRepl
|
||||
|
||||
if (contentList.empty())
|
||||
{
|
||||
WARNING_LOG() << "No content for Script Id = " << reply.id();
|
||||
WARNING_LOG(m_logger) << "No content for Script Id = " << reply.id();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -268,28 +268,28 @@ void PreMobileDialog::handlePresentationContent(const GetPresentationContentRepl
|
||||
|
||||
bool PreMobileDialog::downloadAVScripts()
|
||||
{
|
||||
INFO_LOG() << "IN downloadAVScripts";
|
||||
INFO_LOG(m_logger) << "IN downloadAVScripts";
|
||||
int nextProgress = 76;
|
||||
m_progressBar->setValue(nextProgress);
|
||||
|
||||
if (!m_avmDataIfc->hasAvsSession())
|
||||
{
|
||||
ERROR_LOG() << "avm hasAvsSession failed";
|
||||
ERROR_LOG(m_logger) << "avm hasAvsSession failed";
|
||||
m_copyExercise.stopPing();
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG() << "hasAVsSession ok";
|
||||
INFO_LOG(m_logger) << "hasAVsSession ok";
|
||||
|
||||
AudioVideoManagement::AvaSession *avaSession = m_avmDataIfc->avaSession();
|
||||
if (!avaSession->isEstablished())
|
||||
{
|
||||
ERROR_LOG() << "avaSession not established, abort";
|
||||
ERROR_LOG(m_logger) << "avaSession not established, abort";
|
||||
m_copyExercise.stopPing();
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG() << "avaSession established";
|
||||
INFO_LOG(m_logger) << "avaSession established";
|
||||
|
||||
m_avaControl = avaSession->control();
|
||||
|
||||
@@ -323,14 +323,14 @@ void PreMobileDialog::slotScriptSet(const AudioVideoManagement::AvaStreamInfo &s
|
||||
{
|
||||
if (streamState == AudioVideoManagement::AvaStreamState::NotPossible)
|
||||
{
|
||||
ERROR_LOG() << "Script " << m_lastScriptName << " not correctly downloaded";
|
||||
ERROR_LOG(m_logger) << "Script " << m_lastScriptName << " not correctly downloaded";
|
||||
slotScriptDownloaded(streamState);
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "ScriptName: " << m_lastScriptName;
|
||||
DEBUG_LOG() << "streamInfo: start" << streamInfo.duration.count();
|
||||
DEBUG_LOG() << "streamState: " << static_cast<int>(streamState);
|
||||
DEBUG_LOG(m_logger) << "ScriptName: " << m_lastScriptName;
|
||||
DEBUG_LOG(m_logger) << "streamInfo: start" << streamInfo.duration.count();
|
||||
DEBUG_LOG(m_logger) << "streamState: " << static_cast<int>(streamState);
|
||||
|
||||
m_avaControl->startScript(QStringLiteral("LOCAL_RECORD"), m_lastScriptName,
|
||||
LtsUtils::createConnection(m_avaControl, &AudioVideoManagement::AvaControl::startScriptResponse,
|
||||
@@ -339,7 +339,7 @@ void PreMobileDialog::slotScriptSet(const AudioVideoManagement::AvaStreamInfo &s
|
||||
|
||||
void PreMobileDialog::slotScriptDownloaded(AudioVideoManagement::AvaStreamState streamState)
|
||||
{
|
||||
DEBUG_LOG() << "streamState: " << static_cast<int>(streamState);
|
||||
DEBUG_LOG(m_logger) << "streamState: " << static_cast<int>(streamState);
|
||||
|
||||
m_avScriptsActualDone += 1;
|
||||
QString labelText = tr("Downloaded Audio Video Data: ") + QString::number(m_avScriptsActualDone) + QStringLiteral(" / ") + QString::number(m_avScriptsCount);
|
||||
@@ -349,7 +349,7 @@ void PreMobileDialog::slotScriptDownloaded(AudioVideoManagement::AvaStreamState
|
||||
|
||||
if (streamState == AudioVideoManagement::AvaStreamState::NotPossible)
|
||||
{
|
||||
ERROR_LOG() << "Script " << m_lastScriptName << " not correctly downloaded";
|
||||
ERROR_LOG(m_logger) << "Script " << m_lastScriptName << " not correctly downloaded";
|
||||
QString msg = tr("Could not download data - Audio/Video download - Script %1 failed").arg(m_lastScriptName);
|
||||
auto x = new LtsWidgets::LtsMessageDialogNew(this, msg);
|
||||
connect(x, &LtsWidgets::LtsMessageDialogNew::ok,
|
||||
|
||||
+1
@@ -57,6 +57,7 @@ private slots:
|
||||
void slotScriptDownloadedStep2();
|
||||
void onProgressBar(int nextProgress);
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void retranslate() override;
|
||||
void changeStatus(const FileStatus &fs);
|
||||
bool downloadAVScripts();
|
||||
|
||||
Reference in new issue
Block a user