|
|
|
@ -117,30 +117,30 @@ namespace GeorgesQt
|
|
|
|
|
|
|
|
|
|
NLGEORGES::CForm* CGeorgesTreeViewDialog::getFormByName(const QString formName)
|
|
|
|
|
{
|
|
|
|
|
if(NLMISC::CPath::exists(formName.toStdString()))
|
|
|
|
|
if(NLMISC::CPath::exists(formName.toUtf8().constData()))
|
|
|
|
|
{
|
|
|
|
|
//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.toUtf8()));
|
|
|
|
|
return (NLGEORGES::CForm *)m_georges->loadForm(formName.toUtf8().constData());
|
|
|
|
|
}
|
|
|
|
|
//else
|
|
|
|
|
//{
|
|
|
|
|
// CForm *form = 0;
|
|
|
|
|
// // Load the DFN
|
|
|
|
|
// std::string extStr = NLMISC::CFile::getExtension( formName.toStdString() );
|
|
|
|
|
// std::string extStr = NLMISC::CFile::getExtension( formName.toUtf8() );
|
|
|
|
|
// QString dfnName = QString("%1.dfn").arg(extStr.c_str());
|
|
|
|
|
// UFormDfn *formdfn;
|
|
|
|
|
// if (NLMISC::CPath::exists(dfnName.toStdString()))
|
|
|
|
|
// if (NLMISC::CPath::exists(dfnName.toUtf8()))
|
|
|
|
|
// {
|
|
|
|
|
// formdfn = _georges->loadFormDfn (dfnName.toStdString());
|
|
|
|
|
// formdfn = _georges->loadFormDfn (dfnName.toUtf8());
|
|
|
|
|
// if (!formdfn)
|
|
|
|
|
// {
|
|
|
|
|
// nlwarning("Failed to load dfn: %s", dfnName.toStdString().c_str());
|
|
|
|
|
// nlwarning("Failed to load dfn: %s", dfnName.toUtf8());
|
|
|
|
|
// return 0;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// else
|
|
|
|
|
// {
|
|
|
|
|
// nlwarning("Cannot find dfn: %s", dfnName.toStdString().c_str());
|
|
|
|
|
// nlwarning("Cannot find dfn: %s", dfnName.toUtf8());
|
|
|
|
|
// return 0;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
@ -156,20 +156,20 @@ namespace GeorgesQt
|
|
|
|
|
// }
|
|
|
|
|
// return form;
|
|
|
|
|
//}
|
|
|
|
|
nlinfo("File '%s' does not exist!", formName.toStdString().c_str());
|
|
|
|
|
nlinfo("File '%s' does not exist!", formName.toUtf8().constData());
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NLGEORGES::CForm* CGeorgesTreeViewDialog::getFormByDfnName(const QString dfnName)
|
|
|
|
|
{
|
|
|
|
|
if(NLMISC::CPath::exists(dfnName.toStdString()))
|
|
|
|
|
if(NLMISC::CPath::exists(dfnName.toUtf8().constData()))
|
|
|
|
|
{
|
|
|
|
|
// 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.toUtf8().constData()));
|
|
|
|
|
|
|
|
|
|
// Next we'll use the root node to build a new form.
|
|
|
|
|
NLGEORGES::CFormElmStruct *fes = dynamic_cast<NLGEORGES::CFormElmStruct *>(getRootNode(0));
|
|
|
|
@ -184,7 +184,7 @@ namespace GeorgesQt
|
|
|
|
|
|
|
|
|
|
return form;
|
|
|
|
|
}
|
|
|
|
|
nlinfo("File '%s' does not exist!", dfnName.toStdString().c_str());
|
|
|
|
|
nlinfo("File '%s' does not exist!", dfnName.toUtf8().constData());
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -250,7 +250,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(";").toUtf8());
|
|
|
|
|
if (root)
|
|
|
|
|
{
|
|
|
|
|
loadedForm = m_form->getFilename().c_str();
|
|
|
|
@ -277,7 +277,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.toUtf8().constData());
|
|
|
|
|
NLGEORGES::CForm *parentForm = dynamic_cast<NLGEORGES::CForm*>(uParentForm);
|
|
|
|
|
NLGEORGES::CForm *mainForm = static_cast<NLGEORGES::CForm*>(m_form);
|
|
|
|
|
|
|
|
|
@ -292,11 +292,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.toUtf8(), parentForm))
|
|
|
|
|
nlwarning("Failed to add parent form: %s", parentFormNm.toUtf8().constData());
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
nlinfo("Successfullyadded parent form: %s", parentFormNm.toStdString().c_str());
|
|
|
|
|
nlinfo("Successfullyadded parent form: %s", parentFormNm.toUtf8().constData());
|
|
|
|
|
model->addParentForm(parentFormNm);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -318,7 +318,7 @@ namespace GeorgesQt
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
NLMISC::COFile file;
|
|
|
|
|
std::string s = NLMISC::CPath::lookup(loadedForm.toStdString(), false);
|
|
|
|
|
std::string s = NLMISC::CPath::lookup(loadedForm.toUtf8().constData(), false);
|
|
|
|
|
if(file.open (s))
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
@ -406,7 +406,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().toUtf8().constData(),false).c_str());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//// col containing additional stuff like icons
|
|
|
|
@ -416,7 +416,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.toUtf8(),false).c_str();
|
|
|
|
|
|
|
|
|
|
// if(value.contains(".tga") || value.contains(".png"))
|
|
|
|
|
// {
|
|
|
|
@ -444,7 +444,7 @@ namespace GeorgesQt
|
|
|
|
|
// {
|
|
|
|
|
// Modules::objViewInt()->resetScene();
|
|
|
|
|
// //Modules::config().configRemapExtensions();
|
|
|
|
|
// Modules::objViewInt()->loadMesh(path.toStdString(),"");
|
|
|
|
|
// Modules::objViewInt()->loadMesh(path.toUtf8(),"");
|
|
|
|
|
// }
|
|
|
|
|
// 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.toUtf8().constData());
|
|
|
|
|
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.toUtf8().constData());
|
|
|
|
|
|
|
|
|
|
// Call to add the form and load it into the Georges form.
|
|
|
|
|
addParentForm(tmpFileName);
|
|
|
|
|