/** * Constructor. */ SimpleCodeGenerator::SimpleCodeGenerator(bool createDirHierarchyForPackages) : CodeGenerator(), m_createDirHierarchyForPackages(createDirHierarchyForPackages), m_indentLevel(0) { m_document->disconnect(this); // disconnect from UMLDoc.. we arent planning to be synced at all // load Classifier documents from parent document // initFromParentDocument(); m_fileMap.clear(); // this really is just being used to sync the internal params // to the codegenpolicy as there are no code documents to really sync. syncCodeToDocument(); }
/** * Constructor. * @param parent the parent (wizard) of this wizard page */ CodeGenOptionsPage::CodeGenOptionsPage(QWidget *parent) : QWizardPage(parent) { setTitle(i18n("Code Generation Options")); setSubTitle(i18n("Adjust code generation options.")); setupUi(this); m_pCodePolicyPage = 0; m_parentPolicy = UMLApp::app()->commonPolicy(); CodeGenerator* gen = UMLApp::app()->generator(); ui_forceDoc->setChecked(m_parentPolicy->getCodeVerboseDocumentComments()); ui_forceSections->setChecked(m_parentPolicy->getCodeVerboseSectionComments()); ui_outputDir->setText(m_parentPolicy->getOutputDirectory().absolutePath()); ui_includeHeadings->setChecked(m_parentPolicy->getIncludeHeadings()); ui_headingsDir->setText(m_parentPolicy->getHeadingFileDir()); overwriteToWidget(m_parentPolicy->getOverwritePolicy())->setChecked(true); ui_SelectEndLineCharsBox->setCurrentIndex(newLineToInteger(m_parentPolicy->getLineEndingType())); ui_SelectIndentationTypeBox->setCurrentIndex(indentTypeToInteger(m_parentPolicy->getIndentationType())); ui_SelectIndentationNumber->setValue(m_parentPolicy->getIndentationAmount()); connect(this, SIGNAL(syncCodeDocumentsToParent()), gen, SLOT(syncCodeToDocument())); connect(this, SIGNAL(languageChanged()), this, SLOT(updateCodeGenerationPolicyTab())); connect(this, SIGNAL(languageChanged()), this, SLOT(changeLanguage())); connect(ui_browseOutput, SIGNAL(clicked()), this, SLOT(browseClicked())); connect(ui_browseHeadings, SIGNAL(clicked()), this, SLOT(browseClicked())); setupActiveLanguageBox(); //now insert the language-dependant page, should there be one updateCodeGenerationPolicyTab(); }