rubycodegenerationpolicypage.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "rubycodegenerationpolicypage.h"
00022
00023 #include <qlabel.h>
00024 #include <qcombobox.h>
00025 #include <qcheckbox.h>
00026 #include <kdebug.h>
00027 #include <klocale.h>
00028
00029 #include "rubycodegenerationformbase.h"
00030 #include "../codegenerationpolicy.h"
00031 #include "../uml.h"
00032
00033 RubyCodeGenerationPolicyPage::RubyCodeGenerationPolicyPage( QWidget *parent, const char *name, RubyCodeGenerationPolicy * policy )
00034 : CodeGenerationPolicyPage(parent, name, policy)
00035 {
00036 CodeGenerationPolicy *common = UMLApp::app()->getCommonPolicy();
00037 form = new RubyCodeGenerationFormBase(this);
00038 form->m_SelectCommentStyle->setCurrentItem((int)(common->getCommentStyle()));
00039 form->m_generateConstructors->setChecked(common->getAutoGenerateConstructors());
00040 form->m_generateAttribAccessors->setChecked(policy->getAutoGenerateAttribAccessors());
00041 form->m_generateAssocAccessors->setChecked(policy->getAutoGenerateAssocAccessors());
00042 form->m_accessorScopeCB->setCurrentItem((common->getAttributeAccessorScope() - 200));
00043 form->m_assocFieldScopeCB->setCurrentItem((common->getAssociationFieldScope() - 200));
00044 }
00045
00046 RubyCodeGenerationPolicyPage::~RubyCodeGenerationPolicyPage()
00047 {
00048 }
00049
00050 void RubyCodeGenerationPolicyPage::apply()
00051 {
00052 CodeGenerationPolicy *common = UMLApp::app()->getCommonPolicy();
00053
00054
00055 RubyCodeGenerationPolicy * parent = (RubyCodeGenerationPolicy*) m_parentPolicy;
00056
00057
00058 parent->blockSignals(true);
00059
00060 common->setCommentStyle((CodeGenerationPolicy::CommentStyle) form->m_SelectCommentStyle->currentItem());
00061 common->setAttributeAccessorScope((CodeGenerationPolicy::ScopePolicy) (form->m_accessorScopeCB->currentItem()+200));
00062 common->setAssociationFieldScope((CodeGenerationPolicy::ScopePolicy) (form->m_assocFieldScopeCB->currentItem()+200));
00063 common->setAutoGenerateConstructors(form->m_generateConstructors->isChecked());
00064 parent->setAutoGenerateAttribAccessors(form->m_generateAttribAccessors->isChecked());
00065 parent->setAutoGenerateAssocAccessors(form->m_generateAssocAccessors->isChecked());
00066
00067 parent->blockSignals(false);
00068
00069
00070 common->emitModifiedCodeContentSig();
00071
00072 }
00073
00074
00075 #include "rubycodegenerationpolicypage.moc"
This file is part of the documentation for umbrello Version 3.1.0.