|
|
|
@ -108,30 +108,30 @@ namespace GeorgesQt
|
|
|
|
|
|
|
|
|
|
NLGEORGES::CForm* CGeorgesTreeViewDialog::getFormByName(const QString formName)
|
|
|
|
|
{
|
|
|
|
|
if(NLMISC::CPath::exists(formName.toStdString()))
|
|
|
|
|
if(NLMISC::CPath::exists(formName.toAscii().data()))
|
|
|
|
|
{
|
|
|
|
|
//NLGEORGES::CForm *form = dynamic_cast<NLGEORGES::CForm*>(m_georges->loadForm(formName.toStdString()));
|
|
|
|
|
return (NLGEORGES::CForm *)m_georges->loadForm(formName.toStdString());
|
|
|
|
|
//NLGEORGES::CForm *form = dynamic_cast<NLGEORGES::CForm*>(m_georges->loadForm(formName.toAscii().data()));
|
|
|
|
|
return (NLGEORGES::CForm *)m_georges->loadForm(formName.toAscii().data());
|
|
|
|
|
}
|
|
|
|
|
//else
|
|
|
|
|
//{
|
|
|
|
|
// CForm *form = 0;
|
|
|
|
|
// // Load the DFN
|
|
|
|
|
// std::string extStr = NLMISC::CFile::getExtension( formName.toStdString() );
|
|
|
|
|
// std::string extStr = NLMISC::CFile::getExtension( formName.toAscii().data() );
|
|
|
|
|
// QString dfnName = QString("%1.dfn").arg(extStr.c_str());
|
|
|
|
|
// UFormDfn *formdfn;
|
|
|
|
|
// if (NLMISC::CPath::exists(dfnName.toStdString()))
|
|
|
|
|
// if (NLMISC::CPath::exists(dfnName.toAscii().data()))
|
|
|
|
|
// {
|
|
|
|
|
// formdfn = _georges->loadFormDfn (dfnName.toStdString());
|
|
|
|
|
// formdfn = _georges->loadFormDfn (dfnName.toAscii().data());
|
|
|
|
|
// if (!formdfn)
|
|
|
|
|
// {
|
|
|
|
|
// nlwarning("Failed to load dfn: %s", dfnName.toStdString().c_str());
|
|
|
|
|
// nlwarning("Failed to load dfn: %s", dfnName.toAscii().data());
|
|
|
|
|
// return 0;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// else
|
|
|
|
|
// {
|
|
|
|
|
// nlwarning("Cannot find dfn: %s", dfnName.toStdString().c_str());
|
|
|
|
|
// nlwarning("Cannot find dfn: %s", dfnName.toAscii().data());
|
|
|
|
|
// return 0;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
@ -147,20 +147,20 @@ namespace GeorgesQt
|
|
|
|
|
// }
|
|
|
|
|
// return form;
|
|
|
|
|
//}
|
|
|
|
|
nlinfo("File '%s' does not exist!", formName.toStdString().c_str());
|
|
|
|
|
nlinfo("File '%s' does not exist!", formName.toAscii().data());
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NLGEORGES::CForm* CGeorgesTreeViewDialog::getFormByDfnName(const QString dfnName)
|
|
|
|
|
{
|
|
|
|
|
if(NLMISC::CPath::exists(dfnName.toStdString()))
|
|
|
|
|
if(NLMISC::CPath::exists(dfnName.toAscii().data()))
|
|
|
|
|
{
|
|
|
|
|
// Create a new form object.
|
|
|
|
|
NLGEORGES::CForm *form = new NLGEORGES::CForm();
|
|
|
|
|
m_form = form;
|
|
|
|
|
|
|
|
|
|
// 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.toAscii().data()));
|
|
|
|
|
|
|
|
|
|
// Next we'll use the root node to build a new form.
|
|
|
|
|
NLGEORGES::CFormElmStruct *fes = dynamic_cast<NLGEORGES::CFormElmStruct *>(getRootNode(0));
|
|
|
|
@ -175,7 +175,7 @@ namespace GeorgesQt
|
|
|
|
|
|
|
|
|
|
return form;
|
|
|
|
|
}
|
|
|
|
|
nlinfo("File '%s' does not exist!", dfnName.toStdString().c_str());
|
|
|
|
|
nlinfo("File '%s' does not exist!", dfnName.toAscii().data());
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -243,7 +243,7 @@ namespace GeorgesQt
|
|
|
|
|
nlinfo("typ's %d",deps["typ"].count());
|
|
|
|
|
nlinfo("dfn's %d",deps["dfn"].count());
|
|
|
|
|
|
|
|
|
|
//nlwarning(strList.join(";").toStdString().c_str());
|
|
|
|
|
//nlwarning(strList.join(";").toAscii().data());
|
|
|
|
|
if (root)
|
|
|
|
|
{
|
|
|
|
|
loadedForm = m_form->getFilename().c_str();
|
|
|
|
@ -263,7 +263,7 @@ namespace GeorgesQt
|
|
|
|
|
void CGeorgesTreeViewDialog::addParentForm(QString parentFormNm)
|
|
|
|
|
{
|
|
|
|
|
// Try to load the form
|
|
|
|
|
NLGEORGES::UForm *uParentForm = m_georges->loadForm(parentFormNm.toStdString());
|
|
|
|
|
NLGEORGES::UForm *uParentForm = m_georges->loadForm(parentFormNm.toAscii().data());
|
|
|
|
|
NLGEORGES::CForm *parentForm = dynamic_cast<NLGEORGES::CForm*>(uParentForm);
|
|
|
|
|
NLGEORGES::CForm *mainForm = static_cast<NLGEORGES::CForm*>(m_form);
|
|
|
|
|
|
|
|
|
@ -277,11 +277,11 @@ namespace GeorgesQt
|
|
|
|
|
if (parentForm->Elements.FormDfn == mainForm->Elements.FormDfn)
|
|
|
|
|
{
|
|
|
|
|
// This is the parent form selector
|
|
|
|
|
if(!mainForm->insertParent(mainForm->getParentCount(),parentFormNm.toStdString().c_str(), parentForm))
|
|
|
|
|
nlwarning("Failed to add parent form: %s", parentFormNm.toStdString().c_str());
|
|
|
|
|
if(!mainForm->insertParent(mainForm->getParentCount(),parentFormNm.toAscii().data(), parentForm))
|
|
|
|
|
nlwarning("Failed to add parent form: %s", parentFormNm.toAscii().data());
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
nlinfo("Successfullyadded parent form: %s", parentFormNm.toStdString().c_str());
|
|
|
|
|
nlinfo("Successfullyadded parent form: %s", parentFormNm.toAscii().data());
|
|
|
|
|
model->addParentForm(parentFormNm);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -303,7 +303,7 @@ namespace GeorgesQt
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
NLMISC::COFile file;
|
|
|
|
|
std::string s = NLMISC::CPath::lookup(loadedForm.toStdString(), false);
|
|
|
|
|
std::string s = NLMISC::CPath::lookup(loadedForm.toAscii().data(), false);
|
|
|
|
|
if(file.open (s))
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
@ -387,7 +387,7 @@ namespace GeorgesQt
|
|
|
|
|
|
|
|
|
|
//if (item->parent() && item->parent()->data(0) == "parents")
|
|
|
|
|
//{
|
|
|
|
|
// Q_EMIT changeFile(CPath::lookup(item->data(0).toString().toStdString(),false).c_str());
|
|
|
|
|
// Q_EMIT changeFile(CPath::lookup(item->data(0).toString().toAscii().data(),false).c_str());
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
//// col containing additional stuff like icons
|
|
|
|
@ -397,7 +397,7 @@ namespace GeorgesQt
|
|
|
|
|
// CFormItem *item = m->getItem(in2);
|
|
|
|
|
// QString value = item->data(1).toString();
|
|
|
|
|
|
|
|
|
|
// QString path = CPath::lookup(value.toStdString(),false).c_str();
|
|
|
|
|
// QString path = CPath::lookup(value.toAscii().data(),false).c_str();
|
|
|
|
|
|
|
|
|
|
// if(value.contains(".tga") || value.contains(".png"))
|
|
|
|
|
// {
|
|
|
|
@ -425,7 +425,7 @@ namespace GeorgesQt
|
|
|
|
|
// {
|
|
|
|
|
// Modules::objViewInt()->resetScene();
|
|
|
|
|
// //Modules::config().configRemapExtensions();
|
|
|
|
|
// Modules::objViewInt()->loadMesh(path.toStdString(),"");
|
|
|
|
|
// Modules::objViewInt()->loadMesh(path.toAscii().data(),"");
|
|
|
|
|
// }
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
@ -551,7 +551,7 @@ namespace GeorgesQt
|
|
|
|
|
// file = file.remove(0,file.indexOf(".")+1);
|
|
|
|
|
// QString filePattern = "Parent Sheets (*."+file+")";
|
|
|
|
|
//
|
|
|
|
|
// nlinfo("parent defn name '%s'", file.toStdString().c_str());
|
|
|
|
|
// nlinfo("parent defn name '%s'", file.toAscii().data());
|
|
|
|
|
// QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Select parent sheets..."), m_lastSheetDir, filePattern);
|
|
|
|
|
// if(!fileNames.isEmpty())
|
|
|
|
|
// {
|
|
|
|
@ -561,7 +561,7 @@ namespace GeorgesQt
|
|
|
|
|
// QFileInfo pathInfo( fileToParent );
|
|
|
|
|
// QString tmpFileName( pathInfo.fileName() );
|
|
|
|
|
|
|
|
|
|
// nlinfo("requesting to add parent form '%s'", tmpFileName.toStdString().c_str());
|
|
|
|
|
// nlinfo("requesting to add parent form '%s'", tmpFileName.toAscii().data());
|
|
|
|
|
//
|
|
|
|
|
// // Call to add the form and load it into the Georges form.
|
|
|
|
|
// addParentForm(tmpFileName);
|
|
|
|
|