From bd9e6617827818fd043452c08c606f07b78014a0 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- .../rubycodegenerationpolicypage.cpp | 75 ++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 umbrello/umbrello/codegenerators/rubycodegenerationpolicypage.cpp (limited to 'umbrello/umbrello/codegenerators/rubycodegenerationpolicypage.cpp') diff --git a/umbrello/umbrello/codegenerators/rubycodegenerationpolicypage.cpp b/umbrello/umbrello/codegenerators/rubycodegenerationpolicypage.cpp new file mode 100644 index 00000000..1e9080c9 --- /dev/null +++ b/umbrello/umbrello/codegenerators/rubycodegenerationpolicypage.cpp @@ -0,0 +1,75 @@ +/*************************************************************************** + rubycodegenerationpolicypage.cpp + Derived from the Java code generator by thomas + + begin : Thur Jul 21 2005 + author : Richard Dale + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * copyright (C) 2006-2007 * + * Umbrello UML Modeller Authors * + ***************************************************************************/ + +// own header +#include "rubycodegenerationpolicypage.h" +// qt/kde includes +#include +#include +#include +#include +#include +// app includes +#include "rubycodegenerationformbase.h" +#include "../codegenerationpolicy.h" +#include "../uml.h" + +RubyCodeGenerationPolicyPage::RubyCodeGenerationPolicyPage( QWidget *parent, const char *name, RubyCodeGenerationPolicy * policy ) + : CodeGenerationPolicyPage(parent, name, policy) +{ + CodeGenerationPolicy *common = UMLApp::app()->getCommonPolicy(); + form = new RubyCodeGenerationFormBase(this); + form->m_SelectCommentStyle->setCurrentItem((int)(common->getCommentStyle())); + form->m_generateConstructors->setChecked(common->getAutoGenerateConstructors()); + form->m_generateAttribAccessors->setChecked(policy->getAutoGenerateAttribAccessors()); + form->m_generateAssocAccessors->setChecked(policy->getAutoGenerateAssocAccessors()); + form->m_accessorScopeCB->setCurrentItem((common->getAttributeAccessorScope() - 200)); + form->m_assocFieldScopeCB->setCurrentItem((common->getAssociationFieldScope() - 200)); +} + +RubyCodeGenerationPolicyPage::~RubyCodeGenerationPolicyPage() +{ +} + +void RubyCodeGenerationPolicyPage::apply() +{ + CodeGenerationPolicy *common = UMLApp::app()->getCommonPolicy(); + + // now do our ruby-specific configs + RubyCodeGenerationPolicy * parent = (RubyCodeGenerationPolicy*) m_parentPolicy; + + // block signals so we don't cause too many update content calls to code documents + parent->blockSignals(true); + + common->setCommentStyle((CodeGenerationPolicy::CommentStyle) form->m_SelectCommentStyle->currentItem()); + common->setAttributeAccessorScope((CodeGenerationPolicy::ScopePolicy) (form->m_accessorScopeCB->currentItem()+200)); + common->setAssociationFieldScope((CodeGenerationPolicy::ScopePolicy) (form->m_assocFieldScopeCB->currentItem()+200)); + common->setAutoGenerateConstructors(form->m_generateConstructors->isChecked()); + parent->setAutoGenerateAttribAccessors(form->m_generateAttribAccessors->isChecked()); + parent->setAutoGenerateAssocAccessors(form->m_generateAssocAccessors->isChecked()); + + parent->blockSignals(false); + + // now send out modified code content signal + common->emitModifiedCodeContentSig(); + +} + + +#include "rubycodegenerationpolicypage.moc" -- cgit v1.2.3