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

Ralf Habacker ralf.habacker at gmail.com
Fri Jan 13 12:50:15 UTC 2012


SVN commit 1273416 by habacker:

Reuse font page and style page implementation from DialogBase.

 M  +6 -35     objectnodedialog.cpp  
 M  +2 -19     objectnodedialog.h  


--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/objectnodedialog.cpp #1273415:1273416
@@ -4,7 +4,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2002-2011                                               *
+ *   copyright (C) 2002-2012                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
@@ -34,7 +34,7 @@
 #include <QtGui/QRadioButton>
 
 ObjectNodeDialog::ObjectNodeDialog( UMLView * pView, ObjectNodeWidget * pWidget )
-        : KPageDialog(pView)
+  : DialogBase(pView)
 {
     setCaption( i18n("Properties") );
     setButtons( Ok | Apply | Cancel | Help );
@@ -91,8 +91,8 @@
 void ObjectNodeDialog::setupPages()
 {
     setupGeneralPage();
-    setupStylePage();
-    setupFontPage();
+    pageItemStyle = setupStylePage( m_pObjectNodeWidget ) ;
+    pageItemFont = setupFontPage( m_pObjectNodeWidget );
 }
 
 /**
@@ -119,11 +119,11 @@
     }
     else if ( item == pageItemFont )
     {
-        m_pObjectNodeWidget->setFont( m_pChooser->font() );
+        saveFontPageData( m_pObjectNodeWidget );
     }
     else if ( item == pageItemStyle )
     {
-        m_pStylePage->updateUMLWidget();
+        saveStylePageData( m_pObjectNodeWidget );
     }
 }
 
@@ -212,20 +212,6 @@
 }
 
 /**
- * Sets up the font selection page.
- */
-void ObjectNodeDialog::setupFontPage()
-{
-    KVBox *page = new KVBox();
-    pageItemFont = new KPageWidgetItem( page, i18n("Font") );
-    pageItemFont->setHeader( i18n("Font Settings") );
-    pageItemFont->setIcon( Icon_Utils::DesktopIcon(Icon_Utils::it_Properties_Font) );
-    addPage( pageItemFont );
-    m_pChooser = new KFontChooser( (QWidget*)page, KFontChooser::NoDisplayFlags, QStringList(), 0);
-    m_pChooser->setFont( m_pObjectNodeWidget->font() );
-}
-
-/**
  * Show the State entry text.
  */
 void ObjectNodeDialog::showState()
@@ -238,19 +224,4 @@
     }
 }
 
-/**
- * Sets up the style page.
- */
-void ObjectNodeDialog::setupStylePage()
-{
-    QFrame *stylePage = new QFrame();
-    pageItemStyle = new KPageWidgetItem( stylePage, i18nc("style page title", "Style") );
-    pageItemStyle->setHeader( i18n("Widget Style") );
-    pageItemStyle->setIcon( Icon_Utils::DesktopIcon(Icon_Utils::it_Properties_Color) );
-    addPage( pageItemStyle );
-    QHBoxLayout * m_pStyleLayout = new QHBoxLayout(stylePage);
-    m_pStylePage = new UMLWidgetStylePage( stylePage, m_pObjectNodeWidget );
-    m_pStyleLayout->addWidget(m_pStylePage);
-}
-
 #include "objectnodedialog.moc"
--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/objectnodedialog.h #1273415:1273416
@@ -12,12 +12,9 @@
 #define OBJECTNODEDIALOG_H
 
 // local class includes
+#include "dialogbase.h"
 #include "umlwidgetstylepage.h"
 
-// kde class includes
-#include <kpagedialog.h>
-#include <kfontdialog.h>
-
 //forward declarations
 class UMLView;
 class ObjectNodeWidget;
@@ -33,7 +30,7 @@
  *   @author   Paul Hensgen
  * Bugs and comments to uml-devel at lists.sf.net or http://bugs.kde.org
  */
-class ObjectNodeDialog : public KPageDialog
+class ObjectNodeDialog : public DialogBase
 {
     Q_OBJECT
 
@@ -63,25 +60,11 @@
 
     void setupGeneralPage();
 
-    void setupStylePage();
-
-    void setupFontPage();
-
     void showState();
 
     void applyPage( KPageWidgetItem * );
 
     /**
-     * Font chooser widget for font page.
-     */
-    KFontChooser * m_pChooser;
-
-    /**
-     * style page
-     */
-    UMLWidgetStylePage * m_pStylePage;
-
-    /**
      * The widget to represent.
      */
     ObjectNodeWidget * m_pObjectNodeWidget;




More information about the umbrello-devel mailing list