summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Fischer <[email protected]>2014-12-08 16:57:46 +0100
committerAndi Fischer <[email protected]>2014-12-08 16:57:46 +0100
commitdc7d91df57d770566421f9ea0f3b5a70cb0ddf12 (patch)
tree3c6b6734dc16ee857cbc42e950d1a8d73acf5665
parent57bf88ef1e03f8775750d51e1a6a160e60b4cafa (diff)
Dialog buttons handled and FIXME KF5 comments removed.
-rw-r--r--umbrello/dialogs/pages/generaloptionpage.cpp3
-rw-r--r--umbrello/dialogs/pages/generaloptionpage.h2
-rw-r--r--umbrello/dialogs/umloperationdialog.cpp58
-rw-r--r--umbrello/dialogs/umloperationdialog.h60
4 files changed, 79 insertions, 44 deletions
diff --git a/umbrello/dialogs/pages/generaloptionpage.cpp b/umbrello/dialogs/pages/generaloptionpage.cpp
index c7101ea..a0b3db2 100644
--- a/umbrello/dialogs/pages/generaloptionpage.cpp
+++ b/umbrello/dialogs/pages/generaloptionpage.cpp
@@ -41,9 +41,6 @@ GeneralOptionPage::GeneralOptionPage(QWidget* parent)
QVBoxLayout* topLayout = new QVBoxLayout(this);
Settings::OptionState &optionState = Settings::optionState();
-#if 0 //FIXME KF5
- int spacingHint = static_cast<QDialog*>(parent)->spacingHint();
-#endif
int spacingHint = 2;
// Set up undo setting
m_GeneralWidgets.miscGB = new QGroupBox(i18nc("miscellaneous group box", "Miscellaneous"));
diff --git a/umbrello/dialogs/pages/generaloptionpage.h b/umbrello/dialogs/pages/generaloptionpage.h
index 2060bad..b0173a4 100644
--- a/umbrello/dialogs/pages/generaloptionpage.h
+++ b/umbrello/dialogs/pages/generaloptionpage.h
@@ -46,7 +46,7 @@ protected:
QGroupBox * autosaveGB;
QGroupBox * startupGB;
- QSpinBox * timeISB;
+ QSpinBox * timeISB;
KComboBox * diagramKB;
KComboBox * languageKB;
diff --git a/umbrello/dialogs/umloperationdialog.cpp b/umbrello/dialogs/umloperationdialog.cpp
index 1e92244..95f7a45 100644
--- a/umbrello/dialogs/umloperationdialog.cpp
+++ b/umbrello/dialogs/umloperationdialog.cpp
@@ -28,12 +28,14 @@
#include "uniqueid.h"
//kde includes
-#include <klineedit.h>
-#include <kcombobox.h>
+#include <KComboBox>
+#include <KHelpClient>
+#include <KLineEdit>
#include <KLocalizedString>
-#include <kmessagebox.h>
+#include <KMessageBox>
//qt includes
+#include <QAbstractButton>
#include <QCheckBox>
#include <QDialogButtonBox>
#include <QGridLayout>
@@ -223,15 +225,11 @@ void UMLOperationDialog::setupDialog()
m_pNameLE->setFocus();
-//FIXME KF5
-// setButtons(Help | Ok | Cancel);
-// setDefaultButton(Ok);
-// showButtonSeparator(true);
- QDialogButtonBox* dlgButtonBox = new QDialogButtonBox(QDialogButtonBox::Ok |
- QDialogButtonBox::Cancel);
- connect(dlgButtonBox, SIGNAL(accepted()), this, SLOT(slotOk()));
- connect(dlgButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
- topLayout->addWidget(dlgButtonBox);
+ m_dialogButtonBox = new QDialogButtonBox(QDialogButtonBox::Ok |
+ QDialogButtonBox::Help |
+ QDialogButtonBox::Cancel);
+ connect(m_dialogButtonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(slotButtonClicked(QAbstractButton*)));
+ topLayout->addWidget(m_dialogButtonBox);
}
void UMLOperationDialog::slotParmRightButtonPressed(const QPoint &p)
@@ -493,6 +491,42 @@ void UMLOperationDialog::slotOk()
}
/**
+ * Launch khelpcenter.
+ */
+void UMLOperationDialog::slotHelpClicked()
+{
+ DEBUG(DBG_SRC) << "HELP clicked...directly handled";
+ KHelpClient::invokeHelp(QLatin1String("help:/umbrello/index.html"), QLatin1String("umbrello"));
+}
+
+/**
+ * Button clicked event handler for the dialog button box.
+ * @param button the button which was clicked
+ */
+void UMLOperationDialog::slotButtonClicked(QAbstractButton *button)
+{
+ if (button == (QAbstractButton*)m_dialogButtonBox->button(QDialogButtonBox::Apply)) {
+ DEBUG(DBG_SRC) << "APPLY clicked...";
+ // slotApplyClicked();
+ }
+ else if (button == (QAbstractButton*)m_dialogButtonBox->button(QDialogButtonBox::Ok)) {
+ DEBUG(DBG_SRC) << "OK clicked...";
+ slotOk();
+ }
+ else if (button == (QAbstractButton*)m_dialogButtonBox->button(QDialogButtonBox::Cancel)) {
+ DEBUG(DBG_SRC) << "CANCEL clicked...";
+ reject();
+ }
+ else if (button == (QAbstractButton*)m_dialogButtonBox->button(QDialogButtonBox::Help)) {
+ DEBUG(DBG_SRC) << "HELP clicked...";
+ slotHelpClicked();
+ }
+ else {
+ DEBUG(DBG_SRC) << "Button clicked with unhandled role.";
+ }
+}
+
+/**
* Inserts @p type into the type-combobox.
* The combobox is cleared and all types together with the optional new one
* sorted and then added again.
diff --git a/umbrello/dialogs/umloperationdialog.h b/umbrello/dialogs/umloperationdialog.h
index c574d39..99183b0 100644
--- a/umbrello/dialogs/umloperationdialog.h
+++ b/umbrello/dialogs/umloperationdialog.h
@@ -14,8 +14,10 @@
//qt includes
#include <QDialog>
-class UMLOperation;
+class KComboBox;
class ListPopupMenu;
+class QAbstractButton;
+class QDialogButtonBox;
class QGroupBox;
class QListWidget;
class QListWidgetItem;
@@ -23,10 +25,10 @@ class QLabel;
class QRadioButton;
class QPushButton;
class QCheckBox;
-class KComboBox;
+class QToolButton;
class KLineEdit;
class UMLDoc;
-class QToolButton;
+class UMLOperation;
/**
* @author Paul Hensgen
@@ -49,32 +51,33 @@ protected:
void insertTypesSorted(const QString& type = QString());
void insertStereotypesSorted(const QString& type);
- UMLOperation* m_operation; ///< The operation to represent.
- UMLDoc* m_doc; ///< The UMLDocument where all objects live.
- ListPopupMenu* m_menu; ///< Menu used in parameter list box.
+ UMLOperation* m_operation; ///< The operation to represent.
+ UMLDoc* m_doc; ///< The UMLDocument where all objects live.
+ ListPopupMenu* m_menu; ///< Menu used in parameter list box.
//GUI widgets
- QGroupBox* m_pParmsGB;
- QGroupBox* m_pGenGB;
- QListWidget* m_pParmsLW;
- QGroupBox* m_pScopeGB;
- QRadioButton* m_pPublicRB;
- QRadioButton* m_pPrivateRB;
- QRadioButton* m_pProtectedRB;
- QRadioButton* m_pImplementationRB;
- QLabel* m_pRtypeL;
- QLabel* m_pNameL;
- QLabel* m_pStereoTypeL;
- KComboBox* m_pRtypeCB;
- KComboBox* m_pStereoTypeCB;
- KLineEdit* m_pNameLE;
- QCheckBox* m_pAbstractCB;
- QCheckBox* m_pStaticCB;
- QCheckBox* m_pQueryCB;
- QPushButton* m_pDeleteButton;
- QPushButton* m_pPropertiesButton;
- QToolButton* m_pUpButton;
- QToolButton* m_pDownButton;
+ QGroupBox* m_pParmsGB;
+ QGroupBox* m_pGenGB;
+ QListWidget* m_pParmsLW;
+ QGroupBox* m_pScopeGB;
+ QRadioButton* m_pPublicRB;
+ QRadioButton* m_pPrivateRB;
+ QRadioButton* m_pProtectedRB;
+ QRadioButton* m_pImplementationRB;
+ QLabel* m_pRtypeL;
+ QLabel* m_pNameL;
+ QLabel* m_pStereoTypeL;
+ KComboBox* m_pRtypeCB;
+ KComboBox* m_pStereoTypeCB;
+ KLineEdit* m_pNameLE;
+ QCheckBox* m_pAbstractCB;
+ QCheckBox* m_pStaticCB;
+ QCheckBox* m_pQueryCB;
+ QPushButton* m_pDeleteButton;
+ QPushButton* m_pPropertiesButton;
+ QToolButton* m_pUpButton;
+ QToolButton* m_pDownButton;
+ QDialogButtonBox* m_dialogButtonBox;
public slots:
void slotParmRightButtonPressed(const QPoint &p);
@@ -87,7 +90,8 @@ public slots:
void slotParameterDown();
void slotParamsBoxClicked(QListWidgetItem* parameterItem);
void slotOk();
-
+ void slotHelpClicked();
+ void slotButtonClicked(QAbstractButton *button);
};
#endif