diff --git a/umbrello/dialogs/pages/associationgeneralpage.cpp b/umbrello/dialogs/pages/associationgeneralpage.cpp index 48fe845e28375a72ef64bff84ad925810d3441bf..660ce286ca50717ab8b26184c0d36daaa0de7776 100644 --- a/umbrello/dialogs/pages/associationgeneralpage.cpp +++ b/umbrello/dialogs/pages/associationgeneralpage.cpp @@ -16,6 +16,7 @@ #include "assocrules.h" #include "debug_utils.h" #include "dialog_utils.h" +#include "documentationwidget.h" #include "objectwidget.h" #include "umldoc.h" #include "umlobject.h" @@ -77,11 +78,8 @@ void AssociationGeneralPage::constructWidget() // group boxes for name+type, documentation properties QGroupBox *nameAndTypeGB = new QGroupBox(this); - QGroupBox *docGB = new QGroupBox(this); nameAndTypeGB->setTitle(i18n("Properties")); - docGB->setTitle(i18n("Documentation")); topLayout->addWidget(nameAndTypeGB); - topLayout->addWidget(docGB); m_pNameAndTypeLayout = new QGridLayout(nameAndTypeGB); m_pNameAndTypeLayout->setSpacing(6); @@ -182,14 +180,9 @@ void AssociationGeneralPage::constructWidget() #endif m_pNameAndTypeLayout->addWidget(m_pTypeCB, 1, 1); - // document - QHBoxLayout * docLayout = new QHBoxLayout(docGB); - docLayout->setMargin(margin); - - m_doc = new KTextEdit(docGB); - docLayout->addWidget(m_doc); - m_doc->setText(m_pAssociationWidget->documentation()); - m_doc->setWordWrapMode(QTextOption::WordWrap); + // documentation + m_docWidget = new DocumentationWidget(m_pAssociationWidget, this); + topLayout->addWidget(m_docWidget); } void AssociationGeneralPage::slotStereoCheckboxChanged(int state) @@ -222,7 +215,7 @@ void AssociationGeneralPage::apply() int comboBoxItem = m_pTypeCB->currentIndex(); Uml::AssociationType::Enum newType = m_AssocTypes[comboBoxItem]; m_pAssociationWidget->setAssociationType(newType); - m_pAssociationWidget->setDocumentation(m_doc->toPlainText()); + m_docWidget->apply(); if (m_pStereoChkB && m_pStereoChkB->isChecked()) { QString stereo = m_pAssocNameComB->currentText(); // keep the order diff --git a/umbrello/dialogs/pages/associationgeneralpage.h b/umbrello/dialogs/pages/associationgeneralpage.h index 5ef6a71503469d228319bf27ae603a8b073e2b07..cc4e47acbe853972ba34427755a135f9175ebdbb 100644 --- a/umbrello/dialogs/pages/associationgeneralpage.h +++ b/umbrello/dialogs/pages/associationgeneralpage.h @@ -18,12 +18,12 @@ #include class AssociationWidget; +class DocumentationWidget; class QCheckBox; class QGridLayout; class QLabel; class KComboBox; class KLineEdit; -class KTextEdit; class ObjectWidget; class UMLDoc; class UMLObject; @@ -57,7 +57,7 @@ private: so we can translate both ways */ QList m_AssocTypes; QStringList m_AssocTypeStrings; - KTextEdit *m_doc; + DocumentationWidget *m_docWidget; AssociationWidget *m_pAssociationWidget; ObjectWidget *m_pWidget; diff --git a/umbrello/dialogs/widgets/documentationwidget.cpp b/umbrello/dialogs/widgets/documentationwidget.cpp index 28c107f2b04eb4b6c1ae7ff609d57a739c9fe18d..4936fbd7c3f1df56506f35d3d52597bc924fe73a 100644 --- a/umbrello/dialogs/widgets/documentationwidget.cpp +++ b/umbrello/dialogs/widgets/documentationwidget.cpp @@ -36,7 +36,7 @@ DocumentationWidget::DocumentationWidget(UMLObject *o, QWidget *parent) : init(o->doc()); } -DocumentationWidget::DocumentationWidget(UMLWidget *w, QWidget *parent) : +DocumentationWidget::DocumentationWidget(WidgetBase *w, QWidget *parent) : QWidget(parent), m_object(0), m_widget(w) diff --git a/umbrello/dialogs/widgets/documentationwidget.h b/umbrello/dialogs/widgets/documentationwidget.h index d5c2f9c2602e566f3e3366b93b823abbf8a24aee..3395c35200689583b77a0dbdcaa4ecbaf08dd65a 100644 --- a/umbrello/dialogs/widgets/documentationwidget.h +++ b/umbrello/dialogs/widgets/documentationwidget.h @@ -15,7 +15,7 @@ class CodeTextEdit; class UMLObject; -class UMLWidget; +class WidgetBase; class KTextEdit; @@ -27,7 +27,7 @@ class DocumentationWidget : public QWidget Q_OBJECT public: explicit DocumentationWidget(UMLObject *o, QWidget *parent = 0); - explicit DocumentationWidget(UMLWidget *w, QWidget *parent = 0); + explicit DocumentationWidget(WidgetBase *w, QWidget *parent = 0); ~DocumentationWidget(); void apply(); @@ -37,7 +37,7 @@ protected: KTextEdit *m_editField; CodeTextEdit *m_codeEditField; UMLObject *m_object; - UMLWidget *m_widget; + WidgetBase *m_widget; void init(const QString &text); };