[Uml-devel] KDE/kdesdk/umbrello/umbrello/dialogs

Andi Fischer andi.fischer at hispeed.ch
Fri Jul 31 07:50:07 UTC 2009


SVN commit 1004964 by fischer:

Replacing KArrowButton with QToolButton.

 M  +32 -17    activitypage.cpp  
 M  +9 -14     activitypage.h  
 M  +18 -14    classifierlistpage.cpp  
 M  +5 -5      classifierlistpage.h  
 M  +0 -1      constraintlistpage.cpp  
 M  +0 -1      constraintlistpage.h  
 M  +16 -7     umloperationdialog.cpp  
 M  +26 -39    umloperationdialog.h  


--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/activitypage.cpp #1004963:1004964
@@ -4,7 +4,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2002-2008                                               *
+ *   copyright (C) 2002-2009                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
@@ -25,7 +25,12 @@
 #include <QtGui/QHBoxLayout>
 #include <QtGui/QGridLayout>
 #include <QtGui/QGroupBox>
+#include <QtGui/QPushButton>
+#include <QtGui/QToolButton>
 
+/**
+ * Constructor.
+ */
 ActivityPage::ActivityPage( QWidget * pParent, StateWidget * pWidget ) : QWidget( pParent )
 {
     m_pStateWidget = pWidget;
@@ -33,12 +38,15 @@
     setupPage();
 }
 
