예제 #1
0
void startDialog::on_ScriptEdit_clicked()
{
	EditorFrame *pMain = new EditorFrame();
	pMain->setHostWidget(this);
	pMain->setAttribute(Qt::WA_DeleteOnClose, true);

	if (!loadDataBase()) {
		nd_logerror("load database error\n");
	}

	std::string defProj = getPathFromConfig("script_root");

	if (!defProj.empty() && pMain->myInit(defProj.c_str() )) {
		this->setVisible(false);
		pMain->showMaximized();
	}
	else {
		delete pMain;
	}

}
예제 #2
0
bool startDialog::showScriptError(const char *scriptFile, const char *nodeDescript, const char *editorWorkingPath)
{
	nd_chdir(editorWorkingPath);

	EditorFrame *pMain = new EditorFrame();
	pMain->setHostWidget(this);
	pMain->setAttribute(Qt::WA_DeleteOnClose, true);
	
	if (pMain->myInit()) {
		this->setVisible(false);

		if (!pMain->showRuntimeError(scriptFile, nodeDescript)) {
			return false;
		}
		pMain->showMaximized();
	}
	else {
		delete pMain;
		return false;
	}
	return true;
}