Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix 'No documentation edit possible in class attribute, operation and…
… template dialog'. This commit introduces a new class DocumentationWidget in sub directory dialogs/widgets to prepare properties window support. BUG:342330 FIXED-IN:2.15.1 (KDE 14.12.1)
- Loading branch information
Showing
9 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/*************************************************************************** | ||
* 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) 2002-2014 * | ||
* Umbrello UML Modeller Authors <umbrello-devel@kde.org> * | ||
***************************************************************************/ | ||
|
||
#include "documentationwidget.h" | ||
|
||
#include "umlobject.h" | ||
|
||
#include <KTextEdit> | ||
#include <KLocalizedString> | ||
|
||
#include <QGroupBox> | ||
#include <QHBoxLayout> | ||
|
||
DocumentationWidget::DocumentationWidget(UMLObject *o, QWidget *parent) : | ||
QWidget(parent), | ||
m_object(o) | ||
{ | ||
Q_ASSERT(o); | ||
|
||
QVBoxLayout *l = new QVBoxLayout; | ||
m_box = new QGroupBox; | ||
m_box->setTitle(i18n("Documentation")); | ||
m_editField = new KTextEdit(m_box); | ||
m_editField->setText(o->doc()); | ||
QVBoxLayout *layout = new QVBoxLayout(m_box); | ||
layout->addWidget(m_editField); | ||
l->addWidget(m_box); | ||
setLayout(l); | ||
} | ||
|
||
DocumentationWidget::~DocumentationWidget() | ||
{ | ||
delete m_editField; | ||
delete m_box; | ||
} | ||
|
||
/** | ||
* Apply changes to the related UMLObject. | ||
*/ | ||
void DocumentationWidget::apply() | ||
{ | ||
m_object->setDoc(m_editField->toPlainText()); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/*************************************************************************** | ||
* 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) 2002-2014 * | ||
* Umbrello UML Modeller Authors <umbrello-devel@kde.org> * | ||
***************************************************************************/ | ||
|
||
#ifndef DOCUMENTATIONWIDGET_H | ||
#define DOCUMENTATIONWIDGET_H | ||
|
||
#include <QWidget> | ||
|
||
class UMLObject; | ||
|
||
class KTextEdit; | ||
|
||
class QGridLayout; | ||
class QGroupBox; | ||
|
||
class DocumentationWidget : public QWidget | ||
{ | ||
Q_OBJECT | ||
public: | ||
DocumentationWidget(UMLObject *o, QWidget *parent = 0); | ||
~DocumentationWidget(); | ||
|
||
void apply(); | ||
|
||
protected: | ||
QGroupBox *m_box; | ||
KTextEdit *m_editField; | ||
UMLObject *m_object; | ||
}; | ||
|
||
#endif // DOCUMENTATIONWIDGET_H |