summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Fischer <[email protected]>2014-11-04 01:14:37 +0100
committerAndi Fischer <[email protected]>2014-11-04 01:14:49 +0100
commit0b97cf9951ec00fa6f3f87945fb7a038ebf91eba (patch)
treefd66180a64fb8d28f7e23e221f184e730baa5d50
parent1044b430112f8e6bf9e88da757b872e69b8c571f (diff)
KDialog --> QDialog
-rw-r--r--umbrello/dialogs/overwritedialog.h2
-rw-r--r--umbrello/dialogs/selectoperationdialog.cpp32
-rw-r--r--umbrello/dialogs/selectoperationdialog.h6
-rw-r--r--umbrello/dialogs/umlattributedialog.cpp40
-rw-r--r--umbrello/dialogs/umlattributedialog.h14
-rw-r--r--umbrello/dialogs/umluniqueconstraintdialog.cpp25
-rw-r--r--umbrello/dialogs/umluniqueconstraintdialog.h10
7 files changed, 53 insertions, 76 deletions
diff --git a/umbrello/dialogs/overwritedialog.h b/umbrello/dialogs/overwritedialog.h
index 46d6d70..4fc2679 100644
--- a/umbrello/dialogs/overwritedialog.h
+++ b/umbrello/dialogs/overwritedialog.h
@@ -21,7 +21,7 @@ class QCheckBox;
* or cancel. Gives an option to apply the choice to all remaining files.
*
* Uses OK and Apply buttons but overrides their text and behaviour, probably
- * better to use user defined buttons but I couldn't work out how. KDialogBase guru needed.
+ * better to use user defined buttons but I couldn't work out how.
*
* @author Jonathan Riddell <jr[email protected]>
* Bugs and comments to [email protected] or http://bugs.kde.org
diff --git a/umbrello/dialogs/selectoperationdialog.cpp b/umbrello/dialogs/selectoperationdialog.cpp
index 5320151..48a0ab0 100644
--- a/umbrello/dialogs/selectoperationdialog.cpp
+++ b/umbrello/dialogs/selectoperationdialog.cpp
@@ -28,6 +28,7 @@
// qt includes
#include <QCheckBox>
+#include <QDialogButtonBox>
#include <QGridLayout>
#include <QGroupBox>
#include <QLabel>
@@ -48,24 +49,19 @@ bool caseInsensitiveLessThan(const UMLOperation *s1, const UMLOperation *s2)
* @param enableAutoIncrement Flag to enable auto increment checkbox
*/
SelectOperationDialog::SelectOperationDialog(UMLView *parent, UMLClassifier * c, bool enableAutoIncrement)
- : KDialog(parent), m_pView(parent), m_classifier(c)
+ : QDialog(parent), m_pView(parent), m_classifier(c)
{
- setCaption(i18n("Select Operation"));
- setButtons(Ok | Cancel);
- setDefaultButton(Yes);
+ setWindowTitle(i18n("Select Operation"));
setModal(true);
- showButtonSeparator(true);
- QFrame *frame = new QFrame(this);
- setMainWidget(frame);
+ QVBoxLayout * topLayout = new QVBoxLayout();
+ setLayout(topLayout);
- QVBoxLayout * topLayout = new QVBoxLayout(frame);
-
- m_pOpGB = new QGroupBox(i18n("Select Operation"), frame);
+ m_pOpGB = new QGroupBox(i18n("Select Operation"));
topLayout->addWidget(m_pOpGB);
QGridLayout * mainLayout = new QGridLayout(m_pOpGB);
- mainLayout->setSpacing(spacingHint());
+//FIXME KF5 mainLayout->setSpacing(spacingHint());
mainLayout->setMargin(fontMetrics().height());
Dialog_Utils::makeLabeledEditField(mainLayout, 0,
@@ -96,7 +92,13 @@ SelectOperationDialog::SelectOperationDialog(UMLView *parent, UMLClassifier * c,
connect(m_pOpLE, SIGNAL(textChanged(QString)), this, SLOT(slotTextChanged(QString)));
mainLayout->addWidget(m_pOpLE, 2, 1, 1, 2);
setupOperationsList();
- enableButtonOk(false);
+//FIXME KF5 enableButtonOk(false);
+
+ QDialogButtonBox* dlgButtonBox = new QDialogButtonBox(QDialogButtonBox::Ok |
+ QDialogButtonBox::Cancel);
+ connect(dlgButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
+ connect(dlgButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ mainLayout->addWidget(dlgButtonBox);
}
/**
@@ -161,7 +163,7 @@ void SelectOperationDialog::slotNewOperation()
return;
setupOperationsList();
setClassOp(op->toString(Uml::SignatureType::SigNoVis));
- enableButtonOk(true);
+//FIXME KF5 enableButtonOk(true);
}
/**
@@ -172,7 +174,7 @@ void SelectOperationDialog::slotIndexChanged(int index)
if (index != -1) {
m_pOpLE->setText(QString());
m_id = OP;
- enableButtonOk(true);
+//FIXME KF5 enableButtonOk(true);
}
}
@@ -184,7 +186,7 @@ void SelectOperationDialog::slotTextChanged(const QString &text)
if (!text.isEmpty()) {
m_pOpCB->setCurrentIndex(-1);
m_id = CUSTOM;
- enableButtonOk(true);
+//FIXME KF5 enableButtonOk(true);
}
}
diff --git a/umbrello/dialogs/selectoperationdialog.h b/umbrello/dialogs/selectoperationdialog.h
index 0b5e8eb..3e291fa 100644
--- a/umbrello/dialogs/selectoperationdialog.h
+++ b/umbrello/dialogs/selectoperationdialog.h
@@ -11,7 +11,7 @@
#ifndef SELECTOPERATIONDIALOG_H
#define SELECTOPERATIONDIALOG_H
-#include <kdialog.h>
+#include <QDialog>
class KComboBox;
class KLineEdit;
@@ -28,7 +28,7 @@ class UMLView;
* @author Paul Hensgen <[email protected]>
* Bugs and comments to [email protected] or http://bugs.kde.org
*/
-class SelectOperationDialog : public KDialog
+class SelectOperationDialog : public QDialog
{
Q_OBJECT
public:
@@ -45,9 +45,7 @@ public:
void setAutoIncrementSequence(bool state);
void setSeqNumber(const QString &num);
-
void setCustomOp(const QString &op);
-
bool setClassOp(const QString &op);
protected:
diff --git a/umbrello/dialogs/umlattributedialog.cpp b/umbrello/dialogs/umlattributedialog.cpp
index 0cfa266..d2af378 100644
--- a/umbrello/dialogs/umlattributedialog.cpp
+++ b/umbrello/dialogs/umlattributedialog.cpp
@@ -39,14 +39,11 @@
#include <QVBoxLayout>
UMLAttributeDialog::UMLAttributeDialog(QWidget * pParent, UMLAttribute * pAttribute)
- : KDialog(pParent)
+ : QDialog(pParent),
+ m_pAttribute(pAttribute)
{
- setCaption(i18n("Attribute Properties"));
- setButtons(Help | Ok | Cancel);
- setDefaultButton(Ok);
+ setWindowTitle(i18n("Attribute Properties"));
setModal(true);
- showButtonSeparator(true);
- m_pAttribute = pAttribute;
setupDialog();
}
@@ -61,11 +58,10 @@ void UMLAttributeDialog::setupDialog()
{
int margin = fontMetrics().height();
- QFrame * frame = new QFrame(this);
- setMainWidget(frame);
- QVBoxLayout * mainLayout = new QVBoxLayout(frame);
+ QVBoxLayout * mainLayout = new QVBoxLayout();
+ setLayout(mainLayout);
- m_pValuesGB = new QGroupBox(i18n("General Properties"), frame);
+ m_pValuesGB = new QGroupBox(i18n("General Properties"));
QGridLayout * valuesLayout = new QGridLayout(m_pValuesGB);
valuesLayout->setMargin(margin);
valuesLayout->setSpacing(10);
@@ -95,7 +91,7 @@ void UMLAttributeDialog::setupDialog()
mainLayout->addWidget(m_pValuesGB);
- m_pScopeGB = new QGroupBox(i18n("Visibility"), frame);
+ m_pScopeGB = new QGroupBox(i18n("Visibility"));
QHBoxLayout * scopeLayout = new QHBoxLayout(m_pScopeGB);
scopeLayout->setMargin(margin);
@@ -136,15 +132,12 @@ void UMLAttributeDialog::setupDialog()
insertTypesSorted(m_pAttribute->getTypeName());
m_pNameLE->setFocus();
- connect(m_pNameLE, SIGNAL(textChanged(QString)), SLOT(slotNameChanged(QString)));
- slotNameChanged(m_pNameLE->text());
- connect(this, SIGNAL(okClicked()), this, SLOT(slotOk()));
- connect(this, SIGNAL(applyClicked()), this, SLOT(slotApply()));
-}
-void UMLAttributeDialog::slotNameChanged(const QString &_text)
-{
- enableButtonOk(!_text.isEmpty());
+ QDialogButtonBox* dlgButtonBox = new QDialogButtonBox(QDialogButtonBox::Ok |
+ QDialogButtonBox::Cancel);
+ connect(dlgButtonBox, SIGNAL(accepted()), this, SLOT(slotOk()));
+ connect(dlgButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ mainLayout->addWidget(dlgButtonBox);
}
/**
@@ -232,15 +225,6 @@ bool UMLAttributeDialog::apply()
}
/**
- * I don't think this is used, but if we had an apply button
- * it would slot into here
- */
-void UMLAttributeDialog::slotApply()
-{
- apply();
-}
-
-/**
* Used when the OK button is clicked. Calls apply()
*/
void UMLAttributeDialog::slotOk()
diff --git a/umbrello/dialogs/umlattributedialog.h b/umbrello/dialogs/umlattributedialog.h
index b00cf81..8e46b0a 100644
--- a/umbrello/dialogs/umlattributedialog.h
+++ b/umbrello/dialogs/umlattributedialog.h
@@ -11,7 +11,7 @@
#ifndef UMLATTRIBUTEDIALOG_H
#define UMLATTRIBUTEDIALOG_H
-#include <kdialog.h>
+#include <QDialog>
class QCheckBox;
class QGroupBox;
@@ -25,7 +25,7 @@ class KLineEdit;
* @author Paul Hensgen
* Bugs and comments to [email protected] or http://bugs.kde.org
*/
-class UMLAttributeDialog : public KDialog
+class UMLAttributeDialog : public QDialog
{
Q_OBJECT
public:
@@ -33,17 +33,13 @@ public:
~UMLAttributeDialog();
protected:
-
void setupDialog();
bool apply();
void insertTypesSorted(const QString& type = QString());
- /**
- * The Attribute to represent
- */
- UMLAttribute * m_pAttribute;
+ UMLAttribute * m_pAttribute; //< the Attribute to represent
//GUI Widgets
QGroupBox * m_pValuesGB;
@@ -55,11 +51,7 @@ protected:
QCheckBox* m_pStaticCB;
public slots:
-
- void slotApply();
-
void slotOk();
- void slotNameChanged(const QString &);
};
#endif
diff --git a/umbrello/dialogs/umluniqueconstraintdialog.cpp b/umbrello/dialogs/umluniqueconstraintdialog.cpp
index f22f492..fa78ac0 100644
--- a/umbrello/dialogs/umluniqueconstraintdialog.cpp
+++ b/umbrello/dialogs/umluniqueconstraintdialog.cpp
@@ -43,19 +43,13 @@
* @param pUniqueConstraint The Unique Constraint to show the properties of.
*/
UMLUniqueConstraintDialog::UMLUniqueConstraintDialog(QWidget* parent, UMLUniqueConstraint* pUniqueConstraint)
- : KDialog(parent),
+ : QDialog(parent),
m_pUniqueConstraint(pUniqueConstraint),
m_doc(UMLApp::app()->document())
{
- setCaption(i18n("Unique Constraint Properties"));
- setButtons(Help | Ok | Apply | Cancel);
- setDefaultButton(Ok);
+ setWindowTitle(i18n("Unique Constraint Properties"));
setModal(true);
- showButtonSeparator(true);
-
setupDialog();
- connect(this, SIGNAL(okClicked()), this, SLOT(slotOk()));
- connect(this, SIGNAL(applyClicked()), this, SLOT(slotApply()));
}
/**
@@ -70,8 +64,6 @@ UMLUniqueConstraintDialog::~UMLUniqueConstraintDialog()
*/
void UMLUniqueConstraintDialog::setupDialog()
{
- QFrame *frame = new QFrame(this);
- setMainWidget(frame);
int margin = fontMetrics().height();
// what do we need,
@@ -80,8 +72,9 @@ void UMLUniqueConstraintDialog::setupDialog()
// a combo box, two push buttons, yeah that's it.
// start
//main layout contains the name fields, the column group box
- QVBoxLayout* mainLayout = new QVBoxLayout(frame);
+ QVBoxLayout* mainLayout = new QVBoxLayout();
mainLayout->setSpacing(10);
+ setLayout(mainLayout);
// layout to hold the name label and line edit
QHBoxLayout* nameLayout = new QHBoxLayout();
@@ -96,7 +89,7 @@ void UMLUniqueConstraintDialog::setupDialog()
// group box to hold the column details
// top group box, contains a vertical layout with list box above and buttons below
- m_pAttributeListGB = new QGroupBox(i18n("Attribute Details"), frame);
+ m_pAttributeListGB = new QGroupBox(i18n("Attribute Details"));
mainLayout->addWidget(m_pAttributeListGB);
QVBoxLayout* listVBoxLayout = new QVBoxLayout(m_pAttributeListGB);
@@ -160,6 +153,14 @@ void UMLUniqueConstraintDialog::setupDialog()
slotResetWidgetState();
connect(m_pAttributeListLW, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(slotResetWidgetState()));
+
+ QDialogButtonBox* dlgButtonBox = new QDialogButtonBox(QDialogButtonBox::Ok |
+ QDialogButtonBox::Apply |
+ QDialogButtonBox::Cancel);
+ connect(dlgButtonBox, SIGNAL(accepted()), this, SLOT(slotOk()));
+//FIXME KF5 connect(this, SIGNAL(applyClicked()), this, SLOT(slotApply()));
+ connect(dlgButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ mainLayout->addWidget(dlgButtonBox);
}
/**
diff --git a/umbrello/dialogs/umluniqueconstraintdialog.h b/umbrello/dialogs/umluniqueconstraintdialog.h
index 21c8a59..d6833cc 100644
--- a/umbrello/dialogs/umluniqueconstraintdialog.h
+++ b/umbrello/dialogs/umluniqueconstraintdialog.h
@@ -14,8 +14,8 @@
//app includes
#include "umlentityattributelist.h"
-//kde includes
-#include <kdialog.h>
+//qt includes
+#include <QDialog>
class UMLDoc;
class UMLUniqueConstraint;
@@ -33,7 +33,7 @@ class QPushButton;
* @author Sharan Rao
* Bugs and comments to [email protected] or http://bugs.kde.org
*/
-class UMLUniqueConstraintDialog : public KDialog
+class UMLUniqueConstraintDialog : public QDialog
{
Q_OBJECT
public:
@@ -49,7 +49,7 @@ private:
UMLUniqueConstraint *m_pUniqueConstraint;
UMLDoc *m_doc; ///< the UMLDocument where all objects live
- /* GUI Widgets */
+ // GUI Widgets
QGroupBox* m_pAttributeListGB;
QLabel* m_pNameL;
KLineEdit* m_pNameLE;
@@ -57,7 +57,7 @@ private:
KComboBox* m_pAttributeCB;
QPushButton* m_pAddPB, *m_pRemovePB;
- /* local cache */
+ // local cache
UMLEntityAttributeList m_pEntityAttributeList;
UMLEntityAttributeList m_pConstraintAttributeList;