Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+9
-10
@@ -23,8 +23,7 @@ static int s_lastTypeUsed = -1;
|
||||
|
||||
ParticipantEditItemWidgetBase::ParticipantEditItemWidgetBase(bool asSupportService,
|
||||
LtsSession::LtsSession *session,
|
||||
QWidget *parent)
|
||||
: QWidget(parent)
|
||||
QWidget *parent) : QWidget(parent)
|
||||
, m_asSupportService(asSupportService)
|
||||
, m_bEditMode(false)
|
||||
, m_typeMinimum(0)
|
||||
@@ -34,8 +33,8 @@ ParticipantEditItemWidgetBase::ParticipantEditItemWidgetBase(bool asSupportServi
|
||||
, m_dtc(nullptr)
|
||||
, m_ppmGuiCbxIfc(nullptr)
|
||||
, m_session(session)
|
||||
, m_ui(new Ui::ParticipantEditItemWidgetBase)
|
||||
{
|
||||
, m_ui(new Ui::ParticipantEditItemWidgetBase),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
m_ui->setupUi(this);
|
||||
setWindowTitle(tr("Edit Participant"));
|
||||
connect(m_ui->pbIcon, &QToolButton::clicked, this, &ParticipantEditItemWidgetBase::onSymbolSelection);
|
||||
@@ -106,7 +105,7 @@ bool ParticipantEditItemWidgetBase::init(const std::shared_ptr<ParticipantManage
|
||||
const std::shared_ptr<AdvancedSymbology::ForeignDataInterface> &asb,
|
||||
const bool addItem)
|
||||
{
|
||||
DEBUG_LOG() << "init addItem=" << addItem
|
||||
DEBUG_LOG(m_logger) << "init addItem=" << addItem
|
||||
<< " m_bEditMode=" << m_bEditMode;
|
||||
if (!dtc || !ppmGuiCbxIfc)
|
||||
return false;
|
||||
@@ -121,7 +120,7 @@ bool ParticipantEditItemWidgetBase::init(const std::shared_ptr<ParticipantManage
|
||||
slotRetranslate();
|
||||
if (addItem)
|
||||
{
|
||||
DEBUG_LOG() << "setDesignatorData()";
|
||||
DEBUG_LOG(m_logger) << "setDesignatorData()";
|
||||
setDesignatorData();
|
||||
m_ui->cbTypeClass->setCurrentIndex(m_ui->cbTypeClass->findData(s_lastTypeClassUsed));
|
||||
const int idx = m_ui->cbType->findData(s_lastTypeUsed);
|
||||
@@ -131,7 +130,7 @@ bool ParticipantEditItemWidgetBase::init(const std::shared_ptr<ParticipantManage
|
||||
|
||||
else if (m_bEditMode)
|
||||
{
|
||||
DEBUG_LOG() << "setData()";
|
||||
DEBUG_LOG(m_logger) << "setData()";
|
||||
setData();
|
||||
}
|
||||
return true;
|
||||
@@ -223,7 +222,7 @@ void ParticipantEditItemWidgetBase::onSymbolConfig()
|
||||
|
||||
void ParticipantEditItemWidgetBase::onChangeSymbol(const QString &sidc)
|
||||
{
|
||||
TRACE_LOG() << Q_FUNC_INFO << ", Changing symbol to " << sidc;
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << ", Changing symbol to " << sidc;
|
||||
if (!m_asbfc || sidc == m_sidc)
|
||||
return;
|
||||
|
||||
@@ -250,7 +249,7 @@ void ParticipantEditItemWidgetBase::onChangeSymbol(const QString &sidc)
|
||||
}
|
||||
else
|
||||
{
|
||||
ERROR_LOG() << Q_FUNC_INFO << " sidc is not encoded, sidc = '" << sidc << "'";
|
||||
ERROR_LOG(m_logger) << Q_FUNC_INFO << " sidc is not encoded, sidc = '" << sidc << "'";
|
||||
m_ui->pbSymbolConfig->setEnabled(false);
|
||||
}
|
||||
|
||||
@@ -260,7 +259,7 @@ void ParticipantEditItemWidgetBase::onChangeSymbol(const QString &sidc)
|
||||
m_symbolConfig = nullptr;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "Changing symbol to " << sidc << " is in progress";
|
||||
DEBUG_LOG(m_logger) << "Changing symbol to " << sidc << " is in progress";
|
||||
}
|
||||
|
||||
ParticipantManagement::TypeClass ParticipantEditItemWidgetBase::typeClassIdFromTypeId(int typeId) const
|
||||
|
||||
+3
@@ -36,6 +36,7 @@ public:
|
||||
~ParticipantEditItemWidgetBase();
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool init(const std::shared_ptr<ParticipantManagement::Interface::Dtc> &dtc,
|
||||
const std::shared_ptr<ParticipantManagement::ForeignGuiComboboxInterface> &ppmGuiCbxIfc,
|
||||
const std::shared_ptr<AdvancedSymbology::ForeignDataInterface> &asb,
|
||||
@@ -56,6 +57,7 @@ protected Q_SLOTS:
|
||||
void onChangeSymbol(const QString &sidc);
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
ParticipantManagement::TypeClass typeClassIdFromTypeId(int typeId) const;
|
||||
bool isUnitType(int typeId) const;
|
||||
|
||||
@@ -66,6 +68,7 @@ Q_SIGNALS:
|
||||
void readyToClose();
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool m_asSupportService;
|
||||
bool m_bEditMode;
|
||||
int m_typeMinimum;
|
||||
|
||||
+6
-6
@@ -360,7 +360,7 @@ bool ParticipantEditModel::canDropMimeData(const QMimeData *data,
|
||||
if (!isUnitType(parentItem->participant.typeId()))
|
||||
return false;
|
||||
|
||||
DEBUG_LOG() << "can drop on " << row << ", " << column << ", parent: "
|
||||
DEBUG_LOG(m_logger) << "can drop on " << row << ", " << column << ", parent: "
|
||||
<< parent.row() << "," << parent.column() << ", " << parent.isValid()
|
||||
<< ", action: " << action;
|
||||
|
||||
@@ -389,7 +389,7 @@ bool ParticipantEditModel::canDropMimeData(const QMimeData *data,
|
||||
|
||||
if (idSource != 0 && isParentOf(parentItem, idSource))
|
||||
{
|
||||
DEBUG_LOG() << "isParentOf() for idSource: " << idSource << " is true - no drop";
|
||||
DEBUG_LOG(m_logger) << "isParentOf() for idSource: " << idSource << " is true - no drop";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -802,7 +802,7 @@ void ParticipantEditModel::insertChildrenOf(int parentId,
|
||||
auto it = tmap.constFind(childId);
|
||||
if (it == tmap.constEnd())
|
||||
{
|
||||
WARNING_LOG() << "Can not find participant with id " << childId << " - ignoring";
|
||||
WARNING_LOG(m_logger) << "Can not find participant with id " << childId << " - ignoring";
|
||||
continue;
|
||||
}
|
||||
const ParticipantData &data = it.value();
|
||||
@@ -827,11 +827,11 @@ void ParticipantEditModel::insertChildrenOf(int parentId,
|
||||
childItem->participant = data;
|
||||
childItem->bIsChecked = isChecked(checkedParticipants.contains(data.id()), cs);
|
||||
|
||||
DEBUG_LOG() << "insert Child " << childItem << "(" << data.id() << ", " << data.hierarchyNumber()
|
||||
DEBUG_LOG(m_logger) << "insert Child " << childItem << "(" << data.id() << ", " << data.hierarchyNumber()
|
||||
<< ") to parent " << parent << " at pos " << insertPos;
|
||||
if ( data.id() == 0 && data.hierarchyNumber() == 0)
|
||||
{
|
||||
WARNING_LOG() << "avoid endless loop in recursion";
|
||||
WARNING_LOG(m_logger) << "avoid endless loop in recursion";
|
||||
return;
|
||||
}
|
||||
insertRow(insertPos, parentIdx, childItem);
|
||||
@@ -1086,7 +1086,7 @@ void ParticipantEditModel::onParticipantChanged(const ParticipantManagement::Par
|
||||
|
||||
CheckedTreeItem *childItem = static_cast<CheckedTreeItem *>(createItem(QVariant(), QIcon()));
|
||||
childItem->participant = m_dtc->convertParticipantToParticipantData(data);
|
||||
DEBUG_LOG() << "insert Child " << childItem << "(" << data.id() << ", " << data.hierarchyNumber()
|
||||
DEBUG_LOG(m_logger) << "insert Child " << childItem << "(" << data.id() << ", " << data.hierarchyNumber()
|
||||
<< ") to parent " << ctiParent << " at pos " << insertPos;
|
||||
insertRow(insertPos, indexFromItem(ctiParent), childItem);
|
||||
tryRenderSymbol(QString::fromStdString(data.symbol()), childItem);
|
||||
|
||||
+4
@@ -101,6 +101,7 @@ public:
|
||||
QString getHierarchyFromIndex(const QModelIndex &index) const;
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void gatherParticipants(QHash<int, ParticipantData> &tmap,
|
||||
QHash<int, QSet<int>> &parentId2id) const;
|
||||
|
||||
@@ -148,6 +149,7 @@ signals:
|
||||
void internalDataChanged();
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
int m_partyId;
|
||||
bool m_bRowsAreCheckable;
|
||||
bool m_bUnitsSelectable;
|
||||
@@ -176,6 +178,7 @@ public:
|
||||
int partyId() const { return m_sourceModel ? m_sourceModel->partyId() : -1; }
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override;
|
||||
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
|
||||
|
||||
@@ -249,6 +252,7 @@ public:
|
||||
SortData sortData() const { return m_sortData; }
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool lessThan(const QModelIndex &sourceLeft, const QModelIndex &sourceRight) const override;
|
||||
bool filterAcceptsColumn(int source_column, const QModelIndex &source_parent) const override;
|
||||
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
|
||||
|
||||
+4
-4
@@ -75,7 +75,7 @@ void ParticipantIconModelBase::tryRenderSymbol(const QString &symbol, NGLTreeIte
|
||||
{
|
||||
AdvancedSymbology::SymbolDataToRender symDataToRender(symbol);
|
||||
symDataToRender.role = m_partyRole;
|
||||
DEBUG_LOG() << "Rendering symbol '" << symbol << "' for item " << item;
|
||||
DEBUG_LOG(m_logger) << "Rendering symbol '" << symbol << "' for item " << item;
|
||||
if (m_partyColor.isValid())
|
||||
{
|
||||
symDataToRender.fillColor = m_partyColor;
|
||||
@@ -92,7 +92,7 @@ void ParticipantIconModelBase::tryRenderSymbol(const QString &symbol, NGLTreeIte
|
||||
AdvancedSymbology::SymbolResult *symResPtr = symRes.data();
|
||||
if (!symResPtr)
|
||||
{
|
||||
WARNING_LOG() << "Can not render symbol for sidc '" << symbol << "'";
|
||||
WARNING_LOG(m_logger) << "Can not render symbol for sidc '" << symbol << "'";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -138,11 +138,11 @@ void ParticipantIconModelBase::symbolRendered(AdvancedSymbology::SymbolResult *s
|
||||
const QIcon icon(QPixmap::fromImage(symResData.result->symbolImage().image()));
|
||||
for (NGLTreeItem *item : symResData.treeItems)
|
||||
{
|
||||
DEBUG_LOG() << "Symbol for " << item << " ready";
|
||||
DEBUG_LOG(m_logger) << "Symbol for " << item << " ready";
|
||||
|
||||
|
||||
if (!updateIcon(QModelIndex(), item, icon))
|
||||
WARNING_LOG() << "updateIcon failed for item " << item;
|
||||
WARNING_LOG(m_logger) << "updateIcon failed for item " << item;
|
||||
}
|
||||
|
||||
m_symbolResultMapping.erase(it);
|
||||
|
||||
+3
@@ -35,6 +35,7 @@ class PPMCOMMON_EXPORT ParticipantIconModelBase : public NGLTreeModel
|
||||
{
|
||||
Q_OBJECT
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
ParticipantIconModelBase(const std::shared_ptr<Interface::Dtc> &ppmDtc,
|
||||
const std::shared_ptr<AdvancedSymbology::ForeignDataInterface> &asbIfc,
|
||||
const QStringList &hdr,
|
||||
@@ -53,10 +54,12 @@ protected:
|
||||
bool updateIcon(const QModelIndex ¤tIndex, NGLTreeItem *itemToUpdate, const QIcon &icon);
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onTypeChanged(const ParticipantManagement::Type &data, DataModification modType);
|
||||
|
||||
protected:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_dtc;
|
||||
|
||||
QHash<qint32, ParticipantManagement::Type> m_types;
|
||||
|
||||
Reference in new issue
Block a user