[Uml-devel] kdesdk/umbrello/umbrello/dialogs
Brian Thomas
thomas at mail630.gsfc.nasa.gov
Fri Dec 12 07:50:03 UTC 2003
CVS commit by thomas:
fix bug 69332 : code gen wizard now changes language correctly
M +11 -4 codegenerationwizard.cpp 1.12
M +4 -0 codegenerationwizard.h 1.7
--- kdesdk/umbrello/umbrello/dialogs/codegenerationwizard.cpp #1.11:1.12
@@ -49,4 +49,5 @@ CodeGenerationWizard::CodeGenerationWiza
m_CodeGenerationOptionsPage = new CodeGenerationOptionsPage(doc->getCurrentCodeGenerator(), ldict,
activeLanguage, this);
+ connect( m_CodeGenerationOptionsPage, SIGNAL(languageChanged()), this, SLOT(changeLanguage()) );
insertPage(m_CodeGenerationOptionsPage, i18n("Code Generation Options"), 1);
@@ -106,6 +107,4 @@ void CodeGenerationWizard::generateCode(
CodeGenerator* codeGenerator = m_app->getGenerator();
-kdDebug()<<" WIZARD: gets generator:"<<codeGenerator<<endl;
-
if (codeGenerator) {
@@ -123,5 +122,4 @@ kdDebug()<<" WIZARD: gets generator:"<<c
cList.append(concept);
}
-kdDebug()<<" WIZARD: Writing code to CFile"<<endl;
codeGenerator->writeCodeToFile(cList);
finishButton()->setText(i18n("Finish"));
@@ -135,5 +133,5 @@ void CodeGenerationWizard::classGenerate
QListViewItem* item = m_statusList->findItem( concept->getName(), 0 );
if( !item ) {
- kdDebug()<<"GenerationStatusPage::Error finding class in list view"<<endl;
+ kdError()<<"GenerationStatusPage::Error finding class in list view"<<endl;
} else if (generated) {
item->setText( 1, i18n("Code Generated") );
@@ -244,3 +242,12 @@ CodeGenerator* CodeGenerationWizard::gen
}
+// when we change language, we need to update the codegenoptions page
+// language-dependent stuff. THe way to do this is to call its "apply" method.
+void CodeGenerationWizard::changeLanguage()
+{
+ m_app->setActiveLanguage( m_CodeGenerationOptionsPage->getCodeGenerationLanguage() );
+ m_CodeGenerationOptionsPage->setCodeGenerator(m_doc->getCurrentCodeGenerator());
+ m_CodeGenerationOptionsPage->apply();
+}
+
#include "codegenerationwizard.moc"
--- kdesdk/umbrello/umbrello/dialogs/codegenerationwizard.h #1.6:1.7
@@ -57,4 +57,8 @@ protected slots:
void classGenerated(UMLClassifier* concept, bool generated);
+private slots:
+ void changeLanguage();
+
+
private:
CodeGenerator* generator();
More information about the umbrello-devel
mailing list