summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Fischer <[email protected]>2014-12-09 10:43:39 +0100
committerAndi Fischer <[email protected]>2014-12-09 10:43:39 +0100
commit900573ace11b3f01470b21313bd1e10f013dc804 (patch)
tree58d1e5f0781221b613fd95a292cf5ea757082597
parentdc7d91df57d770566421f9ea0f3b5a70cb0ddf12 (diff)
Dialog buttons handled and FIXME KF5 comments removed.
-rw-r--r--umbrello/dialogs/umluniqueconstraintdialog.cpp43
-rw-r--r--umbrello/dialogs/umluniqueconstraintdialog.h10
2 files changed, 41 insertions, 12 deletions
diff --git a/umbrello/dialogs/umluniqueconstraintdialog.cpp b/umbrello/dialogs/umluniqueconstraintdialog.cpp
index 460c9e1..b390229 100644
--- a/umbrello/dialogs/umluniqueconstraintdialog.cpp
+++ b/umbrello/dialogs/umluniqueconstraintdialog.cpp
@@ -24,10 +24,10 @@
#include "uniqueconstraint.h"
#include "umldoc.h"
-#include <kcombobox.h>
-#include <klineedit.h>
+#include <KComboBox>
+#include <KLineEdit>
#include <KLocalizedString>
-#include <kmessagebox.h>
+#include <KMessageBox>
#include <QDialogButtonBox>
#include <QGroupBox>
@@ -154,13 +154,36 @@ void UMLUniqueConstraintDialog::setupDialog()
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);
+ m_dialogButtonBox = new QDialogButtonBox(QDialogButtonBox::Ok |
+ QDialogButtonBox::Apply |
+ QDialogButtonBox::Cancel);
+ connect(m_dialogButtonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(slotButtonClicked(QAbstractButton*)));
+ mainLayout->addWidget(m_dialogButtonBox);
+}
+
+/**
+ * Activated when a button is clicked
+ * @param button the button that was clicked
+ */
+void UMLUniqueConstraintDialog::slotButtonClicked(QAbstractButton* button)
+{
+ uDebug() << "UMLUniqueConstraintDialog::slotButtonClicked - " << button->text();
+ switch (m_dialogButtonBox->buttonRole(button)) {
+ case QDialogButtonBox::AcceptRole:
+ slotOk();
+ break;
+ case QDialogButtonBox::RejectRole:
+ reject();
+ break;
+ case QDialogButtonBox::ApplyRole:
+ slotApply();
+ case QDialogButtonBox::HelpRole:
+ //KHelpClient::invokeHelp(QLatin1String("help:/umbrello/index.html"), QLatin1String("umbrello"));
+ break;
+ default:
+ uDebug() << "UMLUniqueConstraintDialog::slotButtonClicked - " << button->text() << " unhandled!";
+ break;
+ }
}
/**
diff --git a/umbrello/dialogs/umluniqueconstraintdialog.h b/umbrello/dialogs/umluniqueconstraintdialog.h
index d6833cc..2c98533 100644
--- a/umbrello/dialogs/umluniqueconstraintdialog.h
+++ b/umbrello/dialogs/umluniqueconstraintdialog.h
@@ -17,14 +17,16 @@
//qt includes
#include <QDialog>
-class UMLDoc;
-class UMLUniqueConstraint;
class KComboBox;
class KLineEdit;
+class QAbstractButton;
+class QDialogButtonBox;
class QGroupBox;
class QLabel;
class QListWidget;
class QPushButton;
+class UMLDoc;
+class UMLUniqueConstraint;
/**
* A dialog page to display unique constraint properties.
@@ -56,6 +58,7 @@ private:
QListWidget* m_pAttributeListLW;
KComboBox* m_pAttributeCB;
QPushButton* m_pAddPB, *m_pRemovePB;
+ QDialogButtonBox *m_dialogButtonBox;
// local cache
UMLEntityAttributeList m_pEntityAttributeList;
@@ -68,6 +71,9 @@ public slots:
void slotAddAttribute();
void slotDeleteAttribute();
+protected slots:
+ virtual void slotButtonClicked(QAbstractButton *button);
+
};
#endif