Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+18
-18
@@ -31,7 +31,7 @@ bool FlmHqReportConverter::init(LtsSession::LtsSession *session, int currentPart
|
||||
{
|
||||
if (session == nullptr)
|
||||
{
|
||||
ERROR_LOG() << "Got invalid session";
|
||||
ERROR_LOG(m_logger) << "Got invalid session";
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -40,28 +40,28 @@ bool FlmHqReportConverter::init(LtsSession::LtsSession *session, int currentPart
|
||||
|
||||
if (!m_session->getDtc<DataInterface>(m_flmDtc))
|
||||
{
|
||||
ERROR_LOG() << "Could not get FLM Dtc.";
|
||||
ERROR_LOG(m_logger) << "Could not get FLM Dtc.";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_session->getFtc<DataInterface>(m_flmFtc))
|
||||
{
|
||||
ERROR_LOG() << "Could not get FLM Ftc.";
|
||||
ERROR_LOG(m_logger) << "Could not get FLM Ftc.";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!session->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc))
|
||||
{
|
||||
ERROR_LOG() << "Could not get PPM Dtc.";
|
||||
ERROR_LOG(m_logger) << "Could not get PPM Dtc.";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_flmFtc->enableFileContentModify())
|
||||
{
|
||||
ERROR_LOG() << "Could enable fileContentModify.";
|
||||
ERROR_LOG(m_logger) << "Could enable fileContentModify.";
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -104,7 +104,7 @@ void FlmHqReportConverter::processCollectedHqs()
|
||||
|
||||
for (int id : reportIds)
|
||||
{
|
||||
DEBUG_LOG() << "Request File with ID: " << id << " from plan with ID: " << planId;
|
||||
DEBUG_LOG(m_logger) << "Request File with ID: " << id << " from plan with ID: " << planId;
|
||||
FileManagement::GetFileContentDataRequest request(id);
|
||||
m_flmFtc->getFileContentDataRequest(request, this);
|
||||
}
|
||||
@@ -128,16 +128,16 @@ void FlmHqReportConverter::onGetFileContentDataReply(
|
||||
|
||||
if (reply.errorString().size() > 0)
|
||||
{
|
||||
ERROR_LOG() << "Got onGetFileContentDataReply error: " << reply.errorString();
|
||||
ERROR_LOG(m_logger) << "Got onGetFileContentDataReply error: " << reply.errorString();
|
||||
return;
|
||||
}
|
||||
|
||||
int id = static_cast<int>(reply.id());
|
||||
int planId = -1;
|
||||
|
||||
DEBUG_LOG() << "Reply File with ID: " << id << " from plan with ID: " << planId;
|
||||
DEBUG_LOG(m_logger) << "Reply File with ID: " << id << " from plan with ID: " << planId;
|
||||
|
||||
INFO_LOG() << "Got reply with id " << id << " and errorString " << reply.errorString();
|
||||
INFO_LOG(m_logger) << "Got reply with id " << id << " and errorString " << reply.errorString();
|
||||
|
||||
QByteArray fileContent = QByteArray(reinterpret_cast<const char*>(reply.content().data()), reply.content().size());
|
||||
|
||||
@@ -146,7 +146,7 @@ void FlmHqReportConverter::onGetFileContentDataReply(
|
||||
HqReportData data = m_parser.parse(fileContent);
|
||||
data.contentFileId = id;
|
||||
|
||||
DEBUG_LOG() << "Party: " << m_partyId << " has Color: "<< QColor::fromRgb(QRgb(m_ppmDtc->party(m_partyId).color())).value();
|
||||
DEBUG_LOG(m_logger) << "Party: " << m_partyId << " has Color: "<< QColor::fromRgb(QRgb(m_ppmDtc->party(m_partyId).color())).value();
|
||||
|
||||
data.partyColor = QColor::fromRgb(QRgb(m_ppmDtc->party(m_partyId).color()));
|
||||
|
||||
@@ -161,36 +161,36 @@ void FlmHqReportConverter::onGetFileContentDataReply(
|
||||
|
||||
m_convertedHqToPlanIds[planId].append(data);
|
||||
|
||||
DEBUG_LOG() << "Content size: " << reply.content().size();
|
||||
DEBUG_LOG(m_logger) << "Content size: " << reply.content().size();
|
||||
|
||||
checkIfAllFinished();
|
||||
}
|
||||
|
||||
void FlmHqReportConverter::onFileContentModifyReply(const Core::FunctionReplyObject &reply)
|
||||
{
|
||||
DEBUG_LOG() << "Got FileContentModify Reply: " << reply.translated();
|
||||
DEBUG_LOG(m_logger) << "Got FileContentModify Reply: " << reply.translated();
|
||||
|
||||
if (reply.error())
|
||||
{
|
||||
ERROR_LOG() << "Error while insert HX Message: " << reply.translated()
|
||||
ERROR_LOG(m_logger) << "Error while insert HX Message: " << reply.translated()
|
||||
<< ", error: " << reply.error();
|
||||
}
|
||||
}
|
||||
|
||||
void FlmHqReportConverter::onFileContentRemoveReply(const Core::FunctionReplyObject &reply)
|
||||
{
|
||||
DEBUG_LOG() << "Got FileContentRemove Reply: " << reply.translated();
|
||||
DEBUG_LOG(m_logger) << "Got FileContentRemove Reply: " << reply.translated();
|
||||
|
||||
if (reply.error())
|
||||
{
|
||||
ERROR_LOG() << "Error while insert HX Message: " << reply.translated()
|
||||
ERROR_LOG(m_logger) << "Error while insert HX Message: " << reply.translated()
|
||||
<< ", error: " << reply.error();
|
||||
}
|
||||
}
|
||||
|
||||
void FlmHqReportConverter::onRequestsFinished()
|
||||
{
|
||||
DEBUG_LOG() << "ALL REQUESTS FINISHED";
|
||||
DEBUG_LOG(m_logger) << "ALL REQUESTS FINISHED";
|
||||
|
||||
for (auto it = m_convertedHqToPlanIds.constBegin(); it != m_convertedHqToPlanIds.constEnd(); ++it)
|
||||
{
|
||||
@@ -199,7 +199,7 @@ void FlmHqReportConverter::onRequestsFinished()
|
||||
|
||||
for (auto &reportData : reportDatas)
|
||||
{
|
||||
DEBUG_LOG() << "createGeometryFromReport :" << reportData.art;
|
||||
DEBUG_LOG(m_logger) << "createGeometryFromReport :" << reportData.art;
|
||||
createGeometryFromReport(reportData);
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ void FlmHqReportConverter::onRequestsFinished()
|
||||
|
||||
FileManagement::FileContentModifyRequest data;
|
||||
|
||||
DEBUG_LOG() << "FILE CONTENT: " << flc.name() << " " << flc.folderId();
|
||||
DEBUG_LOG(m_logger) << "FILE CONTENT: " << flc.name() << " " << flc.folderId();
|
||||
|
||||
data.id(flc.id());
|
||||
data.name(flc.name());
|
||||
|
||||
+1
@@ -43,6 +43,7 @@ private:
|
||||
void checkIfAllFinished();
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onGetFileContentDataReply(const FileManagement::GetFileContentDataReply &reply) override;
|
||||
void onFileContentModifyReply(const Core::FunctionReplyObject &reply) override;
|
||||
void onFileContentRemoveReply(const Core::FunctionReplyObject &reply) override;
|
||||
|
||||
+20
-20
@@ -40,7 +40,7 @@ bool HQReportEdit::init(LtsSession::LtsSession *session, int partyId)
|
||||
{
|
||||
if (session == nullptr)
|
||||
{
|
||||
ERROR_LOG() << "Got invalid session";
|
||||
ERROR_LOG(m_logger) << "Got invalid session";
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -51,35 +51,35 @@ bool HQReportEdit::init(LtsSession::LtsSession *session, int partyId)
|
||||
|
||||
if (!m_session->getForeignGuiInterface<ParticipantManagement::ForeignGuiComboboxInterface>(partyCboInterface))
|
||||
{
|
||||
ERROR_LOG() << "Could not get Party Combobox Interface.";
|
||||
ERROR_LOG(m_logger) << "Could not get Party Combobox Interface.";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!partyCboInterface->fillPartyComboBox(m_ui->cboParties) || m_ui->cboParties->count() == 0)
|
||||
{
|
||||
ERROR_LOG() << "Could not fill Parties.";
|
||||
ERROR_LOG(m_logger) << "Could not fill Parties.";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_session->getDtc<DataInterface>(m_flmDtc))
|
||||
{
|
||||
ERROR_LOG() << "Could not get FLM Dtc.";
|
||||
ERROR_LOG(m_logger) << "Could not get FLM Dtc.";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_session->getFtc<DataInterface>(m_flmFtc))
|
||||
{
|
||||
ERROR_LOG() << "Could not get FLM Ftc.";
|
||||
ERROR_LOG(m_logger) << "Could not get FLM Ftc.";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_flmFtc->enableFileContentModify())
|
||||
{
|
||||
ERROR_LOG() << "Could enable fileContentModify.";
|
||||
ERROR_LOG(m_logger) << "Could enable fileContentModify.";
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -100,7 +100,7 @@ bool HQReportEdit::init(LtsSession::LtsSession *session, int partyId)
|
||||
|
||||
if (!planModel->init(m_session, partyFolderId, FileType::inner_enum::TacticalPlan))
|
||||
{
|
||||
WARNING_LOG() << "Could not init planModel for partyId " << partyId;
|
||||
WARNING_LOG(m_logger) << "Could not init planModel for partyId " << partyId;
|
||||
|
||||
delete planModel;
|
||||
planModel = nullptr;
|
||||
@@ -114,7 +114,7 @@ bool HQReportEdit::init(LtsSession::LtsSession *session, int partyId)
|
||||
|
||||
if (!hqReportModel->init(m_session, hqReportFolderId, FileType::inner_enum::AdlerJson))
|
||||
{
|
||||
WARNING_LOG() << "Could not init hqReportModel for partyId " << partyId;
|
||||
WARNING_LOG(m_logger) << "Could not init hqReportModel for partyId " << partyId;
|
||||
|
||||
delete planModel;
|
||||
planModel = nullptr;
|
||||
@@ -145,7 +145,7 @@ bool HQReportEdit::init(LtsSession::LtsSession *session, int partyId)
|
||||
|
||||
if (!m_flmFtc->enableFileContentModify())
|
||||
{
|
||||
ERROR_LOG() << "Could enable fileContentModify.";
|
||||
ERROR_LOG(m_logger) << "Could enable fileContentModify.";
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -188,7 +188,7 @@ void HQReportEdit::createModels(const int partyId)
|
||||
const int partyFolderId = m_flmDtc->getPartyFolderId(m_session->exerciseId(), partyId);
|
||||
if (partyFolderId == 0)
|
||||
{
|
||||
WARNING_LOG() << "No partyFolderId found for partyId " << partyId;
|
||||
WARNING_LOG(m_logger) << "No partyFolderId found for partyId " << partyId;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ void HQReportEdit::createModels(const int partyId)
|
||||
auto *planModel = new FlmHQReportModel(m_ui->listViewPlan);
|
||||
if (!planModel->init(m_session, partyFolderId, FileType::inner_enum::TacticalPlan))
|
||||
{
|
||||
WARNING_LOG() << "Could not init planModel for partyId " << partyId;
|
||||
WARNING_LOG(m_logger) << "Could not init planModel for partyId " << partyId;
|
||||
delete planModel;
|
||||
return;
|
||||
}
|
||||
@@ -205,7 +205,7 @@ void HQReportEdit::createModels(const int partyId)
|
||||
auto *hqReportModel = new FlmHQReportModel(m_ui->listViewMessage);
|
||||
if (!hqReportModel->init(m_session, hqReportFolderId, FileType::inner_enum::AdlerJson))
|
||||
{
|
||||
WARNING_LOG() << "Could not init hqReportModel for partyId " << partyId;
|
||||
WARNING_LOG(m_logger) << "Could not init hqReportModel for partyId " << partyId;
|
||||
delete planModel;
|
||||
delete hqReportModel;
|
||||
return;
|
||||
@@ -238,7 +238,7 @@ bool HQReportEdit::apply()
|
||||
|
||||
if (hqRepConv->init(m_session, currentPartyId))
|
||||
{
|
||||
DEBUG_LOG() << "Add HQ to Converter";
|
||||
DEBUG_LOG(m_logger) << "Add HQ to Converter";
|
||||
|
||||
hqRepConv->addHqToPlanIds(allHqToPlanIds);
|
||||
|
||||
@@ -258,7 +258,7 @@ void HQReportEdit::onPartyChanged(int index)
|
||||
|
||||
if (!m_planModels.contains(currentPartyId) || !m_hqModels.contains(currentPartyId))
|
||||
{
|
||||
INFO_LOG() << "Models for party" << currentPartyId << "not found. Attempting to create...";
|
||||
INFO_LOG(m_logger) << "Models for party" << currentPartyId << "not found. Attempting to create...";
|
||||
createModels(currentPartyId);
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ void HQReportEdit::onPartyChanged(int index)
|
||||
}
|
||||
else
|
||||
{
|
||||
ERROR_LOG() << "Failed to switch to party" << currentPartyId << ": Models still missing.";
|
||||
ERROR_LOG(m_logger) << "Failed to switch to party" << currentPartyId << ": Models still missing.";
|
||||
}
|
||||
}
|
||||
void HQReportEdit::onCreateNewPlanClicked()
|
||||
@@ -294,7 +294,7 @@ void HQReportEdit::onCreateNewPlanClicked()
|
||||
|
||||
if (!ok)
|
||||
{
|
||||
DEBUG_LOG() << "No name for new plan entered.";
|
||||
DEBUG_LOG(m_logger) << "No name for new plan entered.";
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -303,7 +303,7 @@ void HQReportEdit::onCreateNewPlanClicked()
|
||||
|
||||
if (planModel == nullptr)
|
||||
{
|
||||
ERROR_LOG() << "Could not create plan --> no plan model present.";
|
||||
ERROR_LOG(m_logger) << "Could not create plan --> no plan model present.";
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -312,14 +312,14 @@ void HQReportEdit::onCreateNewPlanClicked()
|
||||
|
||||
if (geometryModel == nullptr)
|
||||
{
|
||||
ERROR_LOG() << "Could not create plan --> not possible to create GeometryModel.";
|
||||
ERROR_LOG(m_logger) << "Could not create plan --> not possible to create GeometryModel.";
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_session == nullptr)
|
||||
{
|
||||
ERROR_LOG() << "Could not create plan --> not possible to create GeometryModel.";
|
||||
ERROR_LOG(m_logger) << "Could not create plan --> not possible to create GeometryModel.";
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -345,7 +345,7 @@ void HQReportEdit::onCreateNewPlanClicked()
|
||||
{
|
||||
const QString errorMessage = tr("Could not save plan: %1").arg(QString::fromStdString(reply.str()));
|
||||
|
||||
ERROR_LOG() << errorMessage;
|
||||
ERROR_LOG(m_logger) << errorMessage;
|
||||
|
||||
new LtsWidgets::LtsMessageDialogNew(this, errorMessage, tr("Save failed"));
|
||||
}
|
||||
|
||||
+2
@@ -48,6 +48,8 @@ class HQReportEdit : public LtsWidgets::LtsDialog
|
||||
void onShiftClicked();
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
Ui::HQReportEdit *m_ui;
|
||||
QString m_menuGroup;
|
||||
LtsSession::LtsSession *m_session{nullptr};
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ FlmHqReportJsonParser::FlmHqReportJsonParser() : m_logger(getLogger("HQReportPar
|
||||
|
||||
HqReportData FlmHqReportJsonParser::parse(const QByteArray &data)
|
||||
{
|
||||
DEBUG_LOG() << "START PARSING";
|
||||
DEBUG_LOG(m_logger) << "START PARSING";
|
||||
QJsonDocument doc = QJsonDocument::fromJson(data);
|
||||
QJsonObject obj = doc.object();
|
||||
HqReportData report;
|
||||
|
||||
+1
@@ -55,5 +55,6 @@ public:
|
||||
QString parseHqReportTime(const QJsonObject &obj);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
}
|
||||
+7
-8
@@ -5,23 +5,22 @@
|
||||
|
||||
namespace FileManagement
|
||||
{
|
||||
FlmHQReportModel::FlmHQReportModel(QObject *parent)
|
||||
: QAbstractListModel(parent)
|
||||
{
|
||||
FlmHQReportModel::FlmHQReportModel(QObject *parent) : QAbstractListModel(parent),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
}
|
||||
|
||||
bool FlmHQReportModel::init(LtsSession::LtsSession *session, int contentFolderId, const FileType &fileType)
|
||||
{
|
||||
if (!session)
|
||||
{
|
||||
ERROR_LOG() << "Got invalid Session";
|
||||
ERROR_LOG(m_logger) << "Got invalid Session";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!session->getDtc<FileManagement::DataInterface>(m_flmDtc))
|
||||
{
|
||||
ERROR_LOG() << "Could not get FLM Dtc";
|
||||
ERROR_LOG(m_logger) << "Could not get FLM Dtc";
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -251,7 +250,7 @@ void FlmHQReportModel::clearMovedData()
|
||||
|
||||
QString FlmHQReportModel::createText(int dataIndex) const
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " dataIndex: " << dataIndex;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " dataIndex: " << dataIndex;
|
||||
|
||||
if (dataIndex < 0 || dataIndex >= m_data.size())
|
||||
return QString();
|
||||
@@ -260,7 +259,7 @@ QString FlmHQReportModel::createText(int dataIndex) const
|
||||
|
||||
if (!m_movedData.contains(data.id))
|
||||
{
|
||||
DEBUG_LOG() << "No moved data for " << data.name;
|
||||
DEBUG_LOG(m_logger) << "No moved data for " << data.name;
|
||||
return data.name;
|
||||
}
|
||||
|
||||
@@ -277,7 +276,7 @@ QString FlmHQReportModel::createText(int dataIndex) const
|
||||
|
||||
void FlmHQReportModel::addMovedData(int dataIndex, const HQData &movedData)
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " dataIndex: " << dataIndex << ", movedData.id: " << movedData.id << ", movedData.name: " << movedData.name;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " dataIndex: " << dataIndex << ", movedData.id: " << movedData.id << ", movedData.name: " << movedData.name;
|
||||
|
||||
if (dataIndex < 0 || dataIndex >= m_data.size())
|
||||
return;
|
||||
|
||||
+2
@@ -73,6 +73,8 @@ public:
|
||||
void clearMovedData();
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
QString createText(int dataIndex) const;
|
||||
void addMovedData(int dataIndex, const HQData &movedData);
|
||||
|
||||
|
||||
+11
-11
@@ -100,24 +100,24 @@ void FileTopicEditor::updatePreview()
|
||||
|
||||
if (m_userText.isEmpty())
|
||||
{
|
||||
DEBUG_LOG() << "file id = " << m_fileId;
|
||||
DEBUG_LOG(m_logger) << "file id = " << m_fileId;
|
||||
m_fileContent = m_dtc->fileContent(m_fileId);
|
||||
m_fileName = QString::fromStdString(m_fileContent.name());
|
||||
m_ui->leFileName->setText(m_fileName);
|
||||
DEBUG_LOG() << "file name = " << m_fileName;
|
||||
DEBUG_LOG(m_logger) << "file name = " << m_fileName;
|
||||
|
||||
if (m_topicData.topicType == TopicEditorBase::TopicType::Pdf)
|
||||
{
|
||||
DEBUG_LOG() << "zoom level = " << m_zoomLevel;
|
||||
DEBUG_LOG(m_logger) << "zoom level = " << m_zoomLevel;
|
||||
m_ui->zoomSlider->setValue(m_zoomLevel);
|
||||
|
||||
DEBUG_LOG() << "rotation = " << m_rotation;
|
||||
DEBUG_LOG(m_logger) << "rotation = " << m_rotation;
|
||||
m_ui->sbRotation->setValue(m_rotation);
|
||||
|
||||
const int pageNo = m_pageNo;
|
||||
m_ui->sbPageNo->setRange(1, m_previewPlaybackWidget->getNumPages());
|
||||
m_pageNo = pageNo;
|
||||
DEBUG_LOG() << "page no = " << m_pageNo;
|
||||
DEBUG_LOG(m_logger) << "page no = " << m_pageNo;
|
||||
m_ui->sbPageNo->setValue(m_pageNo);
|
||||
|
||||
m_ui->sbPageNo->setEnabled(true);
|
||||
@@ -140,13 +140,13 @@ bool FileTopicEditor::fetchInterfaces()
|
||||
{
|
||||
if (!m_session->getForeignGuiInterface<FileManagement::ForeignGuiInterface>(m_guiIfc))
|
||||
{
|
||||
ERROR_LOG() << "Failed to retrieve Flm ForeignGuiInterface";
|
||||
ERROR_LOG(m_logger) << "Failed to retrieve Flm ForeignGuiInterface";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_session->getDtc<FileManagement::DataInterface>(m_dtc))
|
||||
{
|
||||
ERROR_LOG() << "Failed to retrieve Flm Dtc";
|
||||
ERROR_LOG(m_logger) << "Failed to retrieve Flm Dtc";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -386,13 +386,13 @@ void FileTopicEditor::onSelectFile()
|
||||
}
|
||||
else
|
||||
{
|
||||
ERROR_LOG() << "Cannot load file from library";
|
||||
ERROR_LOG(m_logger) << "Cannot load file from library";
|
||||
}
|
||||
}
|
||||
|
||||
void FileTopicEditor::onZoomSliderChanged()
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO;
|
||||
|
||||
m_zoomLevel = m_ui->zoomSlider->value();
|
||||
m_ui->zoomSlider->setToolTip(tr("Zoom %1 %").arg(m_zoomLevel));
|
||||
@@ -402,7 +402,7 @@ void FileTopicEditor::onZoomSliderChanged()
|
||||
|
||||
void FileTopicEditor::onPageNoChanged(int pageNo)
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << "page no = " << pageNo;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "page no = " << pageNo;
|
||||
|
||||
m_pageNo = pageNo;
|
||||
m_ui->sbPageNo->setValue(m_pageNo);
|
||||
@@ -453,7 +453,7 @@ void FileTopicEditor::onEnterText()
|
||||
|
||||
void FileTopicEditor::onRotationChanged(int rotation)
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " rotation = " << rotation;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " rotation = " << rotation;
|
||||
|
||||
m_rotation = rotation;
|
||||
m_ui->sbRotation->setValue(m_rotation);
|
||||
|
||||
+2
@@ -38,6 +38,8 @@ public:
|
||||
bool fetchInterfaces();
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
void updateInternalData() override final;
|
||||
void retranslate() override final;
|
||||
|
||||
|
||||
+83
-83
@@ -87,10 +87,10 @@ bool FileManagementDialogWidget::init(LtsSession::LtsSession *session,
|
||||
int folderId,
|
||||
const QString &xmlType)
|
||||
{
|
||||
DEBUG_LOG() << "Start init FileManagementDialogWidget";
|
||||
DEBUG_LOG(m_logger) << "Start init FileManagementDialogWidget";
|
||||
if (!session)
|
||||
{
|
||||
ERROR_LOG() << "Failed to init FileManagementDialogWidget";
|
||||
ERROR_LOG(m_logger) << "Failed to init FileManagementDialogWidget";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ bool FileManagementDialogWidget::init(LtsSession::LtsSession *session,
|
||||
<< tr("Name"));
|
||||
|
||||
|
||||
DEBUG_LOG() << "Start init model folder";
|
||||
DEBUG_LOG(m_logger) << "Start init model folder";
|
||||
m_modelFolder->init(m_session, m_isAdminMode);
|
||||
int opId = LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
|
||||
if (m_dialogMode == FileDialogMode::Admin)
|
||||
@@ -159,7 +159,7 @@ bool FileManagementDialogWidget::init(LtsSession::LtsSession *session,
|
||||
|
||||
m_modelFile = new DialogModelFile(this);
|
||||
|
||||
DEBUG_LOG() << "Start init model file content";
|
||||
DEBUG_LOG(m_logger) << "Start init model file content";
|
||||
|
||||
auto predicate = [this](const FileManagement::FileContent &fc, const QString &xmlType)
|
||||
{
|
||||
@@ -196,7 +196,7 @@ bool FileManagementDialogWidget::init(LtsSession::LtsSession *session,
|
||||
|
||||
if (m_dialogMode == FileDialogMode::OpenFile || m_dialogMode == FileDialogMode::SaveFile)
|
||||
{
|
||||
DEBUG_LOG() << "Init dialog for open/save modal dialog";
|
||||
DEBUG_LOG(m_logger) << "Init dialog for open/save modal dialog";
|
||||
|
||||
|
||||
connect(m_ui->widgetFiles, &LtsDataView::LtsDataView::signalDoubleClicked, this, &FileManagementDialogWidget::onSelectFile);
|
||||
@@ -306,7 +306,7 @@ bool FileManagementDialogWidget::init(LtsSession::LtsSession *session,
|
||||
|
||||
if (m_dialogMode == FileDialogMode::SaveFile)
|
||||
{
|
||||
DEBUG_LOG() << "DialogMode Save";
|
||||
DEBUG_LOG(m_logger) << "DialogMode Save";
|
||||
m_ui->leFile->setEnabled(true);
|
||||
connect(m_ui->leFile, &QLineEdit::textChanged, this, &FileManagementDialogWidget::saveFileName);
|
||||
}
|
||||
@@ -333,7 +333,7 @@ bool FileManagementDialogWidget::init(LtsSession::LtsSession *session,
|
||||
|
||||
void FileManagementDialogWidget::saveFileName(const QString &name)
|
||||
{
|
||||
DEBUG_LOG() << "Saving: " << name;
|
||||
DEBUG_LOG(m_logger) << "Saving: " << name;
|
||||
|
||||
m_fileName = name;
|
||||
m_selectedFileContent = m_modelFile->findFileFromName(name);
|
||||
@@ -431,9 +431,9 @@ void FileManagementDialogWidget::enaDisa()
|
||||
m_selectedFolderId = 0;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "enableRemoveFolder=" << enableRemoveFolder;
|
||||
DEBUG_LOG() << "enableEditFolder=" << enableEditFolder;
|
||||
DEBUG_LOG() << "userHasRightsToEditFolder=" << userHasRightsToEditFolder;
|
||||
DEBUG_LOG(m_logger) << "enableRemoveFolder=" << enableRemoveFolder;
|
||||
DEBUG_LOG(m_logger) << "enableEditFolder=" << enableEditFolder;
|
||||
DEBUG_LOG(m_logger) << "userHasRightsToEditFolder=" << userHasRightsToEditFolder;
|
||||
|
||||
m_actionAddFolder->setEnabled(enableAddFolder && userHasRightsToEditFolder);
|
||||
m_actionRemoveFolder->setEnabled(enableRemoveFolder && userHasRightsToEditFolder);
|
||||
@@ -539,7 +539,7 @@ void FileManagementDialogWidget::enaDisa()
|
||||
|
||||
bool FileManagementDialogWidget::isFolderRemovable(const QModelIndex &idx) const
|
||||
{
|
||||
DEBUG_LOG() << "isFolderRemovable index = " << idx.row();
|
||||
DEBUG_LOG(m_logger) << "isFolderRemovable index = " << idx.row();
|
||||
|
||||
if (!idx.isValid())
|
||||
return false;
|
||||
@@ -578,7 +578,7 @@ void FileManagementDialogWidget::onReject()
|
||||
|
||||
void FileManagementDialogWidget::onAddFolder()
|
||||
{
|
||||
DEBUG_LOG() << "onAddFolder";
|
||||
DEBUG_LOG(m_logger) << "onAddFolder";
|
||||
|
||||
QModelIndex selIndex = selectedIndexViewFolder();
|
||||
if (!selIndex.isValid())
|
||||
@@ -603,7 +603,7 @@ void FileManagementDialogWidget::onAddFolder()
|
||||
|
||||
void FileManagementDialogWidget::onPasteFolder()
|
||||
{
|
||||
DEBUG_LOG() << "onPasteFolder";
|
||||
DEBUG_LOG(m_logger) << "onPasteFolder";
|
||||
|
||||
QModelIndex selIndex = selectedIndexViewFolder();
|
||||
if (!selIndex.isValid())
|
||||
@@ -626,7 +626,7 @@ void FileManagementDialogWidget::onPasteFolder()
|
||||
|
||||
void FileManagementDialogWidget::onPasteFile()
|
||||
{
|
||||
DEBUG_LOG() << "onPasteFile";
|
||||
DEBUG_LOG(m_logger) << "onPasteFile";
|
||||
|
||||
if (m_selectedFolderId > 0 && m_copyFile.id() > 0)
|
||||
{
|
||||
@@ -697,7 +697,7 @@ void FileManagementDialogWidget::onPasteFile()
|
||||
|
||||
void FileManagementDialogWidget::onRemoveFolder()
|
||||
{
|
||||
DEBUG_LOG() << "onRemoveFolder id = " << m_selectedFolderId;
|
||||
DEBUG_LOG(m_logger) << "onRemoveFolder id = " << m_selectedFolderId;
|
||||
|
||||
QModelIndex selIndex = selectedIndexViewFolder();
|
||||
if (!selIndex.isValid())
|
||||
@@ -715,7 +715,7 @@ void FileManagementDialogWidget::onRemoveFolder()
|
||||
|
||||
if (isFolderRemovable(selIndex))
|
||||
{
|
||||
DEBUG_LOG() << "Removing folder id = " << m_selectedFolderId;
|
||||
DEBUG_LOG(m_logger) << "Removing folder id = " << m_selectedFolderId;
|
||||
|
||||
Core::RemoveElementRequest req(m_selectedFolderId);
|
||||
m_requestHelper->startSingleRequest([req, this]()
|
||||
@@ -723,21 +723,21 @@ void FileManagementDialogWidget::onRemoveFolder()
|
||||
return m_ftc->folderRemoveRequest(req, this);
|
||||
});
|
||||
if (m_requestHelper->failed())
|
||||
ERROR_LOG() << "Failed to remove folder id = " << m_selectedFolderId;
|
||||
ERROR_LOG(m_logger) << "Failed to remove folder id = " << m_selectedFolderId;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void FileManagementDialogWidget::removeCurrentRowFolder()
|
||||
{
|
||||
DEBUG_LOG() << "removeCurrentRowFolder";
|
||||
DEBUG_LOG(m_logger) << "removeCurrentRowFolder";
|
||||
|
||||
QModelIndex selIndex = selectedIndexViewFolder();
|
||||
NGLTreeItem *item = m_modelFolder->privateData(selIndex);
|
||||
FileManagement::Folder fld = item->data().value<FileManagement::Folder>();
|
||||
bool isRootFolder = (fld.id() == 0);
|
||||
|
||||
DEBUG_LOG() << "isRootFolder = " << isRootFolder;
|
||||
DEBUG_LOG(m_logger) << "isRootFolder = " << isRootFolder;
|
||||
|
||||
if (!selIndex.isValid() || isRootFolder)
|
||||
return;
|
||||
@@ -754,7 +754,7 @@ QString FileManagementDialogWidget::getTemplateFile(const QString &fileName)
|
||||
|
||||
void FileManagementDialogWidget::onRefreshFolders()
|
||||
{
|
||||
DEBUG_LOG() << "onRefreshFolders";
|
||||
DEBUG_LOG(m_logger) << "onRefreshFolders";
|
||||
|
||||
m_modelFolder->initModel(m_session->exerciseId(), m_isAdminMode);
|
||||
m_ui->tvFolder->expandAll();
|
||||
@@ -766,7 +766,7 @@ void FileManagementDialogWidget::onRefreshFolders()
|
||||
|
||||
void FileManagementDialogWidget::onCopyFolder()
|
||||
{
|
||||
DEBUG_LOG() << "onCopyFolder";
|
||||
DEBUG_LOG(m_logger) << "onCopyFolder";
|
||||
|
||||
QModelIndex selIndex = selectedIndexViewFolder();
|
||||
NGLTreeItem *item = m_modelFolder->privateData(selIndex);
|
||||
@@ -779,7 +779,7 @@ void FileManagementDialogWidget::onCopyFolder()
|
||||
|
||||
void FileManagementDialogWidget::onCopyFile()
|
||||
{
|
||||
DEBUG_LOG() << "onCopyFile";
|
||||
DEBUG_LOG(m_logger) << "onCopyFile";
|
||||
|
||||
m_copyFile = m_modelFile->getRowData(m_ui->widgetFiles->currentIndex().row());
|
||||
|
||||
@@ -791,7 +791,7 @@ void FileManagementDialogWidget::onCopyFile()
|
||||
|
||||
void FileManagementDialogWidget::onCutFolder()
|
||||
{
|
||||
DEBUG_LOG() << "onCutFolder";
|
||||
DEBUG_LOG(m_logger) << "onCutFolder";
|
||||
|
||||
QModelIndex selIndex = selectedIndexViewFolder();
|
||||
NGLTreeItem *item = m_modelFolder->privateData(selIndex);
|
||||
@@ -806,7 +806,7 @@ void FileManagementDialogWidget::onCutFolder()
|
||||
|
||||
void FileManagementDialogWidget::onCutFile()
|
||||
{
|
||||
DEBUG_LOG() << "onCutFile";
|
||||
DEBUG_LOG(m_logger) << "onCutFile";
|
||||
|
||||
m_copyFile = m_modelFile->getRowData(m_ui->widgetFiles->currentIndex().row());
|
||||
|
||||
@@ -820,7 +820,7 @@ void FileManagementDialogWidget::onCutFile()
|
||||
|
||||
void FileManagementDialogWidget::onEditFolder()
|
||||
{
|
||||
DEBUG_LOG() << "onEditFolder Id = " << m_selectedFolderId;
|
||||
DEBUG_LOG(m_logger) << "onEditFolder Id = " << m_selectedFolderId;
|
||||
|
||||
if (!m_actionRenameFolder->isEnabled())
|
||||
return;
|
||||
@@ -862,7 +862,7 @@ void FileManagementDialogWidget::onRemoveFile()
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "onRemoveFile";
|
||||
DEBUG_LOG(m_logger) << "onRemoveFile";
|
||||
|
||||
FileManagement::FileContent data = m_modelFile->getRowData(selIndex.row());
|
||||
Core::RemoveElementRequest req(data.id());
|
||||
@@ -872,7 +872,7 @@ void FileManagementDialogWidget::onRemoveFile()
|
||||
});
|
||||
|
||||
if (m_requestHelper->failed())
|
||||
ERROR_LOG() << "Failed to remove file content";
|
||||
ERROR_LOG(m_logger) << "Failed to remove file content";
|
||||
else
|
||||
reInitModelFile();
|
||||
}
|
||||
@@ -884,7 +884,7 @@ void FileManagementDialogWidget::onDeleteFile()
|
||||
if (!selIndex.isValid())
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "onDeleteFile";
|
||||
DEBUG_LOG(m_logger) << "onDeleteFile";
|
||||
|
||||
m_requestHelper->startSingleRequest([this]()
|
||||
{
|
||||
@@ -893,7 +893,7 @@ void FileManagementDialogWidget::onDeleteFile()
|
||||
if (data.fileStatus() == FileManagement::FileStatus::Deleted)
|
||||
return int64_t(0);
|
||||
|
||||
DEBUG_LOG() << "Deleting file id = " << data.id();
|
||||
DEBUG_LOG(m_logger) << "Deleting file id = " << data.id();
|
||||
|
||||
FileManagement::FileContentChangeStatusRequest req;
|
||||
req.id(data.id());
|
||||
@@ -906,7 +906,7 @@ void FileManagementDialogWidget::onDeleteFile()
|
||||
});
|
||||
|
||||
if (m_requestHelper->failed())
|
||||
ERROR_LOG() << "Failed to change status file content";
|
||||
ERROR_LOG(m_logger) << "Failed to change status file content";
|
||||
else
|
||||
reInitModelFile();
|
||||
}
|
||||
@@ -921,7 +921,7 @@ void FileManagementDialogWidget::reInitModelFile(bool restoreSelected)
|
||||
if (selIndex.isValid())
|
||||
{
|
||||
selectedFileId = m_modelFile->getRowData(selIndex.row()).id();
|
||||
ERROR_LOG() << "Selected file id = " << selectedFileId;
|
||||
ERROR_LOG(m_logger) << "Selected file id = " << selectedFileId;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -938,7 +938,7 @@ void FileManagementDialogWidget::reInitModelFile(bool restoreSelected)
|
||||
|
||||
if (restoreSelected && selectedFileId > 0)
|
||||
{
|
||||
DEBUG_LOG() << "Restoring selection on file " << selectedFileId;
|
||||
DEBUG_LOG(m_logger) << "Restoring selection on file " << selectedFileId;
|
||||
QModelIndex idx = m_modelFile->findIndexForId(selectedFileId);
|
||||
if (idx.isValid())
|
||||
m_ui->widgetFiles->setCurrentIndex(idx);
|
||||
@@ -952,7 +952,7 @@ void FileManagementDialogWidget::onRestoreFile()
|
||||
if (!selIndex.isValid())
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "onRestoreFile";
|
||||
DEBUG_LOG(m_logger) << "onRestoreFile";
|
||||
|
||||
m_requestHelper->startSingleRequest([this]()
|
||||
{
|
||||
@@ -961,7 +961,7 @@ void FileManagementDialogWidget::onRestoreFile()
|
||||
if (data.fileStatus() == FileManagement::FileStatus::Valid)
|
||||
return int64_t(0);
|
||||
|
||||
DEBUG_LOG() << "Deleting file id = " << data.id();
|
||||
DEBUG_LOG(m_logger) << "Deleting file id = " << data.id();
|
||||
|
||||
FileManagement::FileContentChangeStatusRequest req;
|
||||
req.id(data.id());
|
||||
@@ -974,7 +974,7 @@ void FileManagementDialogWidget::onRestoreFile()
|
||||
});
|
||||
|
||||
if (m_requestHelper->failed())
|
||||
ERROR_LOG() << "Failed to change status file content";
|
||||
ERROR_LOG(m_logger) << "Failed to change status file content";
|
||||
else
|
||||
reInitModelFile();
|
||||
}
|
||||
@@ -982,7 +982,7 @@ void FileManagementDialogWidget::onRestoreFile()
|
||||
|
||||
void FileManagementDialogWidget::onEditFile()
|
||||
{
|
||||
DEBUG_LOG() << "onEditFileContent";
|
||||
DEBUG_LOG(m_logger) << "onEditFileContent";
|
||||
|
||||
if (!m_actionEditFile->isEnabled())
|
||||
return;
|
||||
@@ -992,7 +992,7 @@ void FileManagementDialogWidget::onEditFile()
|
||||
return;
|
||||
|
||||
FileManagement::FileContent data = m_modelFile->getRowData(m_ui->widgetFiles->currentIndex().row());
|
||||
DEBUG_LOG() << "onEditFileContent Id = " << data.id();
|
||||
DEBUG_LOG(m_logger) << "onEditFileContent Id = " << data.id();
|
||||
|
||||
m_getContent->getContent(data.id(), m_content);
|
||||
|
||||
@@ -1015,7 +1015,7 @@ void FileManagementDialogWidget::onEditFile()
|
||||
|
||||
void FileManagementDialogWidget::onImportFile()
|
||||
{
|
||||
DEBUG_LOG() << "onImportFile";
|
||||
DEBUG_LOG(m_logger) << "onImportFile";
|
||||
|
||||
|
||||
const QStringList filter(
|
||||
@@ -1057,7 +1057,7 @@ void FileManagementDialogWidget::onImportFile()
|
||||
QFile file(fileName);
|
||||
if (!file.open(QIODevice::ReadOnly))
|
||||
{
|
||||
ERROR_LOG() << "Cannot read file " << fileName;
|
||||
ERROR_LOG(m_logger) << "Cannot read file " << fileName;
|
||||
return;
|
||||
}
|
||||
QByteArray fileContent = file.readAll();
|
||||
@@ -1098,7 +1098,7 @@ void FileManagementDialogWidget::onImportFile()
|
||||
phId = 0;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "Exercise id = " << exId << ", phase Id = " << phId;
|
||||
DEBUG_LOG(m_logger) << "Exercise id = " << exId << ", phase Id = " << phId;
|
||||
|
||||
if (exId > 0)
|
||||
data.exerciseId(exId);
|
||||
@@ -1150,7 +1150,7 @@ void FileManagementDialogWidget::createNewOfficeFile(const QString &fileName)
|
||||
QFile file(absFilePath);
|
||||
if (!file.open(QIODevice::ReadOnly))
|
||||
{
|
||||
ERROR_LOG() << "Cannot read file " << absFilePath;
|
||||
ERROR_LOG(m_logger) << "Cannot read file " << absFilePath;
|
||||
return;
|
||||
}
|
||||
QByteArray fileContent = file.readAll();
|
||||
@@ -1271,7 +1271,7 @@ void FileManagementDialogWidget::onNewFileFromTemplate()
|
||||
|
||||
void FileManagementDialogWidget::onFolderSelectionChanged()
|
||||
{
|
||||
DEBUG_LOG() << "onFolderSelectionChanged";
|
||||
DEBUG_LOG(m_logger) << "onFolderSelectionChanged";
|
||||
enaDisa();
|
||||
|
||||
reInitModelFile();
|
||||
@@ -1352,7 +1352,7 @@ void FileManagementDialogWidget::fileContextMenuRequested(const QPoint &position
|
||||
|
||||
void FileManagementDialogWidget::onFolderChanged(const FileManagement::Folder &data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG() << "onFolderChanged: folder name = " << data.name();
|
||||
DEBUG_LOG(m_logger) << "onFolderChanged: folder name = " << data.name();
|
||||
|
||||
|
||||
Q_UNUSED(data);
|
||||
@@ -1388,12 +1388,12 @@ FileManagement::FileType FileManagementDialogWidget::getFileType(const QString &
|
||||
|
||||
void FileManagementDialogWidget::onPreviewFile()
|
||||
{
|
||||
DEBUG_LOG() << "onPreviewFile";
|
||||
DEBUG_LOG(m_logger) << "onPreviewFile";
|
||||
|
||||
QModelIndex selIndex = m_ui->widgetFiles->currentIndex();
|
||||
if (!selIndex.isValid())
|
||||
{
|
||||
ERROR_LOG() << "No valid selected file for preview!";
|
||||
ERROR_LOG(m_logger) << "No valid selected file for preview!";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1499,25 +1499,25 @@ QString FileManagementDialogWidget::getFileTypeStr(FileManagement::FileType file
|
||||
|
||||
void FileManagementDialogWidget::onExportFile()
|
||||
{
|
||||
DEBUG_LOG() << "onExportFile(): fileName = " << m_fileName;
|
||||
DEBUG_LOG(m_logger) << "onExportFile(): fileName = " << m_fileName;
|
||||
|
||||
|
||||
static QString defaultPath = QDir::homePath() + QStringLiteral("/scanner/");
|
||||
DEBUG_LOG() << "onExportFile(): old path = " << defaultPath;
|
||||
DEBUG_LOG(m_logger) << "onExportFile(): old path = " << defaultPath;
|
||||
|
||||
QString folderName = QFileDialog::getExistingDirectory(this,
|
||||
tr("Save file from library to local Workstation"),
|
||||
defaultPath,
|
||||
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
|
||||
DEBUG_LOG() << "onExportFile(): folderName = " << folderName;
|
||||
DEBUG_LOG(m_logger) << "onExportFile(): folderName = " << folderName;
|
||||
if (folderName.isEmpty())
|
||||
{
|
||||
DEBUG_LOG() << "onExportFile(): folderName.isEmpty()";
|
||||
DEBUG_LOG(m_logger) << "onExportFile(): folderName.isEmpty()";
|
||||
return;
|
||||
}
|
||||
|
||||
m_getContent->getContent(m_selectedFileContent.id(), m_content);
|
||||
DEBUG_LOG() << "onExportFile(): Save File to '" << folderName << "/" << m_fileName << "'"
|
||||
DEBUG_LOG(m_logger) << "onExportFile(): Save File to '" << folderName << "/" << m_fileName << "'"
|
||||
<< " fileType = " << m_selectedFileContent.fileType()
|
||||
<< " getFileTypeStr = " << getFileTypeStr(m_selectedFileContent.fileType())
|
||||
<< " exportFileName = " << m_selectedFileContent.exportFileName()
|
||||
@@ -1532,14 +1532,14 @@ void FileManagementDialogWidget::onExportFile()
|
||||
|
||||
if (file.exists())
|
||||
{
|
||||
DEBUG_LOG() << "onExportFile(): File already exists (" << completeFileName << ") in folder " << folderName;
|
||||
DEBUG_LOG(m_logger) << "onExportFile(): File already exists (" << completeFileName << ") in folder " << folderName;
|
||||
if (LtsWidgets::LtsMessageDialog::showMessage(this, tr("Yes - overwrite file.<br>"
|
||||
"No - do not overwrite file.<br>"),
|
||||
tr("Do you want to overwrite the existing file?"),
|
||||
LtsWidgets::Behaviour::Modal,
|
||||
LtsWidgets::Button::Yes | LtsWidgets::Button::No) != LtsWidgets::Button::Yes)
|
||||
{
|
||||
DEBUG_LOG() << "onExportFile(): File exists, will not be overwritten (" << completeFileName << ") in folder " << folderName;
|
||||
DEBUG_LOG(m_logger) << "onExportFile(): File exists, will not be overwritten (" << completeFileName << ") in folder " << folderName;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1548,13 +1548,13 @@ void FileManagementDialogWidget::onExportFile()
|
||||
file.write(LtsUtils::toQByteArray(m_content));
|
||||
file.close();
|
||||
|
||||
DEBUG_LOG() << "onExportFile(): Exported file " << completeFileName << " in folder " << folderName;
|
||||
DEBUG_LOG(m_logger) << "onExportFile(): Exported file " << completeFileName << " in folder " << folderName;
|
||||
}
|
||||
|
||||
|
||||
void FileManagementDialogWidget::onSelectFile()
|
||||
{
|
||||
DEBUG_LOG() << "onSelectFile";
|
||||
DEBUG_LOG(m_logger) << "onSelectFile";
|
||||
|
||||
QModelIndex selIndex = m_ui->widgetFiles->currentIndex();
|
||||
|
||||
@@ -1563,18 +1563,18 @@ void FileManagementDialogWidget::onSelectFile()
|
||||
|
||||
m_selectedFileContent = m_modelFile->getRowData(selIndex.row());
|
||||
|
||||
DEBUG_LOG() << "Selected file content id = " << m_selectedFileContent.id();
|
||||
DEBUG_LOG(m_logger) << "Selected file content id = " << m_selectedFileContent.id();
|
||||
emit accepted();
|
||||
}
|
||||
|
||||
|
||||
void FileManagementDialogWidget::onChooseFileName()
|
||||
{
|
||||
DEBUG_LOG() << "onChooseFileName";
|
||||
DEBUG_LOG(m_logger) << "onChooseFileName";
|
||||
|
||||
if ((FileDialogMode::SaveFile == m_dialogMode) && (!m_fileName.isEmpty()))
|
||||
{
|
||||
DEBUG_LOG() << "Choosen file name = " << m_fileName;
|
||||
DEBUG_LOG(m_logger) << "Choosen file name = " << m_fileName;
|
||||
emit accepted();
|
||||
}
|
||||
}
|
||||
@@ -1583,7 +1583,7 @@ void FileManagementDialogWidget::onChooseFileName()
|
||||
void FileManagementDialogWidget::onFileChanged(const FileManagement::FileContent &data, DataModification modType)
|
||||
{
|
||||
bool condition = showFile(data, m_xmlType);
|
||||
DEBUG_LOG() << "onFileChanged file name = " << data.name() << ", condition = " << condition << ", modType = " << modType;
|
||||
DEBUG_LOG(m_logger) << "onFileChanged file name = " << data.name() << ", condition = " << condition << ", modType = " << modType;
|
||||
|
||||
bool reInit = false;
|
||||
int row = 0;
|
||||
@@ -1627,19 +1627,19 @@ bool FileManagementDialogWidget::showFile(const FileManagement::FileContent &fc,
|
||||
{
|
||||
if (fc.isDeleted())
|
||||
{
|
||||
DEBUG_LOG() << "is deleted: " << fc.name().c_str();
|
||||
DEBUG_LOG(m_logger) << "is deleted: " << fc.name().c_str();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (fc.folderId() != m_selectedFolderId)
|
||||
{
|
||||
DEBUG_LOG() << "Folder id does not match: " << fc.name().c_str();
|
||||
DEBUG_LOG(m_logger) << "Folder id does not match: " << fc.name().c_str();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_fileTypes.isEmpty() && !m_fileTypes.contains(fc.fileType()))
|
||||
{
|
||||
DEBUG_LOG() << "file type does not match: " << fc.name().c_str();
|
||||
DEBUG_LOG(m_logger) << "file type does not match: " << fc.name().c_str();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1647,7 +1647,7 @@ bool FileManagementDialogWidget::showFile(const FileManagement::FileContent &fc,
|
||||
{
|
||||
if (fc.fileStatus() != FileManagement::FileStatus::Valid)
|
||||
{
|
||||
DEBUG_LOG() << "file status is not valid: " << fc.name().c_str();
|
||||
DEBUG_LOG(m_logger) << "file status is not valid: " << fc.name().c_str();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1662,16 +1662,16 @@ bool FileManagementDialogWidget::showFile(const FileManagement::FileContent &fc,
|
||||
{
|
||||
const int operatorId = LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
|
||||
|
||||
DEBUG_LOG() << "Filtering files on OperatorId = " << operatorId;
|
||||
DEBUG_LOG(m_logger) << "Filtering files on OperatorId = " << operatorId;
|
||||
if (fc.operatorId() != operatorId)
|
||||
{
|
||||
DEBUG_LOG() << "operator id does not match: " << fc.name().c_str();
|
||||
DEBUG_LOG(m_logger) << "operator id does not match: " << fc.name().c_str();
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "Filtering files on User Category";
|
||||
DEBUG_LOG(m_logger) << "Filtering files on User Category";
|
||||
if (fc.fileCategory() != FileManagement::FileCategory::User)
|
||||
{
|
||||
DEBUG_LOG() << "User category does not match: " << fc.name().c_str();
|
||||
DEBUG_LOG(m_logger) << "User category does not match: " << fc.name().c_str();
|
||||
|
||||
|
||||
}
|
||||
@@ -1680,7 +1680,7 @@ bool FileManagementDialogWidget::showFile(const FileManagement::FileContent &fc,
|
||||
{
|
||||
if (fc.exerciseId().is_set() && fc.exerciseId().get() != m_session->exerciseId())
|
||||
{
|
||||
DEBUG_LOG() << "exercise does not match: " << fc.name().c_str() << " is: " << fc.exerciseId()
|
||||
DEBUG_LOG(m_logger) << "exercise does not match: " << fc.name().c_str() << " is: " << fc.exerciseId()
|
||||
<< " should be " << m_session->exerciseId();
|
||||
return false;
|
||||
}
|
||||
@@ -1691,19 +1691,19 @@ bool FileManagementDialogWidget::showFile(const FileManagement::FileContent &fc,
|
||||
if (fldPath.contains(FileManagement::MainFolder::ExerciseDocuments))
|
||||
{
|
||||
|
||||
DEBUG_LOG() << "Filtering files on Exercise Category";
|
||||
DEBUG_LOG(m_logger) << "Filtering files on Exercise Category";
|
||||
if (fc.fileCategory() != FileManagement::FileCategory::Exercise)
|
||||
{
|
||||
DEBUG_LOG() << "exercise category does not match: " << fc.name().c_str();
|
||||
DEBUG_LOG(m_logger) << "exercise category does not match: " << fc.name().c_str();
|
||||
return false;
|
||||
}
|
||||
if (m_session->exerciseId() > 0)
|
||||
{
|
||||
|
||||
DEBUG_LOG() << "Filtering files on Exercise Category and exerciseId = " << m_session->exerciseId();
|
||||
DEBUG_LOG(m_logger) << "Filtering files on Exercise Category and exerciseId = " << m_session->exerciseId();
|
||||
if (fc.exerciseId().is_set() && fc.exerciseId().get() != m_session->exerciseId())
|
||||
{
|
||||
DEBUG_LOG() << "exercise does not match: " << fc.name().c_str() << " is: " << fc.exerciseId()
|
||||
DEBUG_LOG(m_logger) << "exercise does not match: " << fc.name().c_str() << " is: " << fc.exerciseId()
|
||||
<< " should be " << m_session->exerciseId();
|
||||
return false;
|
||||
}
|
||||
@@ -1716,7 +1716,7 @@ bool FileManagementDialogWidget::showFile(const FileManagement::FileContent &fc,
|
||||
const QString &prop = QString::fromStdString(fc.properties());
|
||||
if (!prop.contains(xmlType, Qt::CaseSensitive))
|
||||
{
|
||||
DEBUG_LOG() << "XmlType not found " << xmlType;
|
||||
DEBUG_LOG(m_logger) << "XmlType not found " << xmlType;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1761,7 +1761,7 @@ FileManagementDialogTab::FileManagementDialogTab(const QString &menuGroup, QWidg
|
||||
if (menuGroup == tr("Exercise Documents"))
|
||||
|
||||
setOnlineHelpFilename(QStringLiteral("Situation-Library_Organisation"));
|
||||
DEBUG_LOG() << "Ctor FileManagementDialogTab";
|
||||
DEBUG_LOG(m_logger) << "Ctor FileManagementDialogTab";
|
||||
|
||||
LtsWidgets::DialogButton btnAddFolder = LtsWidgets::DialogButton::Print;
|
||||
LtsWidgets::DialogButton btnEditFolder = LtsWidgets::DialogButton::Import;
|
||||
@@ -1857,7 +1857,7 @@ FileManagementDialog::FileManagementDialog(QWidget *parent)
|
||||
, m_buttonBox(new LtsWidgets::LtsDialogButtonBox(this))
|
||||
, m_dialogMode(FileDialogMode::OpenFile)
|
||||
{
|
||||
DEBUG_LOG() << "Ctor FileManagementDialog";
|
||||
DEBUG_LOG(m_logger) << "Ctor FileManagementDialog";
|
||||
|
||||
LtsWidgets::DialogButton btnAddFolder = LtsWidgets::DialogButton::Print;
|
||||
LtsWidgets::DialogButton btnSelectFile = LtsWidgets::DialogButton::Load;
|
||||
@@ -1888,11 +1888,11 @@ bool FileManagementDialogTab::init(LtsSession::LtsSession *session,
|
||||
const int &folderId,
|
||||
const QString &buttonName)
|
||||
{
|
||||
DEBUG_LOG() << "Start init FileManagementDialogTab";
|
||||
DEBUG_LOG(m_logger) << "Start init FileManagementDialogTab";
|
||||
|
||||
if (!m_editItemWidget->init(session, dlgMode, fileTypes, folderId))
|
||||
{
|
||||
ERROR_LOG() << "Init FileManagementDialogTab failed!";
|
||||
ERROR_LOG(m_logger) << "Init FileManagementDialogTab failed!";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1937,12 +1937,12 @@ bool FileManagementDialog::init(LtsSession::LtsSession *session,
|
||||
int folderId,
|
||||
const QString &xmlType)
|
||||
{
|
||||
DEBUG_LOG() << "Start init FileManagementDialog";
|
||||
DEBUG_LOG() << "Initial folder to select: " << folderId;
|
||||
DEBUG_LOG(m_logger) << "Start init FileManagementDialog";
|
||||
DEBUG_LOG(m_logger) << "Initial folder to select: " << folderId;
|
||||
|
||||
if (!m_editItemWidget->init(session, dlgMode, fileTypes, folderId, xmlType))
|
||||
{
|
||||
ERROR_LOG() << "Init FileManagementDialogWidget failed!";
|
||||
ERROR_LOG(m_logger) << "Init FileManagementDialogWidget failed!";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1981,7 +1981,7 @@ void FileManagementDialog::accept()
|
||||
|
||||
void FileManagementDialog::enaDisa()
|
||||
{
|
||||
DEBUG_LOG() << "FileManagementDialog::enaDisa()";
|
||||
DEBUG_LOG(m_logger) << "FileManagementDialog::enaDisa()";
|
||||
|
||||
LtsWidgets::DialogButton btnAddFolder = LtsWidgets::DialogButton::Print;
|
||||
m_buttonBox->setButtonEnabled(btnAddFolder, false);
|
||||
@@ -1997,8 +1997,8 @@ void FileManagementDialog::enaDisa()
|
||||
if (m_dialogMode == FileDialogMode::OpenFile && idxFile.isValid())
|
||||
m_buttonBox->setButtonEnabled(btnSelectFile, true);
|
||||
|
||||
DEBUG_LOG() << "DialogMode: " << (int)m_dialogMode;
|
||||
DEBUG_LOG() << "FileName: " << m_editItemWidget->m_fileName;
|
||||
DEBUG_LOG(m_logger) << "DialogMode: " << (int)m_dialogMode;
|
||||
DEBUG_LOG(m_logger) << "FileName: " << m_editItemWidget->m_fileName;
|
||||
|
||||
if (m_dialogMode == FileDialogMode::SaveFile && !m_editItemWidget->m_fileName.isEmpty())
|
||||
m_buttonBox->setButtonEnabled(btnSelectFile, true);
|
||||
@@ -2007,7 +2007,7 @@ void FileManagementDialog::enaDisa()
|
||||
|
||||
void FileManagementDialogTab::enaDisa()
|
||||
{
|
||||
DEBUG_LOG() << "FileManagementDialogTab::enaDisa()";
|
||||
DEBUG_LOG(m_logger) << "FileManagementDialogTab::enaDisa()";
|
||||
|
||||
LtsWidgets::DialogButton btnAddFolder = LtsWidgets::DialogButton::Print;
|
||||
LtsWidgets::DialogButton btnEditFolder = LtsWidgets::DialogButton::Import;
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ bool DialogModelFile::initModel(LtsSession::LtsSession *session,
|
||||
insertRow(fc);
|
||||
};
|
||||
m_flmDtc->fileContents(files);
|
||||
DEBUG_LOG() << "initModel - #Files: " << m_vecData.size();
|
||||
DEBUG_LOG(m_logger) << "initModel - #Files: " << m_vecData.size();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -54,6 +54,8 @@ public:
|
||||
FileManagement::FileContent findFileFromName(const QString &fileName) const;
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<FileManagement::Interface::Dtc> m_flmDtc;
|
||||
std::shared_ptr<OperatorManagement::Interface::Dtc> m_opmDtc;
|
||||
std::shared_ptr<ExerciseManagement::Interface::Dtc> m_exmDtc;
|
||||
|
||||
+8
-8
@@ -179,7 +179,7 @@ bool DialogModelFolder::isRowRemovable(const NGLTreeItem *parentItem) const
|
||||
|
||||
bool DialogModelFolder::initModel(int exerciseId, bool isAdminMode)
|
||||
{
|
||||
DEBUG_LOG() << "initModel Folder";
|
||||
DEBUG_LOG(m_logger) << "initModel Folder";
|
||||
|
||||
NGLTreeModel::resetModel();
|
||||
|
||||
@@ -199,7 +199,7 @@ bool DialogModelFolder::initModel(int exerciseId, bool isAdminMode)
|
||||
int exId = folderName.remove(0, 4).toInt();
|
||||
if ((exerciseId > 0 && exId != exerciseId) || exId != m_exmDtc->exercise(exId).id())
|
||||
{
|
||||
DEBUG_LOG() << "Excluded exercise id " << exId << ", folder id " << data.id();
|
||||
DEBUG_LOG(m_logger) << "Excluded exercise id " << exId << ", folder id " << data.id();
|
||||
idsToExclude.append(data.id());
|
||||
}
|
||||
}
|
||||
@@ -229,8 +229,8 @@ bool DialogModelFolder::initModel(int exerciseId, bool isAdminMode)
|
||||
|
||||
if (!parentItemIndexCache.contains(parentId))
|
||||
{
|
||||
WARNING_LOG() << "Invalid folder structure, parent may be hidden: " << parentId;
|
||||
WARNING_LOG() << "Folder " << fld.name() << ", hidden: " << fld.isHidden();
|
||||
WARNING_LOG(m_logger) << "Invalid folder structure, parent may be hidden: " << parentId;
|
||||
WARNING_LOG(m_logger) << "Folder " << fld.name() << ", hidden: " << fld.isHidden();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -238,7 +238,7 @@ bool DialogModelFolder::initModel(int exerciseId, bool isAdminMode)
|
||||
int rowPos = -1;
|
||||
onInsertRow(rowPos, pIndex, fld);
|
||||
parentItemIndexCache.insert(folderId, index(rowPos, 0, pIndex));
|
||||
DEBUG_LOG() << "Added to tree (folder id, parent id) : (" << folderId << ", " << parentId << ")";
|
||||
DEBUG_LOG(m_logger) << "Added to tree (folder id, parent id) : (" << folderId << ", " << parentId << ")";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ bool DialogModelFolder::initModel(int exerciseId, bool isAdminMode)
|
||||
|
||||
bool DialogModelFolder::onInsertRow(int &row, const QModelIndex &parent, const FileManagement::Folder &folderData)
|
||||
{
|
||||
DEBUG_LOG() << "onInsertRow";
|
||||
DEBUG_LOG(m_logger) << "onInsertRow";
|
||||
|
||||
row = rowCount(parent);
|
||||
QVariant data;
|
||||
@@ -267,7 +267,7 @@ bool DialogModelFolder::onInsertRow(int &row, const QModelIndex &parent, const F
|
||||
|
||||
bool DialogModelFolder::onUpdateRow(const QModelIndex &index, const FileManagement::Folder &folderData)
|
||||
{
|
||||
DEBUG_LOG() << "onUpdateRow";
|
||||
DEBUG_LOG(m_logger) << "onUpdateRow";
|
||||
|
||||
QVariant data;
|
||||
data.setValue(folderData);
|
||||
@@ -282,7 +282,7 @@ bool DialogModelFolder::onUpdateRow(const QModelIndex &index, const FileManageme
|
||||
|
||||
bool DialogModelFolder::onDeleteRow(const QModelIndex &idx, bool isFirstItem)
|
||||
{
|
||||
DEBUG_LOG() << "onDeleteRow";
|
||||
DEBUG_LOG(m_logger) << "onDeleteRow";
|
||||
|
||||
while (rowCount(idx) > 0)
|
||||
onDeleteRow(NGLTreeModel::index(0, 0, idx), false);
|
||||
|
||||
+2
@@ -63,6 +63,8 @@ Q_SIGNALS:
|
||||
void internalDataChanged();
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<FileManagement::Interface::Dtc> m_flmDtc;
|
||||
std::shared_ptr<FileManagement::Interface::Ftc> m_flmFtc;
|
||||
std::shared_ptr<ExerciseManagement::Interface::Dtc> m_exmDtc;
|
||||
|
||||
+18
-18
@@ -69,7 +69,7 @@ bool FileContentEditDialog::init(LtsSession::LtsSession *session,
|
||||
{
|
||||
if (!session)
|
||||
{
|
||||
ERROR_LOG() << "Failed to init FileContentEditDialog";
|
||||
ERROR_LOG(m_logger) << "Failed to init FileContentEditDialog";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ bool FileContentEditDialog::init(LtsSession::LtsSession *session,
|
||||
|
||||
void FileContentEditDialog::getMetaData()
|
||||
{
|
||||
DEBUG_LOG() << "getMetaData";
|
||||
DEBUG_LOG(m_logger) << "getMetaData";
|
||||
|
||||
m_ui->cbExercises->setCurrentIndex(0);
|
||||
m_ui->cbExercises->setEnabled(false);
|
||||
@@ -186,7 +186,7 @@ void FileContentEditDialog::getMetaData()
|
||||
|
||||
void FileContentEditDialog::setMetaData()
|
||||
{
|
||||
DEBUG_LOG() << "setMetaData";
|
||||
DEBUG_LOG(m_logger) << "setMetaData";
|
||||
|
||||
m_editData.name(m_ui->leName->text().toStdString());
|
||||
m_editData.fileType(static_cast<FileManagement::FileType::type>(m_ui->cbFileType->currentData().toInt()));
|
||||
@@ -219,7 +219,7 @@ void FileContentEditDialog::setMetaData()
|
||||
|
||||
void FileContentEditDialog::onAddItem()
|
||||
{
|
||||
DEBUG_LOG() << "onAddItem";
|
||||
DEBUG_LOG(m_logger) << "onAddItem";
|
||||
|
||||
setMetaData();
|
||||
|
||||
@@ -249,7 +249,7 @@ void FileContentEditDialog::onAddItem()
|
||||
m_editData.exerciseId();
|
||||
m_editData.phaseId();
|
||||
}
|
||||
DEBUG_LOG() << "onAddItem: Content size = " << m_content.size();
|
||||
DEBUG_LOG(m_logger) << "onAddItem: Content size = " << m_content.size();
|
||||
data.content(m_content);
|
||||
|
||||
data.operatorId(LtsSessionData::LtsSessionData::getInstance()->getOperatorId());
|
||||
@@ -266,7 +266,7 @@ void FileContentEditDialog::onAddItem()
|
||||
|
||||
void FileContentEditDialog::onEditItem()
|
||||
{
|
||||
DEBUG_LOG() << "onEditItem";
|
||||
DEBUG_LOG(m_logger) << "onEditItem";
|
||||
|
||||
setMetaData();
|
||||
|
||||
@@ -300,10 +300,10 @@ void FileContentEditDialog::onEditItem()
|
||||
data.operatorId(LtsSessionData::LtsSessionData::getInstance()->getOperatorId());
|
||||
data.lastModified(QDateTime::currentMSecsSinceEpoch());
|
||||
|
||||
DEBUG_LOG() << "onEditItem: Content size = " << m_content.size();
|
||||
DEBUG_LOG(m_logger) << "onEditItem: Content size = " << m_content.size();
|
||||
data.content(m_content);
|
||||
|
||||
DEBUG_LOG() << "Modify FileContent id = " << data.id();
|
||||
DEBUG_LOG(m_logger) << "Modify FileContent id = " << data.id();
|
||||
|
||||
if (!m_requestHelper->startSingleRequest([ = ]()
|
||||
{
|
||||
@@ -318,7 +318,7 @@ void FileContentEditDialog::onEditItem()
|
||||
|
||||
void FileContentEditDialog::onComboFileTypeChanged(int crt)
|
||||
{
|
||||
DEBUG_LOG() << "onComboFileTypeChanged crt = " << crt;
|
||||
DEBUG_LOG(m_logger) << "onComboFileTypeChanged crt = " << crt;
|
||||
m_ui->cbFileType->setCurrentIndex(crt);
|
||||
m_editData.fileType(static_cast<FileManagement::FileType::type>(m_ui->cbFileType->currentData().toInt()));
|
||||
}
|
||||
@@ -326,7 +326,7 @@ void FileContentEditDialog::onComboFileTypeChanged(int crt)
|
||||
|
||||
void FileContentEditDialog::onComboFileStatusChanged(int crt)
|
||||
{
|
||||
DEBUG_LOG() << "onComboFileStatusChanged crt = " << crt;
|
||||
DEBUG_LOG(m_logger) << "onComboFileStatusChanged crt = " << crt;
|
||||
m_ui->cbFileStatus->setCurrentIndex(crt);
|
||||
m_editData.fileStatus(static_cast<FileManagement::FileStatus::type>(m_ui->cbFileStatus->currentData().toInt()));
|
||||
}
|
||||
@@ -334,7 +334,7 @@ void FileContentEditDialog::onComboFileStatusChanged(int crt)
|
||||
|
||||
void FileContentEditDialog::onComboFileCategoryChanged(int crt)
|
||||
{
|
||||
DEBUG_LOG() << "onComboFileCategoryChanged crt = " << crt;
|
||||
DEBUG_LOG(m_logger) << "onComboFileCategoryChanged crt = " << crt;
|
||||
m_ui->cbFileCategory->setCurrentIndex(crt);
|
||||
m_editData.fileCategory(static_cast<FileManagement::FileCategory::type>(m_ui->cbFileCategory->currentData().toInt()));
|
||||
|
||||
@@ -346,7 +346,7 @@ void FileContentEditDialog::onComboFileCategoryChanged(int crt)
|
||||
|
||||
void FileContentEditDialog::onComboExerciseChanged(int crt)
|
||||
{
|
||||
DEBUG_LOG() << "onComboExerciseChanged crt = " << crt;
|
||||
DEBUG_LOG(m_logger) << "onComboExerciseChanged crt = " << crt;
|
||||
m_ui->cbExercises->setCurrentIndex(crt);
|
||||
if (m_ui->cbExercises->currentData().toInt() > 0)
|
||||
{
|
||||
@@ -365,7 +365,7 @@ void FileContentEditDialog::onComboExerciseChanged(int crt)
|
||||
|
||||
void FileContentEditDialog::onComboPhaseChanged(int crt)
|
||||
{
|
||||
DEBUG_LOG() << "onComboPhaseChanged crt = " << crt;
|
||||
DEBUG_LOG(m_logger) << "onComboPhaseChanged crt = " << crt;
|
||||
m_ui->cbPhases->setCurrentIndex(crt);
|
||||
if (m_ui->cbPhases->currentData().toInt() > 0)
|
||||
m_editData.phaseId(m_ui->cbPhases->currentData().toInt());
|
||||
@@ -376,7 +376,7 @@ void FileContentEditDialog::onComboPhaseChanged(int crt)
|
||||
|
||||
void FileContentEditDialog::fillExercisesComboBox()
|
||||
{
|
||||
DEBUG_LOG() << "fillExercisesComboBox";
|
||||
DEBUG_LOG(m_logger) << "fillExercisesComboBox";
|
||||
QSignalBlocker blocker(m_ui->cbExercises);
|
||||
m_ui->cbExercises->clear();
|
||||
m_ui->cbExercises->addItem(tr("<not set>"), 0);
|
||||
@@ -390,14 +390,14 @@ void FileContentEditDialog::fillExercisesComboBox()
|
||||
|
||||
void FileContentEditDialog::fillPhasesComboBox()
|
||||
{
|
||||
DEBUG_LOG() << "fillPhasesComboBox";
|
||||
DEBUG_LOG(m_logger) << "fillPhasesComboBox";
|
||||
QSignalBlocker blocker(m_ui->cbPhases);
|
||||
m_ui->cbPhases->clear();
|
||||
m_ui->cbPhases->addItem(tr("<not set>"), 0);
|
||||
if (m_editData.exerciseId().is_set())
|
||||
{
|
||||
const int exId = m_editData.exerciseId().get();
|
||||
DEBUG_LOG() << "ExId = " << exId;
|
||||
DEBUG_LOG(m_logger) << "ExId = " << exId;
|
||||
if (exId > 0)
|
||||
{
|
||||
auto cbPhases = [this, exId] (const ExerciseManagement::ExercisePhase &ph)
|
||||
@@ -415,7 +415,7 @@ void FileContentEditDialog::fillPhasesComboBox()
|
||||
|
||||
void FileContentEditDialog::onPropertiesClicked()
|
||||
{
|
||||
DEBUG_LOG() << "onPropertiesClicked";
|
||||
DEBUG_LOG(m_logger) << "onPropertiesClicked";
|
||||
SetPropertiesDialog *dialog = new SetPropertiesDialog(m_ui->leProperties, this);
|
||||
dialog->init();
|
||||
dialog->setAttribute(Qt::WA_DeleteOnClose);
|
||||
@@ -425,7 +425,7 @@ void FileContentEditDialog::onPropertiesClicked()
|
||||
|
||||
void FileContentEditDialog::onCheckUsedStateChanged(int newState)
|
||||
{
|
||||
DEBUG_LOG() << "onCheckUsedClicked: newState = " << newState;
|
||||
DEBUG_LOG(m_logger) << "onCheckUsedClicked: newState = " << newState;
|
||||
if (newState == Qt::Checked)
|
||||
m_editData.usedBy(1);
|
||||
else
|
||||
|
||||
+2
@@ -37,6 +37,8 @@ public:
|
||||
const std::vector<uint8_t> &content = {});
|
||||
|
||||
protected:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onFileContentModifyReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
|
||||
|
||||
private:
|
||||
|
||||
+3
-3
@@ -94,7 +94,7 @@ void FolderEditDialog::onAddEditFolder()
|
||||
if (apply())
|
||||
{
|
||||
close();
|
||||
DEBUG_LOG() << "Added / Edited folder " << m_editData.name();
|
||||
DEBUG_LOG(m_logger) << "Added / Edited folder " << m_editData.name();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ bool FolderEditDialog::apply()
|
||||
if (m_folderId > 0)
|
||||
|
||||
{
|
||||
DEBUG_LOG() << "Rename folder id = " << m_folderId;
|
||||
DEBUG_LOG(m_logger) << "Rename folder id = " << m_folderId;
|
||||
m_requestHelper->addRequest([this]()
|
||||
{
|
||||
FolderModifyRequest req;
|
||||
@@ -122,7 +122,7 @@ bool FolderEditDialog::apply()
|
||||
else
|
||||
|
||||
{
|
||||
DEBUG_LOG() << "Create new folder";
|
||||
DEBUG_LOG(m_logger) << "Create new folder";
|
||||
|
||||
FolderModifyRequest req;
|
||||
req.name(m_ui->leName->text().toStdString());
|
||||
|
||||
+2
@@ -36,6 +36,8 @@ public:
|
||||
bool apply();
|
||||
|
||||
protected:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onFolderModifyReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
|
||||
|
||||
private Q_SLOTS:
|
||||
|
||||
+35
-35
@@ -126,33 +126,33 @@ QVector<LtsWidgets::PluginData> InterfaceImpl::getActions()
|
||||
bool InterfaceImpl::fetchInterfaces()
|
||||
{
|
||||
|
||||
DEBUG_LOG() << "Fetching FLM interfaces for " << m_session->domainId() << ", " << m_session->exerciseId() << ", " << m_session->partitionId();
|
||||
DEBUG_LOG(m_logger) << "Fetching FLM interfaces for " << m_session->domainId() << ", " << m_session->exerciseId() << ", " << m_session->partitionId();
|
||||
if (!m_session->getDtc<FileManagement::DataInterface>(m_dtc))
|
||||
{
|
||||
DEBUG_LOG() << "getDtc for FileManagement::DataInterface failed.";
|
||||
DEBUG_LOG(m_logger) << "getDtc for FileManagement::DataInterface failed.";
|
||||
return false;
|
||||
}
|
||||
if (!m_session->getFtc<FileManagement::DataInterface>(m_ftc))
|
||||
{
|
||||
DEBUG_LOG() << "getFtc for FileManagement::DataInterface failed.";
|
||||
DEBUG_LOG(m_logger) << "getFtc for FileManagement::DataInterface failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_session->getForeignGuiInterface<FileManagement::ForeignGuiComboboxInterface>(m_flmGuiCbxIfc))
|
||||
{
|
||||
DEBUG_LOG() << "getForeignGuiInterface for FileManagement::ForeignGuiComboboxInterface failed.";
|
||||
DEBUG_LOG(m_logger) << "getForeignGuiInterface for FileManagement::ForeignGuiComboboxInterface failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (!m_session->getDtc<OperatorManagement::DataInterface>(m_opmDtc))
|
||||
{
|
||||
DEBUG_LOG() << "getDtc for OperatorManagement::DataInterface failed.";
|
||||
DEBUG_LOG(m_logger) << "getDtc for OperatorManagement::DataInterface failed.";
|
||||
return false;
|
||||
}
|
||||
if (!m_session->getDtc<ExerciseManagement::DataInterface>(m_exmDtc))
|
||||
{
|
||||
DEBUG_LOG() << "getDtc for ExerciseManagement::DataInterface failed.";
|
||||
DEBUG_LOG(m_logger) << "getDtc for ExerciseManagement::DataInterface failed.";
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -177,13 +177,13 @@ QString InterfaceImpl::menuGroup() const
|
||||
|
||||
LtsWidgets::LtsDialog *InterfaceImpl::onShowFileManagementDialog(QWidget *parent)
|
||||
{
|
||||
DEBUG_LOG() << "onShowFileManagementDialog";
|
||||
DEBUG_LOG(m_logger) << "onShowFileManagementDialog";
|
||||
|
||||
FileManagementDialogTab *dialog = new FileManagementDialogTab(menuGroup(), parent);
|
||||
|
||||
if (!dialog->init(m_session, FileDialogMode::User))
|
||||
{
|
||||
ERROR_LOG() << "Failed to init dialog";
|
||||
ERROR_LOG(m_logger) << "Failed to init dialog";
|
||||
dialog->deleteLater();
|
||||
}
|
||||
|
||||
@@ -195,13 +195,13 @@ LtsWidgets::LtsDialog *InterfaceImpl::onShowFileManagementDialog(QWidget *parent
|
||||
|
||||
LtsWidgets::LtsDialog *InterfaceImpl::onShowFileManagementAdminDialog(QWidget *parent)
|
||||
{
|
||||
DEBUG_LOG() << "onShowFileManagementDialog";
|
||||
DEBUG_LOG(m_logger) << "onShowFileManagementDialog";
|
||||
|
||||
FileManagementDialogTab *dialog = new FileManagementDialogTab(menuGroup(), parent);
|
||||
|
||||
if (!dialog->init(m_session, FileDialogMode::Admin))
|
||||
{
|
||||
ERROR_LOG() << "Failed to init dialog";
|
||||
ERROR_LOG(m_logger) << "Failed to init dialog";
|
||||
dialog->deleteLater();
|
||||
}
|
||||
|
||||
@@ -212,12 +212,12 @@ LtsWidgets::LtsDialog *InterfaceImpl::onShowFileManagementAdminDialog(QWidget *p
|
||||
|
||||
LtsWidgets::LtsDialog *InterfaceImpl::onShowHQReportDialog(QWidget *parent)
|
||||
{
|
||||
DEBUG_LOG() << "onShowHQReportDialog";
|
||||
DEBUG_LOG(m_logger) << "onShowHQReportDialog";
|
||||
HQReportEdit *dialog = new HQReportEdit(menuGroup(), parent);
|
||||
|
||||
if (!dialog->init(m_session))
|
||||
{
|
||||
ERROR_LOG() << "Failed to init dialog";
|
||||
ERROR_LOG(m_logger) << "Failed to init dialog";
|
||||
dialog->deleteLater();
|
||||
}
|
||||
dialog->show();
|
||||
@@ -239,13 +239,13 @@ void InterfaceImpl::onShowHQReportDialog(int partyId)
|
||||
|
||||
LtsWidgets::LtsFramelessDialog *InterfaceImpl::onSelectFileDialog(QWidget *parent)
|
||||
{
|
||||
DEBUG_LOG() << "onSelectFileDialog";
|
||||
DEBUG_LOG(m_logger) << "onSelectFileDialog";
|
||||
|
||||
FileManagementDialog *dialog = new FileManagementDialog(parent);
|
||||
|
||||
if (!dialog->init(m_session, FileDialogMode::SaveFile, {FileType::Jpg, FileType::Png}, 6, tr("Save File")))
|
||||
{
|
||||
ERROR_LOG() << "Failed to init dialog";
|
||||
ERROR_LOG(m_logger) << "Failed to init dialog";
|
||||
dialog->deleteLater();
|
||||
}
|
||||
|
||||
@@ -266,11 +266,11 @@ int InterfaceImpl::saveFileContent(QWidget *parent,
|
||||
if (initialFolderId == 0 && exerciseId > 0)
|
||||
initialFolderId = m_dtc->getExerciseFolderId(exerciseId);
|
||||
|
||||
DEBUG_LOG() << "Initial folder Id = " << initialFolderId;
|
||||
DEBUG_LOG(m_logger) << "Initial folder Id = " << initialFolderId;
|
||||
|
||||
if (!dialog->init(m_session, FileManagement::FileDialogMode::SaveFile, QVector<FileType>() << targetFileType, initialFolderId))
|
||||
{
|
||||
ERROR_LOG() << "Failed to init save dialog";
|
||||
ERROR_LOG(m_logger) << "Failed to init save dialog";
|
||||
delete dialog;
|
||||
return 0;
|
||||
}
|
||||
@@ -279,7 +279,7 @@ int InterfaceImpl::saveFileContent(QWidget *parent,
|
||||
if (res != QDialog::Accepted)
|
||||
{
|
||||
delete dialog;
|
||||
DEBUG_LOG() << "Save dialog closed by user";
|
||||
DEBUG_LOG(m_logger) << "Save dialog closed by user";
|
||||
return 0;
|
||||
}
|
||||
const int folderId = dialog->getSelectedFolderId();
|
||||
@@ -287,13 +287,13 @@ int InterfaceImpl::saveFileContent(QWidget *parent,
|
||||
const FileManagement::FileContent fileToModify = dialog->getSelectedFile();
|
||||
delete dialog;
|
||||
|
||||
INFO_LOG() << "FileToSave: Folder id = " << folderId
|
||||
INFO_LOG(m_logger) << "FileToSave: Folder id = " << folderId
|
||||
<< ", File id = " << fileToModify.id()
|
||||
<< ", File name = " << fileName;
|
||||
|
||||
if (folderId < 1 || fileName.isEmpty())
|
||||
{
|
||||
DEBUG_LOG() << "Save dialog closed by user";
|
||||
DEBUG_LOG(m_logger) << "Save dialog closed by user";
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ int InterfaceImpl::saveFileContent(QWidget *parent,
|
||||
, LtsWidgets::Button::Yes | LtsWidgets::Button::No));
|
||||
if (doNotOverwrite)
|
||||
{
|
||||
DEBUG_LOG() << "File not overwritten as chosen by user";
|
||||
DEBUG_LOG(m_logger) << "File not overwritten as chosen by user";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -395,7 +395,7 @@ int InterfaceImpl::saveFileContent(QWidget *parent,
|
||||
|
||||
int fileId = m_requestHelper->getRepliedId();
|
||||
|
||||
DEBUG_LOG() << "saveFileContent: File Id = " << fileId;
|
||||
DEBUG_LOG(m_logger) << "saveFileContent: File Id = " << fileId;
|
||||
|
||||
return fileId;
|
||||
}
|
||||
@@ -492,7 +492,7 @@ bool InterfaceImpl::deleteFileContent(int fileId)
|
||||
|
||||
if (fc.fileStatus() == FileManagement::FileStatus::Deleted)
|
||||
{
|
||||
WARNING_LOG() << "File content already deleted for id = " << fileId;
|
||||
WARNING_LOG(m_logger) << "File content already deleted for id = " << fileId;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -528,12 +528,12 @@ int InterfaceImpl::loadFileContent(QWidget *parent,
|
||||
initialFolderId = 1;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "Initial folder Id = " << initialFolderId;
|
||||
DEBUG_LOG(m_logger) << "Initial folder Id = " << initialFolderId;
|
||||
|
||||
QPointer<FileManagement::FileManagementDialog> dialog = new FileManagement::FileManagementDialog(parent);
|
||||
if (!dialog->init(m_session, FileManagement::FileDialogMode::OpenFile, fileTypes, initialFolderId, xmlType))
|
||||
{
|
||||
ERROR_LOG() << "Failed to init open dialog";
|
||||
ERROR_LOG(m_logger) << "Failed to init open dialog";
|
||||
delete dialog;
|
||||
return 0;
|
||||
}
|
||||
@@ -548,7 +548,7 @@ int InterfaceImpl::loadFileContent(QWidget *parent,
|
||||
const int fileId = dialog->getSelectedFileId();
|
||||
delete dialog;
|
||||
|
||||
INFO_LOG() << "FileToLoad: File id = " << fileId;
|
||||
INFO_LOG(m_logger) << "FileToLoad: File id = " << fileId;
|
||||
|
||||
if (fileId < 1)
|
||||
return 0;
|
||||
@@ -587,12 +587,12 @@ int InterfaceImpl::selectFileContent(QWidget *parent,
|
||||
initialFolderId = 1;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "Initial folder Id = " << initialFolderId;
|
||||
DEBUG_LOG(m_logger) << "Initial folder Id = " << initialFolderId;
|
||||
|
||||
QPointer<FileManagement::FileManagementDialog> dialog = new FileManagement::FileManagementDialog(parent);
|
||||
if (!dialog->init(m_session, FileManagement::FileDialogMode::OpenFile, fileTypes, initialFolderId))
|
||||
{
|
||||
ERROR_LOG() << "Failed to init open dialog";
|
||||
ERROR_LOG(m_logger) << "Failed to init open dialog";
|
||||
delete dialog;
|
||||
return 0;
|
||||
}
|
||||
@@ -614,7 +614,7 @@ int InterfaceImpl::selectFileContent(QWidget *parent,
|
||||
|
||||
bool InterfaceImpl::loadContent(int fileId, QByteArray &content, bool bQuiet)
|
||||
{
|
||||
DEBUG_LOG() << "loadContent: File id = " << fileId;
|
||||
DEBUG_LOG(m_logger) << "loadContent: File id = " << fileId;
|
||||
|
||||
if (fileId < 1)
|
||||
return false;
|
||||
@@ -652,7 +652,7 @@ QString InterfaceImpl::hasXmlType(const QByteArray &content) const
|
||||
{
|
||||
if (content.isEmpty())
|
||||
{
|
||||
WARNING_LOG() << "Empty xml file content!";
|
||||
WARNING_LOG(m_logger) << "Empty xml file content!";
|
||||
return QString();
|
||||
}
|
||||
|
||||
@@ -660,11 +660,11 @@ QString InterfaceImpl::hasXmlType(const QByteArray &content) const
|
||||
const QJsonDocument doc(QJsonDocument::fromJson(content, &parserError));
|
||||
if (parserError.error != QJsonParseError::NoError)
|
||||
{
|
||||
WARNING_LOG() << "Error parsing json document: " << parserError.errorString();
|
||||
WARNING_LOG(m_logger) << "Error parsing json document: " << parserError.errorString();
|
||||
return QString();
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "json to parse: " << doc.toJson();
|
||||
DEBUG_LOG(m_logger) << "json to parse: " << doc.toJson();
|
||||
const QJsonObject obj(doc.object());
|
||||
|
||||
QString type = obj[QStringLiteral("XmlType")].toString();
|
||||
@@ -714,7 +714,7 @@ bool InterfaceImpl::eventFilter(QObject *obj, QEvent *event)
|
||||
{
|
||||
QUrlQuery query(ev->url());
|
||||
const int partyId = query.queryItemValue(QStringLiteral("party")).toInt();
|
||||
DEBUG_LOG() << "[flm_explorer] partyId: " << partyId;
|
||||
DEBUG_LOG(m_logger) << "[flm_explorer] partyId: " << partyId;
|
||||
|
||||
onShowHQReportDialog(partyId);
|
||||
event->accept();
|
||||
@@ -787,13 +787,13 @@ bool InterfaceImpl::TopicReplayInterface::playbackInit(const QJsonObject &attrib
|
||||
|
||||
if (!m_previewWidget)
|
||||
{
|
||||
ERROR_LOG() << "Preview widget not available for fileId = " << fileId;
|
||||
ERROR_LOG(m_logger) << "Preview widget not available for fileId = " << fileId;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_previewWidget->init(fc, pageNo, zoomLevel / 100., rotation, 0 , userText))
|
||||
{
|
||||
ERROR_LOG() << "Preview widget cannot be initialized for fileId = " << fileId;
|
||||
ERROR_LOG(m_logger) << "Preview widget cannot be initialized for fileId = " << fileId;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -828,7 +828,7 @@ bool InterfaceImpl::TopicReplayInterface::exportTopic(const QJsonObject &attribu
|
||||
|
||||
|
||||
|
||||
DEBUG_LOG() << "Trying to export file with id " << fileId << " to " << strPathToFile;
|
||||
DEBUG_LOG(m_logger) << "Trying to export file with id " << fileId << " to " << strPathToFile;
|
||||
FileManagement::FileContent fc = m_dtc->fileContent(fileId);
|
||||
GetFileContentAsync *getFileContent = new GetFileContentAsync(fc.id(), m_ftc);
|
||||
|
||||
|
||||
+2
@@ -105,6 +105,8 @@ public:
|
||||
TopicEditorBase::TopicEditor *createTopicEditor(const TopicEditorBase::TopicData &data) override;
|
||||
|
||||
protected:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool eventFilter(QObject *obj, QEvent *event) override;
|
||||
private:
|
||||
void onGetFileContentDataReply(const GetFileContentDataReply &reply) override { m_requestHelper->requestReply(reply); }
|
||||
|
||||
+4
-4
@@ -24,12 +24,12 @@ GetFileContent::~GetFileContent()
|
||||
|
||||
bool GetFileContent::getContent(int fileContentId, std::vector<uint8_t> &content)
|
||||
{
|
||||
DEBUG_LOG() << "New Get Content";
|
||||
DEBUG_LOG(m_logger) << "New Get Content";
|
||||
auto handleContent = [this, &content](const Core::FunctionReply & baseReply)
|
||||
{
|
||||
const GetFileContentDataReply &reply = static_cast<const GetFileContentDataReply &>(baseReply);
|
||||
content = reply.content();
|
||||
DEBUG_LOG() << "Content size: " << content.size();
|
||||
DEBUG_LOG(m_logger) << "Content size: " << content.size();
|
||||
};
|
||||
|
||||
auto sendReq = [this, fileContentId]()
|
||||
@@ -41,11 +41,11 @@ bool GetFileContent::getContent(int fileContentId, std::vector<uint8_t> &content
|
||||
|
||||
if (!m_requestHelper->startSingleRequest(sendReq, handleContent))
|
||||
{
|
||||
ERROR_LOG() << "Cannot retrieve file content for id = " << fileContentId;
|
||||
ERROR_LOG(m_logger) << "Cannot retrieve file content for id = " << fileContentId;
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "Content size: " << content.size();
|
||||
DEBUG_LOG(m_logger) << "Content size: " << content.size();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+9
-10
@@ -15,10 +15,9 @@
|
||||
namespace FileManagement
|
||||
{
|
||||
|
||||
OfficeIntegration::OfficeIntegration(const FileManagement::FileContent &fileContent, QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_selectedFileContent(fileContent)
|
||||
{}
|
||||
OfficeIntegration::OfficeIntegration(const FileManagement::FileContent &fileContent, QObject *parent) : QObject(parent)
|
||||
, m_selectedFileContent(fileContent),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {}
|
||||
|
||||
OfficeIntegration::~OfficeIntegration()
|
||||
{
|
||||
@@ -31,7 +30,7 @@ bool OfficeIntegration::openOfficeWindow()
|
||||
const bool bUseMSOffice = LtsUtils::ProjectSettings::getInstance()->value(QStringLiteral("Office"), QStringLiteral("Type")).toString() == QStringLiteral("MSOffice");
|
||||
const bool bRet = bUseMSOffice ? callWfica() : callLibreOffice();
|
||||
if (!bRet)
|
||||
ERROR_LOG() << m_errorString;
|
||||
ERROR_LOG(m_logger) << m_errorString;
|
||||
return bRet;
|
||||
}
|
||||
|
||||
@@ -78,9 +77,9 @@ bool OfficeIntegration::callWfica()
|
||||
this, &OfficeIntegration::deleteLater);
|
||||
myProcess->start(program, arguments);
|
||||
|
||||
INFO_LOG() << "icaFile: =" << m_icaFile->fileName() <<
|
||||
INFO_LOG(m_logger) << "icaFile: =" << m_icaFile->fileName() <<
|
||||
", args: '" << arguments.join(QLatin1Char(' '));
|
||||
DEBUG_LOG() << "FileManagement::OfficeIntegration::callWfica(): " << myProcess->errorString();
|
||||
DEBUG_LOG(m_logger) << "FileManagement::OfficeIntegration::callWfica(): " << myProcess->errorString();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -94,7 +93,7 @@ bool OfficeIntegration::callLibreOffice()
|
||||
connString.replace(QStringLiteral("%DB_NAME%"), s->databaseName());
|
||||
connString.replace(QStringLiteral("%DB_HOST%"), s->databaseHostname());
|
||||
|
||||
DEBUG_LOG() << "DB connection string: " << connString;
|
||||
DEBUG_LOG(m_logger) << "DB connection string: " << connString;
|
||||
|
||||
QString program = QStringLiteral("java");
|
||||
QStringList arguments;
|
||||
@@ -110,7 +109,7 @@ bool OfficeIntegration::callLibreOffice()
|
||||
connect(myProcess, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), myProcess, &QProcess::deleteLater);
|
||||
connect(myProcess, &QProcess::errorOccurred, this, [this, myProcess](QProcess::ProcessError error)
|
||||
{
|
||||
ERROR_LOG() << "FileManagement::OfficeIntegration::callLibreOffice(): " << error << " = " << myProcess->errorString();
|
||||
ERROR_LOG(m_logger) << "FileManagement::OfficeIntegration::callLibreOffice(): " << error << " = " << myProcess->errorString();
|
||||
});
|
||||
|
||||
myProcess->start(program, arguments);
|
||||
@@ -129,7 +128,7 @@ void OfficeIntegration::startLibreOfficeServer()
|
||||
this, &OfficeIntegration::deleteLater);
|
||||
myProcess->start(program, arguments);
|
||||
|
||||
DEBUG_LOG() << "FileManagement::OfficeIntegration::startLibreOfficeServer(): " << myProcess->errorString();
|
||||
DEBUG_LOG(m_logger) << "FileManagement::OfficeIntegration::startLibreOfficeServer(): " << myProcess->errorString();
|
||||
}
|
||||
|
||||
QString OfficeIntegration::getParas() const
|
||||
|
||||
+1
@@ -21,6 +21,7 @@ public:
|
||||
bool openOfficeWindow();
|
||||
QString errorString() const { return m_errorString; }
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool callWfica();
|
||||
bool callLibreOffice();
|
||||
void startLibreOfficeServer();
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ bool FileContentPreviewDialog::init(const FileContent &data)
|
||||
|
||||
m_ui->lblTitle->setText(tr("Preview File Content: %1").arg(QString::fromStdString(data.name())));
|
||||
|
||||
DEBUG_LOG() << "Content size: " << m_content.size();
|
||||
DEBUG_LOG(m_logger) << "Content size: " << m_content.size();
|
||||
|
||||
switch (data.fileType().underlying())
|
||||
{
|
||||
|
||||
+10
-11
@@ -14,12 +14,11 @@ namespace FileManagement
|
||||
static Poppler::Page::Rotation getRotationFromValue(int rotation);
|
||||
|
||||
|
||||
FileContentPreviewPlaybackWidget::FileContentPreviewPlaybackWidget(const std::shared_ptr<Interface::Ftc> &ftc, QWidget *parent)
|
||||
: QWidget(parent)
|
||||
FileContentPreviewPlaybackWidget::FileContentPreviewPlaybackWidget(const std::shared_ptr<Interface::Ftc> &ftc, QWidget *parent) : QWidget(parent)
|
||||
, m_ui(new Ui::FileContentPreviewPlaybackWidget)
|
||||
, m_getContent(new FileManagement::GetFileContent(ftc, this))
|
||||
, m_closeTimer(new QTimer(this))
|
||||
{
|
||||
, m_closeTimer(new QTimer(this)),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
m_ui->setupUi(this);
|
||||
|
||||
m_ui->lblPixmap->setVisible(false);
|
||||
@@ -71,13 +70,13 @@ bool FileContentPreviewPlaybackWidget::init(const FileContent &data, int pageNo,
|
||||
m_rotation = rotation;
|
||||
m_userText = userText;
|
||||
|
||||
DEBUG_LOG() << "FileContentPreviewPlaybackWidget::init - (fileId, pageNo, zoomFactor, rotation) = ("
|
||||
DEBUG_LOG(m_logger) << "FileContentPreviewPlaybackWidget::init - (fileId, pageNo, zoomFactor, rotation) = ("
|
||||
<< m_data.id() << "," << m_pageNo << "," << m_zoomFactor << ", " << m_rotation << ")";
|
||||
|
||||
if (m_userText.isEmpty() && m_data.id() > 0)
|
||||
m_getContent->getContent(m_data.id(), m_content);
|
||||
|
||||
DEBUG_LOG() << "Content size: " << m_content.size() << ", " << m_pageNo;
|
||||
DEBUG_LOG(m_logger) << "Content size: " << m_content.size() << ", " << m_pageNo;
|
||||
|
||||
if (m_duration > 0)
|
||||
startTimer();
|
||||
@@ -162,7 +161,7 @@ bool FileContentPreviewPlaybackWidget::init(const FileContent &data, int pageNo,
|
||||
bool FileContentPreviewPlaybackWidget::pauseTimer()
|
||||
{
|
||||
m_closeTimer.stop();
|
||||
DEBUG_LOG() << "Timer stopped ";
|
||||
DEBUG_LOG(m_logger) << "Timer stopped ";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -172,7 +171,7 @@ bool FileContentPreviewPlaybackWidget::startTimer()
|
||||
m_closeTimer.setInterval(m_duration * 1000);
|
||||
connect(&m_closeTimer, &QTimer::timeout, this, &FileContentPreviewPlaybackWidget::close);
|
||||
m_closeTimer.start();
|
||||
DEBUG_LOG() << "Timer started interval = " << m_closeTimer.interval();
|
||||
DEBUG_LOG(m_logger) << "Timer started interval = " << m_closeTimer.interval();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -193,7 +192,7 @@ void FileContentPreviewPlaybackWidget::setPage(int pageNo)
|
||||
{
|
||||
if (m_pageNo == pageNo)
|
||||
return;
|
||||
DEBUG_LOG() << "setPage = " << pageNo;
|
||||
DEBUG_LOG(m_logger) << "setPage = " << pageNo;
|
||||
m_pageNo = pageNo;
|
||||
m_pdfWidget->setPage(pageNo);
|
||||
emit currentPageChanged(m_pageNo);
|
||||
@@ -204,7 +203,7 @@ void FileContentPreviewPlaybackWidget::setZoomFactor(double zoomFactor)
|
||||
{
|
||||
if (qFuzzyCompare(m_zoomFactor, zoomFactor))
|
||||
return;
|
||||
DEBUG_LOG() << "setZoomFactor = " << zoomFactor;
|
||||
DEBUG_LOG(m_logger) << "setZoomFactor = " << zoomFactor;
|
||||
m_zoomFactor = zoomFactor;
|
||||
m_pdfWidget->setZoomFactor(zoomFactor);
|
||||
}
|
||||
@@ -214,7 +213,7 @@ void FileContentPreviewPlaybackWidget::setRotation(int rotation)
|
||||
{
|
||||
if (m_rotation == rotation)
|
||||
return;
|
||||
DEBUG_LOG() << "setRotation = " << rotation;
|
||||
DEBUG_LOG(m_logger) << "setRotation = " << rotation;
|
||||
m_rotation = rotation;
|
||||
m_pdfWidget->setRotation(getRotationFromValue(m_rotation));
|
||||
emit rotationChanged(rotation);
|
||||
|
||||
+4
-4
@@ -18,7 +18,7 @@ SetPropertiesDialog::SetPropertiesDialog(QLineEdit *lineEdit, QWidget *parent)
|
||||
, m_ui(new Ui::SetPropertiesDialog)
|
||||
, m_lineEdit(lineEdit)
|
||||
{
|
||||
DEBUG_LOG() << "Ctor SetPropertiesDialog";
|
||||
DEBUG_LOG(m_logger) << "Ctor SetPropertiesDialog";
|
||||
m_ui->setupUi(this);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ SetPropertiesDialog::~SetPropertiesDialog()
|
||||
|
||||
void SetPropertiesDialog::init()
|
||||
{
|
||||
DEBUG_LOG() << "Init SetPropertiesDialog";
|
||||
DEBUG_LOG(m_logger) << "Init SetPropertiesDialog";
|
||||
|
||||
connect(m_ui->buttonBox->getButton(LtsWidgets::DialogButton::Close), &QPushButton::clicked, this, &SetPropertiesDialog::close);
|
||||
m_ui->buttonBox->getButton(LtsWidgets::DialogButton::Apply)->hide();
|
||||
@@ -50,13 +50,13 @@ void SetPropertiesDialog::init()
|
||||
|
||||
if (error.error != QJsonParseError::NoError)
|
||||
{
|
||||
ERROR_LOG() << error.errorString();
|
||||
ERROR_LOG(m_logger) << error.errorString();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!doc.isObject())
|
||||
{
|
||||
ERROR_LOG() << "Properties String is no JSON-Object";
|
||||
ERROR_LOG(m_logger) << "Properties String is no JSON-Object";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -31,6 +31,8 @@ private Q_SLOTS:
|
||||
void onAddClicked();
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
enum class PropValType
|
||||
{
|
||||
INT,
|
||||
|
||||
Reference in new issue
Block a user