mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-23 09:28:45 +00:00
merging legacy dfn-based method into geqt. Warning: broke the build.
This commit is contained in:
parent
7598d90e90
commit
dafbfef00f
7 changed files with 1140 additions and 724 deletions
|
@ -23,11 +23,13 @@
|
||||||
#include <nel/georges/u_type.h>
|
#include <nel/georges/u_type.h>
|
||||||
#include <nel/georges/form.h>
|
#include <nel/georges/form.h>
|
||||||
|
|
||||||
|
using namespace NLGEORGES;
|
||||||
|
|
||||||
namespace GeorgesQt
|
namespace GeorgesQt
|
||||||
{
|
{
|
||||||
|
|
||||||
CFormItem::CFormItem(NLGEORGES::UFormElm* elm, const QList<QVariant> &data, CFormItem *parent,
|
CFormItem::CFormItem(NLGEORGES::UFormElm* elm, const QList<QVariant> &data, CFormItem *parent,
|
||||||
NLGEORGES::UFormElm::TWhereIsValue wV, NLGEORGES::UFormElm::TWhereIsNode wN)
|
NLGEORGES::UFormElm::TWhereIsValue wV, NLGEORGES::UFormElm::TWhereIsNode wN)
|
||||||
{
|
{
|
||||||
parentItem = parent;
|
parentItem = parent;
|
||||||
itemData = data;
|
itemData = data;
|
||||||
|
@ -159,4 +161,198 @@ namespace GeorgesQt
|
||||||
//formElm->setValueByName();
|
//formElm->setValueByName();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CFormItem *CFormItem::add (/*TSub type,*/ const char *name, uint structId, const char *formName, uint slot)
|
||||||
|
// {
|
||||||
|
// Add at the end
|
||||||
|
// uint index = _Children.size();
|
||||||
|
// _Children.push_back (new CGeorgesEditDocSub);
|
||||||
|
|
||||||
|
// _Children[index]->_Type = type;
|
||||||
|
// _Children[index]->_Name = name;
|
||||||
|
// _Children[index]->_Parent = this;
|
||||||
|
// _Children[index]->_StructId = structId;
|
||||||
|
// _Children[index]->_FormName = formName;
|
||||||
|
// _Children[index]->_Slot = slot;
|
||||||
|
// return _Children[index];
|
||||||
|
// CFormItem *newNode = new CFormItem();
|
||||||
|
// appendChild(newNode);
|
||||||
|
// return NULL;
|
||||||
|
// }
|
||||||
|
|
||||||
|
CFormItem *CFormItem::add(NLGEORGES::UFormElm* root, std::string elmName)
|
||||||
|
{
|
||||||
|
CFormItem *newItem = NULL;
|
||||||
|
UFormElm::TWhereIsNode *whereN = new UFormElm::TWhereIsNode;
|
||||||
|
UFormElm::TWhereIsValue *whereV = new UFormElm::TWhereIsValue;
|
||||||
|
// Append a new item to the current parent's list of children.
|
||||||
|
// std::string elmName;
|
||||||
|
// if(root->getStructNodeName(num, elmName))
|
||||||
|
// {
|
||||||
|
QList<QVariant> columnData;
|
||||||
|
//QVariant value;
|
||||||
|
std::string value;
|
||||||
|
//NLMISC::CRGBA value_color;
|
||||||
|
//uint value_uint;
|
||||||
|
//sint value_sint;
|
||||||
|
//double value_double;
|
||||||
|
QString elmtType = "";
|
||||||
|
UFormElm *elmt = 0;
|
||||||
|
if(root->getNodeByName(&elmt, elmName.c_str(), whereN, true))
|
||||||
|
{
|
||||||
|
if (elmt)
|
||||||
|
{
|
||||||
|
if (elmt->isArray())
|
||||||
|
elmtType = "Array";
|
||||||
|
if (elmt->isStruct())
|
||||||
|
elmtType = "Struct";
|
||||||
|
if (elmt->isAtom())
|
||||||
|
{
|
||||||
|
elmtType = "Atom";
|
||||||
|
uint numDefinitions = 0;
|
||||||
|
const UType *type = elmt->getType();
|
||||||
|
if (type)
|
||||||
|
{
|
||||||
|
numDefinitions = type->getNumDefinition();
|
||||||
|
root->getValueByName(value, elmName.c_str(),UFormElm::Eval,whereV);
|
||||||
|
switch (type->getType())
|
||||||
|
{
|
||||||
|
case UType::UnsignedInt:
|
||||||
|
value = QString("%1").arg(QString("%1").arg(value.c_str()).toDouble()).toStdString();
|
||||||
|
elmtType.append("_uint");break;
|
||||||
|
case UType::SignedInt:
|
||||||
|
value = QString("%1").arg(QString("%1").arg(value.c_str()).toDouble()).toStdString();
|
||||||
|
elmtType.append("_sint");break;
|
||||||
|
case UType::Double:
|
||||||
|
value = QString("%1").arg(QString("%1").arg(value.c_str()).toDouble(),0,'f',1).toStdString();
|
||||||
|
elmtType.append("_double");break;
|
||||||
|
case UType::String:
|
||||||
|
elmtType.append("_string");break;
|
||||||
|
case UType::Color:
|
||||||
|
elmtType.append("_color");break;
|
||||||
|
default:
|
||||||
|
elmtType.append("_unknownType");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
elmtType.append("_noType");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (numDefinitions)
|
||||||
|
{
|
||||||
|
std::string l, v;
|
||||||
|
QString tmpLabel, tmpValue;
|
||||||
|
for (uint i = 0; i < numDefinitions; i++)
|
||||||
|
{
|
||||||
|
type->getDefinition(i,l,v);
|
||||||
|
tmpLabel = l.c_str();
|
||||||
|
tmpValue = v.c_str();
|
||||||
|
if (type->getType() == UType::SignedInt)
|
||||||
|
{
|
||||||
|
if (QString("%1").arg(value.c_str()).toDouble() == tmpValue.toDouble()) {
|
||||||
|
value = l;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (type->getType() == UType::String)
|
||||||
|
{
|
||||||
|
if (QString(value.c_str()) == tmpValue)
|
||||||
|
{
|
||||||
|
value = l;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (elmt->isVirtualStruct())
|
||||||
|
{
|
||||||
|
root->getValueByName(value, elmName.c_str(),UFormElm::Eval,whereV);
|
||||||
|
elmtType = "VirtualStruct";
|
||||||
|
}
|
||||||
|
switch (*whereN)
|
||||||
|
{
|
||||||
|
case UFormElm::NodeForm:
|
||||||
|
elmtType.append("_fromForm"); break;
|
||||||
|
case UFormElm::NodeParentForm:
|
||||||
|
elmtType.append("_fromParentForm"); break;
|
||||||
|
case UFormElm::NodeDfn:
|
||||||
|
elmtType.append("_isDFN"); break;
|
||||||
|
case UFormElm::NodeType:
|
||||||
|
elmtType.append("_isType"); break;
|
||||||
|
default:
|
||||||
|
elmtType.append("_noNode");
|
||||||
|
}
|
||||||
|
switch (*whereV)
|
||||||
|
{
|
||||||
|
case UFormElm::ValueForm:
|
||||||
|
elmtType.append("_formValue"); break;
|
||||||
|
case UFormElm::ValueParentForm:
|
||||||
|
elmtType.append("_parentValue"); break;
|
||||||
|
case UFormElm::ValueDefaultDfn:
|
||||||
|
elmtType.append("_dfnValue"); break;
|
||||||
|
case UFormElm::ValueDefaultType:
|
||||||
|
elmtType.append("_typeValue"); break;
|
||||||
|
default:
|
||||||
|
elmtType.append("_noValue");
|
||||||
|
}
|
||||||
|
columnData << QString(elmName.c_str()) << QString(value.c_str()) << "";// << elmtType;
|
||||||
|
|
||||||
|
newItem = new CFormItem(elmt, columnData, this, *whereV, *whereN);
|
||||||
|
this->appendChild(newItem);
|
||||||
|
|
||||||
|
return newItem;
|
||||||
|
//if (parents.last()->childCount() > 0) {
|
||||||
|
// parents << parents.last()->child(parents.last()->childCount()-1);
|
||||||
|
//}
|
||||||
|
|
||||||
|
// The building of the tree should be haoppening in the mode,.
|
||||||
|
//loadFormData(elmt, parent->child(parent->childCount()-1));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// add Defaults
|
||||||
|
// TODO: spams warnings for non ATOM values but i dont get type of non existing nodes
|
||||||
|
bool success = root->getValueByName(value, elmName.c_str(),UFormElm::Eval,whereV);
|
||||||
|
switch (*whereN)
|
||||||
|
{
|
||||||
|
case UFormElm::NodeForm:
|
||||||
|
elmtType.append("_fromForm"); break;
|
||||||
|
case UFormElm::NodeParentForm:
|
||||||
|
elmtType.append("_fromParentForm"); break;
|
||||||
|
case UFormElm::NodeDfn:
|
||||||
|
elmtType.append("_isDFN"); break;
|
||||||
|
case UFormElm::NodeType:
|
||||||
|
elmtType.append("_isType"); break;
|
||||||
|
default:
|
||||||
|
elmtType.append("_noNode");
|
||||||
|
}
|
||||||
|
switch (*whereV)
|
||||||
|
{
|
||||||
|
case UFormElm::ValueForm:
|
||||||
|
elmtType.append("_formValue"); break;
|
||||||
|
case UFormElm::ValueParentForm:
|
||||||
|
elmtType.append("_parentValue"); break;
|
||||||
|
case UFormElm::ValueDefaultDfn:
|
||||||
|
elmtType.append("_dfnValue"); break;
|
||||||
|
case UFormElm::ValueDefaultType:
|
||||||
|
elmtType.append("_typeValue"); break;
|
||||||
|
default:
|
||||||
|
elmtType.append("_noValue");
|
||||||
|
}
|
||||||
|
|
||||||
|
columnData << QString(elmName.c_str()) << QString(value.c_str()) << "";// << elmtType;
|
||||||
|
newItem = new CFormItem(elmt, columnData, this, *whereV, *whereN);
|
||||||
|
this->appendChild(newItem);
|
||||||
|
return newItem;
|
||||||
|
}
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// nlinfo("getNodeByName returned false");
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,11 +33,13 @@ namespace GeorgesQt
|
||||||
public:
|
public:
|
||||||
CFormItem(NLGEORGES::UFormElm *elm, const QList<QVariant> &data,
|
CFormItem(NLGEORGES::UFormElm *elm, const QList<QVariant> &data,
|
||||||
CFormItem *parent = 0,
|
CFormItem *parent = 0,
|
||||||
NLGEORGES::UFormElm::TWhereIsValue = NLGEORGES::UFormElm::ValueForm,
|
NLGEORGES::UFormElm::TWhereIsValue wV = NLGEORGES::UFormElm::ValueForm,
|
||||||
NLGEORGES::UFormElm::TWhereIsNode = NLGEORGES::UFormElm::NodeForm);
|
NLGEORGES::UFormElm::TWhereIsNode wN = NLGEORGES::UFormElm::NodeForm);
|
||||||
~CFormItem();
|
~CFormItem();
|
||||||
|
|
||||||
void appendChild(CFormItem *child);
|
void appendChild(CFormItem *child);
|
||||||
|
//CFormItem *add (/*TSub type,*/ const char *name, uint structId, const char *formName, uint slot);
|
||||||
|
CFormItem *add(NLGEORGES::UFormElm* root, std::string elmName);
|
||||||
|
|
||||||
CFormItem *child(int row);
|
CFormItem *child(int row);
|
||||||
int childCount() const;
|
int childCount() const;
|
||||||
|
@ -56,13 +58,18 @@ namespace GeorgesQt
|
||||||
return whereN;
|
return whereN;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
void setValueFrom(NLGEORGES::UFormElm::TWhereIsValue wV) { whereV = wV; }
|
||||||
|
void setNodeFrom(NLGEORGES::UFormElm::TWhereIsNode wN) { whereN = wN; }
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
//CFormItem() { whereV = NLGEORGES::UFormElm::ValueForm; whereN = NLGEORGES::UFormElm::NodeForm; }
|
||||||
QList<CFormItem*> childItems;
|
QList<CFormItem*> childItems;
|
||||||
QList<QVariant> itemData;
|
QList<QVariant> itemData;
|
||||||
CFormItem *parentItem;
|
CFormItem *parentItem;
|
||||||
NLGEORGES::UFormElm* formElm;
|
NLGEORGES::UFormElm* formElm;
|
||||||
NLGEORGES::UFormElm::TWhereIsValue whereV;
|
NLGEORGES::UFormElm::TWhereIsValue whereV;
|
||||||
NLGEORGES::UFormElm::TWhereIsNode whereN;
|
NLGEORGES::UFormElm::TWhereIsNode whereN;
|
||||||
}; // CFormItem
|
}; // CFormItem
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ namespace GeorgesQt
|
||||||
// Set the default sheet dir dir to the level design path.
|
// Set the default sheet dir dir to the level design path.
|
||||||
m_lastSheetDir = ".";
|
m_lastSheetDir = ".";
|
||||||
QSettings *settings = Core::ICore::instance()->settings();
|
QSettings *settings = Core::ICore::instance()->settings();
|
||||||
settings->beginGroup(Core::Constants::DATA_PATH_SECTION);
|
settings->beginGroup(Core::Constants::DATA_PATH_SECTION);
|
||||||
m_lastSheetDir = settings->value(Core::Constants::LEVELDESIGN_PATH, "l:/leveldesign").toString();
|
m_lastSheetDir = settings->value(Core::Constants::LEVELDESIGN_PATH, "l:/leveldesign").toString();
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
|
|
||||||
|
@ -102,12 +102,12 @@ namespace GeorgesQt
|
||||||
void CGeorgesTreeViewDialog::headerClicked(int section)
|
void CGeorgesTreeViewDialog::headerClicked(int section)
|
||||||
{
|
{
|
||||||
if (section == 0)
|
if (section == 0)
|
||||||
{
|
{
|
||||||
if (*(m_header->expanded()))
|
if (*(m_header->expanded()))
|
||||||
m_ui.treeView->expandAll();
|
m_ui.treeView->expandAll();
|
||||||
else
|
else
|
||||||
m_ui.treeView->collapseAll();
|
m_ui.treeView->collapseAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGeorgesTreeViewDialog::setForm(const CForm *form)
|
void CGeorgesTreeViewDialog::setForm(const CForm *form)
|
||||||
|
@ -119,8 +119,8 @@ namespace GeorgesQt
|
||||||
{
|
{
|
||||||
if(NLMISC::CPath::exists(formName.toStdString()))
|
if(NLMISC::CPath::exists(formName.toStdString()))
|
||||||
{
|
{
|
||||||
//NLGEORGES::CForm *form = dynamic_cast<NLGEORGES::CForm*>(m_georges->loadForm(formName.toStdString()));
|
//NLGEORGES::CForm *form = dynamic_cast<NLGEORGES::CForm*>(m_georges->loadForm(formName.toStdString()));
|
||||||
return (NLGEORGES::CForm *)m_georges->loadForm(formName.toStdString());
|
return (NLGEORGES::CForm *)m_georges->loadForm(formName.toStdString());
|
||||||
}
|
}
|
||||||
//else
|
//else
|
||||||
//{
|
//{
|
||||||
|
@ -156,56 +156,56 @@ namespace GeorgesQt
|
||||||
// }
|
// }
|
||||||
// return form;
|
// return form;
|
||||||
//}
|
//}
|
||||||
nlinfo("File '%s' does not exist!", formName.toStdString().c_str());
|
nlinfo("File '%s' does not exist!", formName.toStdString().c_str());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
NLGEORGES::CForm* CGeorgesTreeViewDialog::getFormByDfnName(const QString dfnName)
|
NLGEORGES::CForm* CGeorgesTreeViewDialog::getFormByDfnName(const QString dfnName)
|
||||||
{
|
{
|
||||||
if(NLMISC::CPath::exists(dfnName.toStdString()))
|
if(NLMISC::CPath::exists(dfnName.toStdString()))
|
||||||
{
|
{
|
||||||
// Create a new form object.
|
// Create a new form object.
|
||||||
NLGEORGES::CForm *form = new NLGEORGES::CForm();
|
NLGEORGES::CForm *form = new NLGEORGES::CForm();
|
||||||
m_form = form;
|
m_form = form;
|
||||||
|
|
||||||
// Retrieve a copy of the root definition.
|
// Retrieve a copy of the root definition.
|
||||||
NLGEORGES::CFormDfn *formDfn = dynamic_cast<NLGEORGES::CFormDfn *>(m_georges->loadFormDfn(dfnName.toStdString()));
|
NLGEORGES::CFormDfn *formDfn = dynamic_cast<NLGEORGES::CFormDfn *>(m_georges->loadFormDfn(dfnName.toStdString()));
|
||||||
|
|
||||||
// Next we'll use the root node to build a new form.
|
// Next we'll use the root node to build a new form.
|
||||||
NLGEORGES::CFormElmStruct *fes = dynamic_cast<NLGEORGES::CFormElmStruct *>(getRootNode(0));
|
NLGEORGES::CFormElmStruct *fes = dynamic_cast<NLGEORGES::CFormElmStruct *>(getRootNode(0));
|
||||||
fes->build(formDfn);
|
fes->build(formDfn);
|
||||||
|
|
||||||
// And then initialize the held elements;
|
// And then initialize the held elements;
|
||||||
for(uint i = 0; i<NLGEORGES::CForm::HeldElementCount; i++)
|
for(uint i = 0; i<NLGEORGES::CForm::HeldElementCount; i++)
|
||||||
{
|
{
|
||||||
fes = dynamic_cast<NLGEORGES::CFormElmStruct *>(getRootNode(i+1));
|
fes = dynamic_cast<NLGEORGES::CFormElmStruct *>(getRootNode(i+1));
|
||||||
fes->build(formDfn);
|
fes->build(formDfn);
|
||||||
}
|
}
|
||||||
|
|
||||||
return form;
|
return form;
|
||||||
}
|
}
|
||||||
nlinfo("File '%s' does not exist!", dfnName.toStdString().c_str());
|
nlinfo("File '%s' does not exist!", dfnName.toStdString().c_str());
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
NLGEORGES::CFormElm *CGeorgesTreeViewDialog::getRootNode(uint slot)
|
NLGEORGES::CFormElm *CGeorgesTreeViewDialog::getRootNode(uint slot)
|
||||||
{
|
{
|
||||||
NLGEORGES::CForm *form = getFormPtr();
|
NLGEORGES::CForm *form = getFormPtr();
|
||||||
|
|
||||||
if(slot == 0)
|
if(slot == 0)
|
||||||
{
|
{
|
||||||
const NLGEORGES::UFormElm &formElm = form->getRootNode();
|
const NLGEORGES::UFormElm &formElm = form->getRootNode();
|
||||||
return (NLGEORGES::CFormElm *)&formElm;
|
return (NLGEORGES::CFormElm *)&formElm;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure the slot value is valid and then return the corresponding element.
|
// Make sure the slot value is valid and then return the corresponding element.
|
||||||
nlassert(slot < NLGEORGES::CForm::HeldElementCount+1);
|
nlassert(slot < NLGEORGES::CForm::HeldElementCount+1);
|
||||||
return getFormPtr()->HeldElements[slot-1];
|
return getFormPtr()->HeldElements[slot-1];
|
||||||
}
|
}
|
||||||
|
|
||||||
NLGEORGES::CForm *CGeorgesTreeViewDialog::getFormPtr()
|
NLGEORGES::CForm *CGeorgesTreeViewDialog::getFormPtr()
|
||||||
{
|
{
|
||||||
return dynamic_cast<NLGEORGES::CForm *>(m_form);
|
return dynamic_cast<NLGEORGES::CForm *>(m_form);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGeorgesTreeViewDialog::loadFormIntoDialog(CForm *form)
|
void CGeorgesTreeViewDialog::loadFormIntoDialog(CForm *form)
|
||||||
|
@ -219,14 +219,16 @@ namespace GeorgesQt
|
||||||
UFormElm *root = 0;
|
UFormElm *root = 0;
|
||||||
root = &m_form->getRootNode();
|
root = &m_form->getRootNode();
|
||||||
|
|
||||||
|
// Extract the parent forms into the list of parents in the dialog.
|
||||||
QStringList parents;
|
QStringList parents;
|
||||||
uint cnt = form->getParentCount();
|
uint cnt = form->getParentCount();
|
||||||
for (uint i = 0; i < cnt /*form->getParentCount()*/; i++)
|
for (uint i = 0; i < cnt /*form->getParentCount()*/; i++)
|
||||||
{
|
{
|
||||||
UForm *u = m_form->getParentForm(i);
|
UForm *u = m_form->getParentForm(i);
|
||||||
parents << u->getFilename().c_str();
|
parents << u->getFilename().c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Exact the comment box for the dialog.
|
||||||
QString comments;
|
QString comments;
|
||||||
comments = m_form->getComment().c_str();
|
comments = m_form->getComment().c_str();
|
||||||
|
|
||||||
|
@ -255,7 +257,7 @@ namespace GeorgesQt
|
||||||
{
|
{
|
||||||
loadedForm = m_form->getFilename().c_str();
|
loadedForm = m_form->getFilename().c_str();
|
||||||
|
|
||||||
CGeorgesFormModel *model = new CGeorgesFormModel(root,deps,comments,parents,m_header->expanded());
|
CGeorgesFormModel *model = new CGeorgesFormModel(m_form,deps,comments,parents,m_header->expanded());
|
||||||
CGeorgesFormProxyModel *proxyModel = new CGeorgesFormProxyModel();
|
CGeorgesFormProxyModel *proxyModel = new CGeorgesFormProxyModel();
|
||||||
proxyModel->setSourceModel(model);
|
proxyModel->setSourceModel(model);
|
||||||
m_ui.treeView->setModel(proxyModel);
|
m_ui.treeView->setModel(proxyModel);
|
||||||
|
@ -317,12 +319,12 @@ namespace GeorgesQt
|
||||||
void CGeorgesTreeViewDialog::write( )
|
void CGeorgesTreeViewDialog::write( )
|
||||||
{
|
{
|
||||||
|
|
||||||
NLMISC::COFile file;
|
NLMISC::COFile file;
|
||||||
std::string s = NLMISC::CPath::lookup(loadedForm.toStdString(), false);
|
std::string s = NLMISC::CPath::lookup(loadedForm.toStdString(), false);
|
||||||
if(file.open (s))
|
if(file.open (s))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// if (loadedForm.contains(".typ"))
|
// if (loadedForm.contains(".typ"))
|
||||||
// {
|
// {
|
||||||
// //nlassert (Type != NULL);
|
// //nlassert (Type != NULL);
|
||||||
|
@ -335,7 +337,7 @@ namespace GeorgesQt
|
||||||
// // flushValueChange ();
|
// // flushValueChange ();
|
||||||
// //}
|
// //}
|
||||||
// //Type->write (xmlStream.getDocument (), theApp.Georges4CVS);
|
// //Type->write (xmlStream.getDocument (), theApp.Georges4CVS);
|
||||||
// //modify (NULL, NULL, false);
|
// //modify (NULL, NULL, false);
|
||||||
// //flushValueChange ();
|
// //flushValueChange ();
|
||||||
// //UpdateAllViews (NULL);
|
// //UpdateAllViews (NULL);
|
||||||
// //return TRUE;
|
// //return TRUE;
|
||||||
|
@ -357,17 +359,17 @@ namespace GeorgesQt
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
nlassert (m_form != NULL);
|
nlassert (m_form != NULL);
|
||||||
|
|
||||||
// Write the file
|
// Write the file
|
||||||
// /*if (IsModified ())
|
// /*if (IsModified ())
|
||||||
// {
|
// {
|
||||||
// ((CForm*)(UForm*)Form)->Header.MinorVersion++;
|
// ((CForm*)(UForm*)Form)->Header.MinorVersion++;
|
||||||
// }*/
|
// }*/
|
||||||
// //((CForm*)(UForm*)Form)->write (xmlStream.getDocument (), lpszPathName, theApp.Georges4CVS);
|
// //((CForm*)(UForm*)Form)->write (xmlStream.getDocument (), lpszPathName, theApp.Georges4CVS);
|
||||||
m_form->write(file, false);
|
m_form->write(file, false);
|
||||||
setWindowTitle(windowTitle().remove("*"));
|
setWindowTitle(windowTitle().remove("*"));
|
||||||
m_modified = false;
|
m_modified = false;
|
||||||
// //if (strcmp (xmlStream.getErrorString (), "") != 0)
|
// //if (strcmp (xmlStream.getErrorString (), "") != 0)
|
||||||
// //{
|
// //{
|
||||||
// // char message[512];
|
// // char message[512];
|
||||||
|
@ -381,16 +383,16 @@ namespace GeorgesQt
|
||||||
// // Get the left view
|
// // Get the left view
|
||||||
// //CView* pView = getLeftView ();
|
// //CView* pView = getLeftView ();
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
catch (Exception &e)
|
catch (Exception &e)
|
||||||
{
|
{
|
||||||
nlerror("Error while loading file: %s", e.what());
|
nlerror("Error while loading file: %s", e.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
nlerror("Can't open the file %s for writing.", s.c_str());
|
nlerror("Can't open the file %s for writing.", s.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGeorgesTreeViewDialog::doubleClicked ( const QModelIndex & index )
|
void CGeorgesTreeViewDialog::doubleClicked ( const QModelIndex & index )
|
||||||
|
|
|
@ -57,14 +57,14 @@ namespace GeorgesQt
|
||||||
bool isModified() {return m_modified;}
|
bool isModified() {return m_modified;}
|
||||||
void setModified(bool m) {m_modified = m;}
|
void setModified(bool m) {m_modified = m;}
|
||||||
|
|
||||||
NLGEORGES::CForm* getFormByName(const QString formName);
|
NLGEORGES::CForm* getFormByName(const QString formName);
|
||||||
NLGEORGES::CForm* getFormByDfnName(const QString dfnName);
|
NLGEORGES::CForm* getFormByDfnName(const QString dfnName);
|
||||||
|
|
||||||
/// Retrieves the root element based on the slot (document or held elements.)
|
/// Retrieves the root element based on the slot (document or held elements.)
|
||||||
NLGEORGES::CFormElm *getRootNode(uint slot);
|
NLGEORGES::CFormElm *getRootNode(uint slot);
|
||||||
|
|
||||||
/// Returns the form as a CForm pointer.
|
/// Returns the form as a CForm pointer.
|
||||||
NLGEORGES::CForm *getFormPtr();
|
NLGEORGES::CForm *getFormPtr();
|
||||||
|
|
||||||
void addParentForm(QString parentFormNm);
|
void addParentForm(QString parentFormNm);
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -27,6 +27,10 @@
|
||||||
|
|
||||||
namespace NLGEORGES {
|
namespace NLGEORGES {
|
||||||
class UFormElm;
|
class UFormElm;
|
||||||
|
class UForm;
|
||||||
|
class CFormElmStruct;
|
||||||
|
class CFormDfn;
|
||||||
|
class CFormElmArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace GeorgesQt
|
namespace GeorgesQt
|
||||||
|
@ -38,7 +42,7 @@ namespace GeorgesQt
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CGeorgesFormModel(NLGEORGES::UFormElm *root, QMap< QString, QStringList> deps,
|
CGeorgesFormModel(NLGEORGES::UForm *form, QMap< QString, QStringList> deps,
|
||||||
QString comment, QStringList parents, bool* expanded, QObject *parent = 0);
|
QString comment, QStringList parents, bool* expanded, QObject *parent = 0);
|
||||||
~CGeorgesFormModel();
|
~CGeorgesFormModel();
|
||||||
|
|
||||||
|
@ -58,15 +62,22 @@ namespace GeorgesQt
|
||||||
void setShowDefaults( bool show );
|
void setShowDefaults( bool show );
|
||||||
void addParentForm(QString parentForm);
|
void addParentForm(QString parentForm);
|
||||||
void removeParentForm(QString parentForm);
|
void removeParentForm(QString parentForm);
|
||||||
NLGEORGES::UFormElm *getRootForm() { return m_rootElm; }
|
NLGEORGES::UFormElm *getRootForm() { return m_rootElm; }
|
||||||
|
|
||||||
|
CFormItem *addStruct (CFormItem *parent, NLGEORGES::CFormElmStruct *_struct, NLGEORGES::CFormDfn *parentDfn,
|
||||||
|
const char *name, uint structId, const char *formName, uint slot);
|
||||||
|
|
||||||
|
CFormItem *addArray(CFormItem *parent, NLGEORGES::CFormElmArray *array, NLGEORGES::CFormDfn *rootDfn,
|
||||||
|
const char *name, uint structId, const char *formName, uint slot);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setupModelData();
|
void setupModelData();
|
||||||
void loadFormData(NLGEORGES::UFormElm *rootElm, CFormItem *parent);
|
void loadFormData(NLGEORGES::UFormElm *rootElm, CFormItem *parent);
|
||||||
void loadFormHeader();
|
void loadFormHeader();
|
||||||
|
|
||||||
|
NLGEORGES::UForm* m_form;
|
||||||
CFormItem* m_rootItem;
|
CFormItem* m_rootItem;
|
||||||
NLGEORGES::UFormElm* m_rootElm;
|
NLGEORGES::UFormElm* m_rootElm;
|
||||||
QList<QVariant> m_rootData;
|
QList<QVariant> m_rootData;
|
||||||
QMap< QString, QStringList> m_dependencies;
|
QMap< QString, QStringList> m_dependencies;
|
||||||
QString m_comments;
|
QString m_comments;
|
||||||
|
|
|
@ -66,7 +66,7 @@ CMainWindow::CMainWindow(QWidget *parent)
|
||||||
_isGraphicsInitialized(false),
|
_isGraphicsInitialized(false),
|
||||||
_isGraphicsEnabled(false),
|
_isGraphicsEnabled(false),
|
||||||
_isSoundInitialized(false),
|
_isSoundInitialized(false),
|
||||||
_isSoundEnabled(true),
|
_isSoundEnabled(false), // MTR workaround for sheet id nonsense
|
||||||
_GraphicsViewport(NULL),
|
_GraphicsViewport(NULL),
|
||||||
_lastDir("."),
|
_lastDir("."),
|
||||||
_mouseMode(NL3D::U3dMouseListener::edit3d)
|
_mouseMode(NL3D::U3dMouseListener::edit3d)
|
||||||
|
|
Loading…
Reference in a new issue