+/**
+ * Destructor.
+ */
 ActivityPage::~ActivityPage()
 {
 }
 
 /**
- *   Sets up the page.
+ * Sets up the page.
  */
 void ActivityPage::setupPage()
 {
@@ -66,21 +74,29 @@
     QVBoxLayout * buttonLayout = new QVBoxLayout();
     listHBoxLayout->addItem( buttonLayout );
 
-    m_pTopArrowB = new KArrowButton( m_pActivityGB );
+    m_pTopArrowB = new QToolButton( m_pActivityGB );
+    m_pTopArrowB->setArrowType(Qt::UpArrow);
     m_pTopArrowB->setEnabled( false );
+    m_pTopArrowB->setToolTip(i18n("Move selected item to the top"));
     buttonLayout->addWidget( m_pTopArrowB );
 
-    m_pUpArrowB = new KArrowButton( m_pActivityGB );
-    m_pUpArrowB->setEnabled( false );
-    buttonLayout->addWidget( m_pUpArrowB );
+    m_pUpArrowB = new QToolButton(m_pActivityGB);
+    m_pUpArrowB->setArrowType(Qt::UpArrow);
+    m_pUpArrowB->setEnabled(false);
+    m_pUpArrowB->setToolTip(i18n("Move selected item up"));
+    buttonLayout->addWidget(m_pUpArrowB);
 
-    m_pDownArrowB = new KArrowButton( m_pActivityGB, Qt::DownArrow );
-    m_pDownArrowB->setEnabled( false );
-    buttonLayout->addWidget( m_pDownArrowB );
+    m_pDownArrowB = new QToolButton(m_pActivityGB);
+    m_pDownArrowB->setArrowType(Qt::DownArrow);
+    m_pDownArrowB->setEnabled(false);
+    m_pDownArrowB->setToolTip(i18n("Move selected item down"));
+    buttonLayout->addWidget(m_pDownArrowB);
 
-    m_pBottomArrowB = new KArrowButton( m_pActivityGB, Qt::DownArrow );
-    m_pBottomArrowB->setEnabled( false );
-    buttonLayout->addWidget( m_pBottomArrowB );
+    m_pBottomArrowB = new QToolButton(m_pActivityGB);
+    m_pBottomArrowB->setArrowType(Qt::DownArrow);
+    m_pBottomArrowB->setEnabled(false);
+    m_pBottomArrowB->setToolTip(i18n("Move selected item to the bottom"));
+    buttonLayout->addWidget(m_pBottomArrowB);
 
     KDialogButtonBox* buttonBox = new KDialogButtonBox(m_pActivityGB);
     buttonBox->addButton( i18n("New Activity..."), KDialogButtonBox::ActionRole,
@@ -117,7 +133,7 @@
 }
 
 /**
- *   Sets the activities of the widget.
+ * Sets the activities of the widget.
  */
 void ActivityPage::updateActivities()
 {
@@ -130,7 +146,7 @@
 }
 
 /**
- *  Popup menu item selected
+ * Popup menu item selected.
  */
 void ActivityPage::slotMenuSelection(QAction* action)
 {
@@ -295,9 +311,8 @@
 }
 
 /**
- *  Set the state of the widgets on the page with the given value.
- *
- *  @param state The state to set the widgets as.
+ * Set the state of the widgets on the page with the given value.
+ * @param state The state to set the widgets as.
  */
 void ActivityPage::enableWidgets(bool state)
 {
--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/activitypage.h #1004963:1004964
@@ -4,16 +4,13 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2002-2008                                               *
+ *   copyright (C) 2002-2009                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
 #ifndef ACTIVITYPAGE_H
 #define ACTIVITYPAGE_H
 
-//kde includes
-#include <karrowbutton.h>
-
 //qt includes
 #include <QtGui/QWidget>
 #include <QtGui/QListWidgetItem>
@@ -22,6 +19,8 @@
 class ListPopupMenu;
 class QGroupBox;
 class QListWidget;
+class QPushButton;
+class QToolButton;
 
 /**
  * @author Paul Hensgen
@@ -32,14 +31,7 @@
     Q_OBJECT
 public:
 
-    /**
-     *  Constructor
-     */
     ActivityPage( QWidget * pParent, StateWidget * pWidget );
-
-    /**
-     *   Deconstructor
-     */
     ~ActivityPage();
 
     void setupPage();
@@ -63,9 +55,12 @@
     /**
      * GUI widgets
      */
-    QListWidget * m_pActivityLW;
-    QGroupBox * m_pActivityGB;
-    KArrowButton * m_pUpArrowB, * m_pDownArrowB, * m_pTopArrowB, *m_pBottomArrowB;
+    QListWidget* m_pActivityLW;
+    QGroupBox*   m_pActivityGB;
+    QToolButton* m_pUpArrowB;
+    QToolButton* m_pDownArrowB;
+    QToolButton* m_pTopArrowB;
+    QToolButton* m_pBottomArrowB;
     QPushButton* m_pDeleteActivityButton;
     QPushButton* m_pRenameButton;
 
--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/classifierlistpage.cpp #1004963:1004964
@@ -23,7 +23,6 @@
 #include "entityattribute.h"
 #include "object_factory.h"
 
-#include <karrowbutton.h>
 #include <kdebug.h>
 #include <kdialogbuttonbox.h>
 #include <klocale.h>
@@ -35,6 +34,7 @@
 #include <QtGui/QHBoxLayout>
 #include <QtGui/QListWidget>
 #include <QtGui/QPushButton>
+#include <QtGui/QToolButton>
 #include <QtGui/QVBoxLayout>
 
 using namespace Uml;
@@ -166,27 +166,31 @@
 void ClassifierListPage::setupMoveButtons(QHBoxLayout* parentLayout)
 {
     QVBoxLayout* buttonLayout = new QVBoxLayout();
-    parentLayout->addItem( buttonLayout );
+    parentLayout->addItem(buttonLayout);
 
-    m_pTopArrowB = new KArrowButton( m_pItemListGB );
-    m_pTopArrowB->setEnabled( false );
+    m_pTopArrowB = new QToolButton(m_pItemListGB);
+    m_pTopArrowB->setArrowType(Qt::UpArrow);
+    m_pTopArrowB->setEnabled(false);
     m_pTopArrowB->setToolTip(i18n("Move selected item to the top"));
-    buttonLayout->addWidget( m_pTopArrowB );
+    buttonLayout->addWidget(m_pTopArrowB);
 
-    m_pUpArrowB = new KArrowButton( m_pItemListGB );
-    m_pUpArrowB->setEnabled( false );
+    m_pUpArrowB = new QToolButton(m_pItemListGB);
+    m_pUpArrowB->setArrowType(Qt::UpArrow);
+    m_pUpArrowB->setEnabled(false);
     m_pUpArrowB->setToolTip(i18n("Move selected item up"));
-    buttonLayout->addWidget( m_pUpArrowB );
+    buttonLayout->addWidget(m_pUpArrowB);
 
-    m_pDownArrowB = new KArrowButton( m_pItemListGB, Qt::DownArrow );
-    m_pDownArrowB->setEnabled( false );
+    m_pDownArrowB = new QToolButton(m_pItemListGB);
+    m_pDownArrowB->setArrowType(Qt::DownArrow);
+    m_pDownArrowB->setEnabled(false);
     m_pDownArrowB->setToolTip(i18n("Move selected item down"));
-    buttonLayout->addWidget( m_pDownArrowB );
+    buttonLayout->addWidget(m_pDownArrowB);
 
-    m_pBottomArrowB = new KArrowButton( m_pItemListGB, Qt::DownArrow );
-    m_pBottomArrowB->setEnabled( false );
+    m_pBottomArrowB = new QToolButton(m_pItemListGB);
+    m_pBottomArrowB->setArrowType(Qt::DownArrow);
+    m_pBottomArrowB->setEnabled(false);
     m_pBottomArrowB->setToolTip(i18n("Move selected item to the bottom"));
-    buttonLayout->addWidget( m_pBottomArrowB );
+    buttonLayout->addWidget(m_pBottomArrowB);
 }
 
 /**
--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/classifierlistpage.h #1004963:1004964
@@ -22,13 +22,13 @@
 class UMLObject;
 class UMLClassifier;
 class UMLDoc;
-class KArrowButton;
 class KTextEdit;
 class QGroupBox;
 class QHBoxLayout;
 class QListWidget;
 class QListWidgetItem;
 class QPushButton;
+class QToolButton;
 class QVBoxLayout;
 
 /**
@@ -79,10 +79,10 @@
     KTextEdit* m_pCodeTE;
     QListWidget* m_pItemListLB;
 
-    KArrowButton* m_pTopArrowB;
-    KArrowButton* m_pUpArrowB;
-    KArrowButton* m_pDownArrowB;
-    KArrowButton* m_pBottomArrowB;
+    QToolButton* m_pTopArrowB;
+    QToolButton* m_pUpArrowB;
+    QToolButton* m_pDownArrowB;
+    QToolButton* m_pBottomArrowB;
 
     UMLDoc* m_pDoc;
     ListPopupMenu* m_pMenu;
--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/constraintlistpage.cpp #1004963:1004964
@@ -23,7 +23,6 @@
 #include "uniqueconstraint.h"
 
 #include <kaction.h>
-#include <karrowbutton.h>
 #include <kdebug.h>
 #include <kdialogbuttonbox.h>
 #include <klocale.h>
--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/constraintlistpage.h #1004963:1004964
@@ -19,7 +19,6 @@
 #include "classifierlistpage.h"
 
 class KAction;
-class KArrowButton;
 class KMenu;
 
 /**
--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/umloperationdialog.cpp #1004963:1004964
@@ -33,7 +33,6 @@
 #include <klocale.h>
 #include <kmessagebox.h>
 #include <kdialogbuttonbox.h>
-#include <karrowbutton.h>
 
 //qt includes
 #include <QtCore/QPointer>
@@ -47,7 +46,11 @@
 #include <QtGui/QVBoxLayout>
 #include <QtGui/QHBoxLayout>
 #include <QtGui/QGridLayout>
+#include <QtGui/QToolButton>
 
+/**
+ * Constructor.
+ */
 UMLOperationDialog::UMLOperationDialog( QWidget * parent, UMLOperation * pOperation )
   : KDialog( parent)
 {
@@ -65,6 +68,9 @@
     connect(this,SIGNAL(applyClicked()),this,SLOT(slotApply()));
 }
 
+/**
+ * Destructor.
+ */
 UMLOperationDialog::~UMLOperationDialog()
 {
 }
@@ -143,14 +149,17 @@
 
     // the move up/down buttons (another vertical box)
     QVBoxLayout* buttonLayout = new QVBoxLayout();
-    m_pUpButton = new KArrowButton( m_pParmsGB );
-    m_pUpButton->setEnabled( false );
-    buttonLayout->addWidget( m_pUpButton );
 
-    m_pDownButton = new KArrowButton( m_pParmsGB, Qt::DownArrow );
-    m_pDownButton->setEnabled( false );
-    buttonLayout->addWidget( m_pDownButton );
+    m_pUpButton = new QToolButton(m_pParmsGB);
+    m_pUpButton->setArrowType(Qt::UpArrow);
+    m_pUpButton->setEnabled(false);
+    buttonLayout->addWidget(m_pUpButton);
 
+    m_pDownButton = new QToolButton(m_pParmsGB);
+    m_pDownButton->setArrowType(Qt::DownArrow);
+    m_pDownButton->setEnabled(false);
+    buttonLayout->addWidget(m_pDownButton);
+
     KDialogButtonBox* buttonBox = new KDialogButtonBox(m_pParmsGB);
     buttonBox->addButton( i18n("Ne&w Parameter..."), KDialogButtonBox::ActionRole,
                           this, SLOT(slotNewParameter()) );
--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/umloperationdialog.h #1004963:1004964
@@ -28,7 +28,7 @@
 class KComboBox;
 class KLineEdit;
 class UMLDoc;
-class KArrowButton;
+class QToolButton;
 
 /**
  * @author Paul Hensgen
@@ -37,17 +37,9 @@
 class UMLOperationDialog : public KDialog
 {
     Q_OBJECT
-
 public:
 
-    /**
-     * Constructor.
-     */
     UMLOperationDialog( QWidget * parent, UMLOperation * pOperation );
-
-    /**
-     * Destructor.
-     */
     ~UMLOperationDialog();
 
 protected:
@@ -57,39 +49,34 @@
     bool apply();
 
     void insertTypesSorted( const QString& type = "" );
-
-    /**
-     * The operation to represent.
-     */
-    UMLOperation * m_operation;
-
-    /**
-     * The UMLDocument where all objects live.
-     */
-    UMLDoc * m_doc;
-
-    /**
-     * Menu used in parameter list box.
-     */
-    ListPopupMenu * m_menu;
-
     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.
+
     //GUI widgets
-    QGroupBox  * m_pParmsGB, * m_pGenGB;
-    QListWidget * m_pParmsLW;
-    QGroupBox * m_pScopeGB;
-    QRadioButton * m_pPublicRB, * m_pPrivateRB,  * m_pProtectedRB, * m_pImplementationRB;
-    QLabel * m_pRtypeL, * m_pNameL, * m_pStereoTypeL;
-    KComboBox * m_pRtypeCB, * m_pStereoTypeCB;
-    KLineEdit * m_pNameLE;
-    QCheckBox * m_pAbstractCB;
-    QCheckBox * m_pStaticCB;
-    QCheckBox * m_pQueryCB;
-    QPushButton* m_pDeleteButton;
-    QPushButton* m_pPropertiesButton;
-    KArrowButton* m_pUpButton;
-    KArrowButton* 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;
 
 public slots:
     void slotParmRightButtonPressed(const QPoint &p);




More information about the umbrello-devel mailing list