summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Fischer <[email protected]>2015-03-11 00:29:24 +0100
committerAndi Fischer <[email protected]>2015-03-11 00:29:24 +0100
commit64d9ad383ed09d19b739cdcf42ec5ce35bc52b93 (patch)
treee3d3bf90c9cb01cbc145bb4b204503d783a89c6a
parentccc90ab7610770e9da63494faeebfdc80f8d2e94 (diff)
parent627fedbd54c87a39686ad39741b013365ba14980 (diff)
Merge with master.
-rw-r--r--CMakeLists.txt2
-rw-r--r--umbrello/assocrules.cpp16
-rw-r--r--umbrello/dialogs/exportallviewsdialog.cpp2
-rw-r--r--umbrello/dialogs/exportallviewsdialog.h9
-rw-r--r--umbrello/dialogs/finddialog.cpp6
-rw-r--r--umbrello/dialogs/finddialog.h4
-rw-r--r--umbrello/dialogs/parameterpropertiesdialog.cpp11
-rw-r--r--umbrello/dialogs/parameterpropertiesdialog.h6
-rw-r--r--umbrello/dialogs/selectoperationdialog.cpp8
-rw-r--r--umbrello/dialogs/selectoperationdialog.h4
-rw-r--r--umbrello/dialogs/singlepagedialogbase.h1
-rw-r--r--umbrello/dialogs/umlattributedialog.cpp15
-rw-r--r--umbrello/dialogs/umlattributedialog.h6
-rw-r--r--umbrello/dialogs/umlcheckconstraintdialog.cpp22
-rw-r--r--umbrello/dialogs/umlcheckconstraintdialog.h14
-rw-r--r--umbrello/dialogs/umlentityattributedialog.cpp15
-rw-r--r--umbrello/dialogs/umlentityattributedialog.h7
-rw-r--r--umbrello/dialogs/umloperationdialog.cpp12
-rw-r--r--umbrello/dialogs/umloperationdialog.h7
-rw-r--r--umbrello/dialogs/umlroledialog.cpp15
-rw-r--r--umbrello/dialogs/umlroledialog.h9
-rw-r--r--umbrello/dialogs/umltemplatedialog.cpp15
-rw-r--r--umbrello/dialogs/umltemplatedialog.h9
-rw-r--r--umbrello/dialogs/umluniqueconstraintdialog.cpp27
-rw-r--r--umbrello/dialogs/umluniqueconstraintdialog.h12
-rw-r--r--umbrello/uml.cpp1
-rw-r--r--umbrello/umlappprivate.h6
-rw-r--r--umbrello/widgets/actorwidget.cpp5
-rw-r--r--umbrello/widgets/classifierwidget.cpp2
29 files changed, 85 insertions, 183 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ef4daf2..6061674 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,7 @@
project(umbrello)
set(VERSION_MAJOR "2")
-set(VERSION_MINOR "15")
+set(VERSION_MINOR "16")
set(VERSION_PATCH "99")
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
diff --git a/umbrello/assocrules.cpp b/umbrello/assocrules.cpp
index 4eb9d1c..b849e6c 100644
--- a/umbrello/assocrules.cpp
+++ b/umbrello/assocrules.cpp
@@ -24,6 +24,7 @@
#include "signalwidget.h"
#include "forkjoinwidget.h"
#include "umlscene.h"
+#include "umllistview.h"
// kde includes
#include <typeinfo>
@@ -170,6 +171,21 @@ bool AssocRules::allowAssociation(Uml::AssociationType::Enum assocType,
return false;
}
+ //Prevent against a package containing its own parent! #packageception.
+ if (assocType == Uml::AssociationType::Containment) {
+ UMLListViewItem* listItemA = UMLApp::app()->listView()->findUMLObject(widgetA->umlObject());
+ UMLListViewItem* listItemB = UMLApp::app()->listView()->findUMLObject(widgetB->umlObject());
+
+ if (listItemA && listItemB) {
+ // Great, we have our listviewitems, now check to make sure that they don't become recursive.
+ if (listItemA->parent() == static_cast<QTreeWidgetItem*>(listItemB)) {
+ // The user is trying to make the parent the child and the child the parent. Stop them!
+ return false;
+ }
+ }
+ // This was just a little assertion for safety, don't return yet!
+ }
+
AssociationWidgetList list = widgetB->associationWidgetList();
switch(assocType) {
diff --git a/umbrello/dialogs/exportallviewsdialog.cpp b/umbrello/dialogs/exportallviewsdialog.cpp
index ff3c01e..507cc8e 100644
--- a/umbrello/dialogs/exportallviewsdialog.cpp
+++ b/umbrello/dialogs/exportallviewsdialog.cpp
@@ -30,7 +30,7 @@
* @see QDialog::QDialog
*/
ExportAllViewsDialog::ExportAllViewsDialog(QWidget* parent, const char* name)
- : QDialog(parent)
+ : SinglePageDialogBase(parent)
{
setObjectName(QString::fromLatin1(name));
setModal(false);
diff --git a/umbrello/dialogs/exportallviewsdialog.h b/umbrello/dialogs/exportallviewsdialog.h
index bd2db64..11b0777 100644
--- a/umbrello/dialogs/exportallviewsdialog.h
+++ b/umbrello/dialogs/exportallviewsdialog.h
@@ -12,8 +12,7 @@
// application specific includes
#include "ui_exportallviewsdialogbase.h"
-
-#include <QDialog>
+#include "singlepagedialogbase.h"
// KDE forward declarations
class KComboBox;
@@ -26,14 +25,12 @@ class KComboBox;
* The KFileFilterCombo is declared here instead of in the .ui file because QT
* Designer and uic don't recognize it.
*/
-class ExportAllViewsDialog : public QDialog, private Ui::ExportAllViewsDialogBase
+class ExportAllViewsDialog : public SinglePageDialogBase, private Ui::ExportAllViewsDialogBase
{
- Q_OBJECT
-
+ Q_OBJECT
public:
explicit ExportAllViewsDialog(QWidget* parent = 0, const char* name = 0);
-
~ExportAllViewsDialog();
private:
diff --git a/umbrello/dialogs/finddialog.cpp b/umbrello/dialogs/finddialog.cpp
index acda67a..0a6cfe6 100644
--- a/umbrello/dialogs/finddialog.cpp
+++ b/umbrello/dialogs/finddialog.cpp
@@ -16,13 +16,11 @@
#include <QPushButton>
FindDialog::FindDialog(QWidget *parent)
- : QDialog(parent)
+ : SinglePageDialogBase(parent)
{
+ setCaption(i18n("Find"));
setupUi(window());
- setWindowTitle(i18n("Find"));
- setModal(true);
-
QDialogButtonBox* dlgButtonBox = new QDialogButtonBox();
QPushButton* searchBtn = dlgButtonBox->addButton(i18n("Search"), QDialogButtonBox::AcceptRole);
searchBtn->setDefault(true);
diff --git a/umbrello/dialogs/finddialog.h b/umbrello/dialogs/finddialog.h
index 169b152..27ccd13 100644
--- a/umbrello/dialogs/finddialog.h
+++ b/umbrello/dialogs/finddialog.h
@@ -13,14 +13,14 @@
#include "ui_finddialog.h"
-#include <QDialog>
+#include "singlepagedialogbase.h"
/**
* Class FindDialog provides the ui part for selecting find attributes.
*
* @author: Ralf Habacker <[email protected]>
*/
-class FindDialog : public QDialog, private Ui::FindDialog
+class FindDialog : public SinglePageDialogBase, private Ui::FindDialog
{
Q_OBJECT
public:
diff --git a/umbrello/dialogs/parameterpropertiesdialog.cpp b/umbrello/dialogs/parameterpropertiesdialog.cpp
index 51f26b3..15560ed 100644
--- a/umbrello/dialogs/parameterpropertiesdialog.cpp
+++ b/umbrello/dialogs/parameterpropertiesdialog.cpp
@@ -49,11 +49,10 @@
* @param attr the parameter to represent
*/
ParameterPropertiesDialog::ParameterPropertiesDialog(QWidget * parent, UMLDoc * doc, UMLAttribute * attr)
- : QDialog(parent)
+ : SinglePageDialogBase(parent)
{
Q_ASSERT(attr);
setWindowTitle(i18n("Parameter Properties"));
- setModal(true);
m_pUmldoc = doc;
m_pAtt = attr;
@@ -267,10 +266,7 @@ void ParameterPropertiesDialog::slotButtonClicked(QAbstractButton* button)
}
}
-/**
- * Ok clicked slot.
- */
-void ParameterPropertiesDialog::slotOk()
+bool ParameterPropertiesDialog::apply()
{
if (m_pAtt != NULL) {
@@ -287,7 +283,7 @@ void ParameterPropertiesDialog::slotOk()
UMLTemplate *tmplParam = pConcept->findTemplate(typeName);
if (tmplParam) {
m_pAtt->setType(tmplParam);
- return;
+ return true;
}
}
UMLClassifierList namesList(m_pUmldoc->concepts());
@@ -315,4 +311,5 @@ void ParameterPropertiesDialog::slotOk()
accept();
}
+ return true;
}
diff --git a/umbrello/dialogs/parameterpropertiesdialog.h b/umbrello/dialogs/parameterpropertiesdialog.h
index 71cd79d..8340abf 100644
--- a/umbrello/dialogs/parameterpropertiesdialog.h
+++ b/umbrello/dialogs/parameterpropertiesdialog.h
@@ -13,7 +13,7 @@
#include "basictypes.h"
-#include <QDialog>
+#include "singlepagedialogbase.h"
class DocumentationWidget;
class KComboBox;
@@ -37,7 +37,7 @@ class UMLStereotypeWidget;
* @author Paul Hensgen <[email protected]>
* Bugs and comments to [email protected] or http://bugs.kde.org
*/
-class ParameterPropertiesDialog : public QDialog
+class ParameterPropertiesDialog : public SinglePageDialogBase
{
Q_OBJECT
public:
@@ -45,7 +45,7 @@ public:
~ParameterPropertiesDialog();
public slots:
- void slotOk();
+ virtual bool apply();
protected:
QString getName();
diff --git a/umbrello/dialogs/selectoperationdialog.cpp b/umbrello/dialogs/selectoperationdialog.cpp
index 90de339..0c65404 100644
--- a/umbrello/dialogs/selectoperationdialog.cpp
+++ b/umbrello/dialogs/selectoperationdialog.cpp
@@ -49,10 +49,12 @@ bool caseInsensitiveLessThan(const UMLOperation *s1, const UMLOperation *s2)
* @param enableAutoIncrement Flag to enable auto increment checkbox
*/
SelectOperationDialog::SelectOperationDialog(UMLView *parent, UMLClassifier * c, bool enableAutoIncrement)
- : QDialog(parent), m_pView(parent), m_classifier(c)
+ : SinglePageDialogBase(parent), m_pView(parent), m_classifier(c)
{
- setWindowTitle(i18n("Select Operation"));
- setModal(true);
+ setCaption(i18n("Select Operation"));
+
+ QFrame *frame = new QFrame(this);
+ setMainWidget(frame);
QVBoxLayout * topLayout = new QVBoxLayout();
setLayout(topLayout);
diff --git a/umbrello/dialogs/selectoperationdialog.h b/umbrello/dialogs/selectoperationdialog.h
index c594854..f4c1be2 100644
--- a/umbrello/dialogs/selectoperationdialog.h
+++ b/umbrello/dialogs/selectoperationdialog.h
@@ -11,7 +11,7 @@
#ifndef SELECTOPERATIONDIALOG_H
#define SELECTOPERATIONDIALOG_H
-#include <QDialog>
+#include "singlepagedialogbase.h"
class KComboBox;
class KLineEdit;
@@ -29,7 +29,7 @@ class UMLView;
* @author Paul Hensgen <[email protected]>
* Bugs and comments to [email protected] or http://bugs.kde.org
*/
-class SelectOperationDialog : public QDialog
+class SelectOperationDialog : public SinglePageDialogBase
{
Q_OBJECT
public:
diff --git a/umbrello/dialogs/singlepagedialogbase.h b/umbrello/dialogs/singlepagedialogbase.h
index 23d9a63..022c8c5 100644
--- a/umbrello/dialogs/singlepagedialogbase.h
+++ b/umbrello/dialogs/singlepagedialogbase.h
@@ -26,7 +26,6 @@ class QDialogButtonBox;
class SinglePageDialogBase : public QDialog
{
Q_OBJECT
-
public:
explicit SinglePageDialogBase(QWidget *parent);
virtual ~SinglePageDialogBase();
diff --git a/umbrello/dialogs/umlattributedialog.cpp b/umbrello/dialogs/umlattributedialog.cpp
index 5e3b74a..88a6353 100644
--- a/umbrello/dialogs/umlattributedialog.cpp
+++ b/umbrello/dialogs/umlattributedialog.cpp
@@ -42,11 +42,10 @@
#include <QVBoxLayout>
UMLAttributeDialog::UMLAttributeDialog(QWidget * pParent, UMLAttribute * pAttribute)
- : QDialog(pParent),
+ : SinglePageDialogBase(pParent),
m_pAttribute(pAttribute)
{
- setWindowTitle(i18n("Attribute Properties"));
- setModal(true);
+ setCaption(i18n("Attribute Properties"));
setupDialog();
}
@@ -193,16 +192,6 @@ bool UMLAttributeDialog::apply()
}
/**
- * Used when the OK button is clicked. Calls apply()
- */
-void UMLAttributeDialog::slotOk()
-{
- if (apply()) {
- accept();
- }
-}
-
-/**
* Inserts @p type into the type-combobox as well as its completion object.
* The combobox is cleared and all types together with the optional new one
* sorted and then added again.
diff --git a/umbrello/dialogs/umlattributedialog.h b/umbrello/dialogs/umlattributedialog.h
index 268ca49..7bd5d2b 100644
--- a/umbrello/dialogs/umlattributedialog.h
+++ b/umbrello/dialogs/umlattributedialog.h
@@ -11,7 +11,7 @@
#ifndef UMLATTRIBUTEDIALOG_H
#define UMLATTRIBUTEDIALOG_H
-#include <QDialog>
+#include "singlepagedialogbase.h"
class DocumentationWidget;
class QCheckBox;
@@ -28,7 +28,7 @@ class VisibilityEnumWidget;
* @author Paul Hensgen
* Bugs and comments to [email protected] or http://bugs.kde.org
*/
-class UMLAttributeDialog : public QDialog
+class UMLAttributeDialog : public SinglePageDialogBase
{
Q_OBJECT
public:
@@ -54,8 +54,6 @@ protected:
VisibilityEnumWidget *m_visibilityEnumWidget;
DocumentationWidget *m_docWidget;
-public slots:
- void slotOk();
};
#endif
diff --git a/umbrello/dialogs/umlcheckconstraintdialog.cpp b/umbrello/dialogs/umlcheckconstraintdialog.cpp
index 0330634..272943c 100644
--- a/umbrello/dialogs/umlcheckconstraintdialog.cpp
+++ b/umbrello/dialogs/umlcheckconstraintdialog.cpp
@@ -16,8 +16,8 @@
// kde includes
#include <KLocalizedString>
-#include <ktextedit.h>
-#include <klineedit.h>
+#include <KTextEdit>
+#include <KLineEdit>
// qt includes
#include <QDialogButtonBox>
@@ -32,12 +32,10 @@
* @param pUniqueConstraint The Unique Constraint to show the properties of.
*/
UMLCheckConstraintDialog::UMLCheckConstraintDialog(QWidget* parent, UMLCheckConstraint* pCheckConstraint)
- : QDialog(parent),
- m_pCheckConstraint(pCheckConstraint),
- m_doc(UMLApp::app()->document())
+ : SinglePageDialogBase(parent),
+ m_pCheckConstraint(pCheckConstraint)
{
- setWindowTitle(i18n("Check Constraint Properties"));
- setModal(true);
+ setCaption(i18n("Check Constraint Properties"));
setupDialog();
}
@@ -92,16 +90,6 @@ void UMLCheckConstraintDialog::setupDialog()
}
/**
- * Used when the OK button is clicked. Calls apply()
- */
-void UMLCheckConstraintDialog::slotOk()
-{
- if (apply()) {
- accept();
- }
-}
-
-/**
* Apply Changes
*/
bool UMLCheckConstraintDialog::apply()
diff --git a/umbrello/dialogs/umlcheckconstraintdialog.h b/umbrello/dialogs/umlcheckconstraintdialog.h
index 714a231..5c966af 100644
--- a/umbrello/dialogs/umlcheckconstraintdialog.h
+++ b/umbrello/dialogs/umlcheckconstraintdialog.h
@@ -11,8 +11,8 @@
#ifndef UMLCHECKCONSTRAINTDIALOG_H
#define UMLCHECKCONSTRAINTDIALOG_H
-// qt includes
-#include <QDialog>
+//kde includes
+#include "singlepagedialogbase.h"
class UMLDoc;
class UMLCheckConstraint;
@@ -27,7 +27,7 @@ class QLabel;
* @author Sharan Rao
* Bugs and comments to [email protected] or http://bugs.kde.org
*/
-class UMLCheckConstraintDialog : public QDialog
+class UMLCheckConstraintDialog : public SinglePageDialogBase
{
Q_OBJECT
public:
@@ -37,22 +37,16 @@ public:
protected:
void setupDialog();
- bool apply();
+ virtual bool apply();
private:
UMLCheckConstraint* m_pCheckConstraint;
- UMLDoc* m_doc; //< the UMLDocument where all objects live
-
// the GUI widgets
QLabel* m_pNameL;
KLineEdit* m_pNameLE;
QLabel* m_pCheckConditionL;
KTextEdit* m_pCheckConditionTE;
-
-public slots:
- void slotOk();
-
};
#endif
diff --git a/umbrello/dialogs/umlentityattributedialog.cpp b/umbrello/dialogs/umlentityattributedialog.cpp
index b122848..62d3ecb 100644
--- a/umbrello/dialogs/umlentityattributedialog.cpp
+++ b/umbrello/dialogs/umlentityattributedialog.cpp
@@ -43,11 +43,10 @@
#include <QVBoxLayout>
UMLEntityAttributeDialog::UMLEntityAttributeDialog(QWidget * pParent, UMLEntityAttribute * pEntityAttribute)
- : QDialog(pParent),
+ : SinglePageDialogBase(pParent),
m_pEntityAttribute(pEntityAttribute)
{
- setWindowTitle(i18n("Entity Attribute Properties"));
- setModal(true);
+ setCaption(i18n("Entity Attribute Properties"));
setupDialog();
}
@@ -234,16 +233,6 @@ bool UMLEntityAttributeDialog::apply()
}
/**
- * Used when the OK button is clicked. Calls apply().
- */
-void UMLEntityAttributeDialog::slotOk()
-{
- if (apply()) {
- accept();
- }
-}
-
-/**
* Inserts @p type into the type-combobox as well as its completion object.
*/
void UMLEntityAttributeDialog::insertTypesSorted(const QString& type)
diff --git a/umbrello/dialogs/umlentityattributedialog.h b/umbrello/dialogs/umlentityattributedialog.h
index 85f2145..cd7a398 100644
--- a/umbrello/dialogs/umlentityattributedialog.h
+++ b/umbrello/dialogs/umlentityattributedialog.h
@@ -11,7 +11,7 @@
#ifndef UMLENTITYATTRIBUTEDIALOG_H
#define UMLENTITYATTRIBUTEDIALOG_H
-#include <QDialog>
+#include "singlepagedialogbase.h"
class QCheckBox;
class QGroupBox;
@@ -26,7 +26,7 @@ class KLineEdit;
* @author Jonathan Riddell
* Bugs and comments to [email protected] or http://bugs.kde.org
*/
-class UMLEntityAttributeDialog : public QDialog
+class UMLEntityAttributeDialog : public SinglePageDialogBase
{
Q_OBJECT
public:
@@ -36,7 +36,7 @@ public:
protected:
void setupDialog();
- bool apply();
+ virtual bool apply();
void insertTypesSorted(const QString& type = QString());
void insertAttribute(const QString& type, int index = -1);
@@ -57,7 +57,6 @@ protected:
public slots:
void slotAutoIncrementStateChanged(bool checked);
- void slotOk();
};
#endif
diff --git a/umbrello/dialogs/umloperationdialog.cpp b/umbrello/dialogs/umloperationdialog.cpp
index a423ebf..823add0 100644
--- a/umbrello/dialogs/umloperationdialog.cpp
+++ b/umbrello/dialogs/umloperationdialog.cpp
@@ -58,13 +58,12 @@
* Constructor.
*/
UMLOperationDialog::UMLOperationDialog(QWidget * parent, UMLOperation * pOperation)
- : QDialog(parent),
+ : SinglePageDialogBase(parent),
m_operation(pOperation),
m_doc(UMLApp::app()->document()),
m_menu(0)
{
- setWindowTitle(i18n("Operation Properties"));
- setModal(true);
+ setCaption(i18n("Operation Properties"));
setupDialog();
}
@@ -444,13 +443,6 @@ bool UMLOperationDialog::apply()
return true;
}
-void UMLOperationDialog::slotOk()
-{
- if (apply()) {
- accept();
- }
-}
-
/**
* Launch khelpcenter.
*/
diff --git a/umbrello/dialogs/umloperationdialog.h b/umbrello/dialogs/umloperationdialog.h
index 0f6536b..6bb2583 100644
--- a/umbrello/dialogs/umloperationdialog.h
+++ b/umbrello/dialogs/umloperationdialog.h
@@ -11,8 +11,8 @@
#ifndef UMLOPERATIONDIALOG_H
#define UMLOPERATIONDIALOG_H
-//qt includes
-#include <QDialog>
+//kde includes
+#include "singlepagedialogbase.h"
class DocumentationWidget;
class KComboBox;
@@ -37,7 +37,7 @@ class VisibilityEnumWidget;
* @author Paul Hensgen
* Bugs and comments to [email protected] or http://bugs.kde.org
*/
-class UMLOperationDialog : public QDialog
+class UMLOperationDialog : public SinglePageDialogBase
{
Q_OBJECT
public:
@@ -92,7 +92,6 @@ public slots:
void slotParameterUp();
void slotParameterDown();
void slotParamsBoxClicked(QListWidgetItem* parameterItem);
- void slotOk();
void slotHelpClicked();
void slotButtonClicked(QAbstractButton *button);
};
diff --git a/umbrello/dialogs/umlroledialog.cpp b/umbrello/dialogs/umlroledialog.cpp
index c8f8e5c..3442832 100644
--- a/umbrello/dialogs/umlroledialog.cpp
+++ b/umbrello/dialogs/umlroledialog.cpp
@@ -27,11 +27,10 @@
* Constructor.
*/
UMLRoleDialog::UMLRoleDialog(QWidget *parent, UMLRole *pRole)
- : QDialog(parent),
+ : SinglePageDialogBase(parent),
m_pRole(pRole)
{
- setWindowTitle(i18n("Role Properties"));
- setModal(true);
+ setCaption(i18n("Role Properties"));
setupDialog();
}
@@ -77,16 +76,6 @@ bool UMLRoleDialog::apply()
}
/**
- * Used when the OK button is clicked. Calls apply().
- */
-void UMLRoleDialog::slotOk()
-{
- if (apply()) {
- accept();
- }
-}
-
-/**
* Activated when a button is clicked
* @param button the button that was clicked
*/
diff --git a/umbrello/dialogs/umlroledialog.h b/umbrello/dialogs/umlroledialog.h
index 5bc94b0..a7e56d1 100644
--- a/umbrello/dialogs/umlroledialog.h
+++ b/umbrello/dialogs/umlroledialog.h
@@ -11,8 +11,8 @@
#ifndef UMLROLEDIALOG_H
#define UMLROLEDIALOG_H
-//qt includes
-#include <QDialog>
+//kde includes
+#include "singlepagedialogbase.h"
/**
* @author Paul Hensgen
@@ -22,7 +22,7 @@ class QDialogButtonBox;
class UMLRole;
class UMLRoleProperties;
-class UMLRoleDialog : public QDialog
+class UMLRoleDialog : public SinglePageDialogBase
{
Q_OBJECT
public:
@@ -40,9 +40,6 @@ private:
UMLRoleProperties *m_pRoleProps;
QDialogButtonBox *m_dialogButtonBox;
-public slots:
- void slotOk();
-
protected slots:
virtual void slotButtonClicked(QAbstractButton *button);
diff --git a/umbrello/dialogs/umltemplatedialog.cpp b/umbrello/dialogs/umltemplatedialog.cpp
index b1c2841..1f1fdc4 100644
--- a/umbrello/dialogs/umltemplatedialog.cpp
+++ b/umbrello/dialogs/umltemplatedialog.cpp
@@ -36,11 +36,10 @@
#include <QVBoxLayout>
UMLTemplateDialog::UMLTemplateDialog(QWidget* pParent, UMLTemplate* pTemplate)
- : QDialog(pParent),
+ : SinglePageDialogBase(pParent),
m_pTemplate(pTemplate)
{
- setWindowTitle(i18n("Template Properties"));
- setModal(true);
+ setCaption(i18n("Template Properties"));
setupDialog();
}
@@ -170,13 +169,3 @@ bool UMLTemplateDialog::apply()
return true;
}
-
-/**
- * Used when the OK button is clicked. Calls apply()
- */
-void UMLTemplateDialog::slotOk()
-{
- if (apply()) {
- accept();
- }
-}
diff --git a/umbrello/dialogs/umltemplatedialog.h b/umbrello/dialogs/umltemplatedialog.h
index b97893a..b3b0ac2 100644
--- a/umbrello/dialogs/umltemplatedialog.h
+++ b/umbrello/dialogs/umltemplatedialog.h
@@ -11,7 +11,7 @@
#ifndef UMLTEMPLATEDIALOG_H
#define UMLTEMPLATEDIALOG_H
-#include <QDialog>
+#include "singlepagedialogbase.h"
class DocumentationWidget;
class KComboBox;
@@ -27,7 +27,7 @@ class UMLStereotypeWidget;
* @author Jonathan Riddell
* Bugs and comments to [email protected] or http://bugs.kde.org
*/
-class UMLTemplateDialog : public QDialog
+class UMLTemplateDialog : public SinglePageDialogBase
{
Q_OBJECT
public:
@@ -37,7 +37,7 @@ public:
protected:
void setupDialog();
- bool apply();
+ virtual bool apply();
UMLTemplate* m_pTemplate; //< the Attribute to represent
@@ -49,9 +49,6 @@ protected:
UMLStereotypeWidget *m_stereotypeWidget;
DocumentationWidget *m_docWidget;
-public slots:
- void slotOk();
-
protected:
void insertTypesSorted(const QString& type = QString());
diff --git a/umbrello/dialogs/umluniqueconstraintdialog.cpp b/umbrello/dialogs/umluniqueconstraintdialog.cpp
index b390229..d2752f7 100644
--- a/umbrello/dialogs/umluniqueconstraintdialog.cpp
+++ b/umbrello/dialogs/umluniqueconstraintdialog.cpp
@@ -22,7 +22,6 @@
#include "template.h"
#include "uml.h"
#include "uniqueconstraint.h"
-#include "umldoc.h"
#include <KComboBox>
#include <KLineEdit>
@@ -43,12 +42,10 @@
* @param pUniqueConstraint The Unique Constraint to show the properties of.
*/
UMLUniqueConstraintDialog::UMLUniqueConstraintDialog(QWidget* parent, UMLUniqueConstraint* pUniqueConstraint)
- : QDialog(parent),
- m_pUniqueConstraint(pUniqueConstraint),
- m_doc(UMLApp::app()->document())
+ : SinglePageDialogBase(parent),
+ m_pUniqueConstraint(pUniqueConstraint)
{
- setWindowTitle(i18n("Unique Constraint Properties"));
- setModal(true);
+ setCaption(i18n("Unique Constraint Properties"));
setupDialog();
}
@@ -246,24 +243,6 @@ void UMLUniqueConstraintDialog::slotDeleteAttribute()
}
/**
- * Used when the Apply Button is clicked.
- */
-void UMLUniqueConstraintDialog::slotApply()
-{
- apply();
-}
-
-/**
- * Used when the OK button is clicked. Calls apply().
- */
-void UMLUniqueConstraintDialog::slotOk()
-{
- if (apply()) {
- accept();
- }
-}
-
-/**
* Apply changes.
*/
bool UMLUniqueConstraintDialog::apply()
diff --git a/umbrello/dialogs/umluniqueconstraintdialog.h b/umbrello/dialogs/umluniqueconstraintdialog.h
index 2c98533..442f006 100644
--- a/umbrello/dialogs/umluniqueconstraintdialog.h
+++ b/umbrello/dialogs/umluniqueconstraintdialog.h
@@ -14,8 +14,8 @@
//app includes
#include "umlentityattributelist.h"
-//qt includes
-#include <QDialog>
+//kde includes
+#include "singlepagedialogbase.h"
class KComboBox;
class KLineEdit;
@@ -25,7 +25,6 @@ class QGroupBox;
class QLabel;
class QListWidget;
class QPushButton;
-class UMLDoc;
class UMLUniqueConstraint;
/**
@@ -35,7 +34,7 @@ class UMLUniqueConstraint;
* @author Sharan Rao
* Bugs and comments to [email protected] or http://bugs.kde.org
*/
-class UMLUniqueConstraintDialog : public QDialog
+class UMLUniqueConstraintDialog : public SinglePageDialogBase
{
Q_OBJECT
public:
@@ -45,11 +44,10 @@ public:
protected:
void setupDialog();
- bool apply();
+ virtual bool apply();
private:
UMLUniqueConstraint *m_pUniqueConstraint;
- UMLDoc *m_doc; ///< the UMLDocument where all objects live
// GUI Widgets
QGroupBox* m_pAttributeListGB;
@@ -66,8 +64,6 @@ private:
public slots:
void slotResetWidgetState();
- void slotApply();
- void slotOk();
void slotAddAttribute();
void slotDeleteAttribute();
diff --git a/umbrello/uml.cpp b/umbrello/uml.cpp
index c2aac84..4ba950f 100644
--- a/umbrello/uml.cpp
+++ b/umbrello/uml.cpp
@@ -3034,7 +3034,6 @@ void UMLApp::setCurrentView(UMLView* view, bool updateTreeView)
view->show();
}
setZoom(view->zoom());
- qApp->processEvents();
slotStatusMsg(view->umlScene()->name());
if (updateTreeView) {
UMLListViewItem* lvitem = m_listView->findView(view);
diff --git a/umbrello/umlappprivate.h b/umbrello/umlappprivate.h
index f310dbd..3c2fbbf 100644
--- a/umbrello/umlappprivate.h
+++ b/umbrello/umlappprivate.h
@@ -80,10 +80,8 @@ public slots:
if(iface)
iface->setConfigValue(QString::fromLatin1("line-numbers"), true);
- QDialog *dialog = new QDialog(parent);
- QGridLayout *layout = new QGridLayout();
- layout->addWidget(view, 0, 0);
- dialog->setLayout(layout);
+ SinglePageDialogBase *dialog = new SinglePageDialogBase(parent);
+ dialog->setMainWidget(view);
dialog->setMinimumSize(800, 800);
dialog->exec();
delete dialog;
diff --git a/umbrello/widgets/actorwidget.cpp b/umbrello/widgets/actorwidget.cpp
index 0509907..c53139e 100644
--- a/umbrello/widgets/actorwidget.cpp
+++ b/umbrello/widgets/actorwidget.cpp
@@ -24,6 +24,7 @@
ActorWidget::ActorWidget(UMLScene * scene, UMLActor *a)
: UMLWidget(scene, WidgetBase::wt_Actor, a)
{
+ setFixedAspectRatio(true);
}
/**
@@ -47,12 +48,10 @@ void ActorWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *optio
const int h = height();
painter->setFont(UMLWidget::font());
const QFontMetrics &fm = getFontMetrics(FT_NORMAL);
- const int textWidth = fm.width(name());
const int fontHeight = fm.lineSpacing();
const int a_height = h - fontHeight - A_MARGIN;
const int h2 = a_height / 2;
- const int w2 = w - A_MARGIN * 2;
- const int a_width = (h2 > w2 || w > textWidth + A_MARGIN * 2 ? w2 : h2);
+ const int a_width = (h2);
const int middleX = w / 2;
const int thirdY = a_height / 3;
diff --git a/umbrello/widgets/classifierwidget.cpp b/umbrello/widgets/classifierwidget.cpp
index 2e6d3a1..cbabc4c 100644
--- a/umbrello/widgets/classifierwidget.cpp
+++ b/umbrello/widgets/classifierwidget.cpp
@@ -667,6 +667,7 @@ void ClassifierWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *
if (m_umlObject->baseType() == UMLObject::ot_Package) {
drawAsPackage(painter, option);
+ UMLWidget::paint(painter, option, widget);
return;
}
UMLClassifier *umlc = this->classifier();
@@ -676,6 +677,7 @@ void ClassifierWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *
}
if (umlc->isInterface() && visualProperty(DrawAsCircle)) {
drawAsCircle(painter, option);
+ UMLWidget::paint(painter, option, widget);
return;
}