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

Laurent Montel montel at kde.org
Thu Jun 22 08:29:58 UTC 2006


SVN commit 553821 by mlaurent:

Port++


 M  +27 -7     assocpropdlg.cpp  
 M  +2 -2      assocpropdlg.h  
 M  +43 -10    classpropdlg.cpp  
 M  +2 -2      classpropdlg.h  


--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/assocpropdlg.cpp #553820:553821
@@ -23,6 +23,7 @@
 #include <kmessagebox.h>
 #include <kiconloader.h>
 #include <kdebug.h>
+#include <kvbox.h>
 
 #include "assocpropdlg.h"
 #include "assocgenpage.h"
@@ -39,16 +40,22 @@
 #include "../umlview.h"
 
 AssocPropDlg::AssocPropDlg (QWidget *parent, AssociationWidget * assocWidget, int pageNum)
-        : KDialogBase(IconList, i18n("Association Properties"), Ok | Apply | Cancel | Help,
-                      Ok, parent, "_ASSOCPROPDLG_", true, true)
+        : KPageDialog(parent)
 {
+    setCaption( i18n("Association Properties") );
+    setButtons( Ok | Apply | Cancel | Help );
+    setDefaultButton( Ok );
+    setModal( true );
+    setFaceType( KPageDialog::List );
+    enableButtonSeparator( true );
     init();
     m_pAssoc = assocWidget;
 
     m_pDoc = ((UMLApp *)parent) -> getDocument(); // needed?
 
     setupPages(assocWidget);
-    showPage(pageNum);
+#warning "kde4: port it"
+    //showPage(pageNum);
 }
 
 AssocPropDlg::~AssocPropDlg() { }
@@ -62,7 +69,7 @@
 
 void AssocPropDlg::slotOk() {
     slotApply();
-    KDialogBase::accept();
+    KDialog::accept();
 }
 
 void AssocPropDlg::slotApply() {
@@ -87,14 +94,22 @@
 {
 
     // general page
-    QFrame *page = addPage( i18n("General"), i18n("General Settings"), DesktopIcon( "misc") );
+    QFrame *page = new QFrame();
+    KPageWidgetItem *pageItem = new KPageWidgetItem( page, i18n("General"));
+    pageItem->setHeader( i18n("General Settings") );
+    pageItem->setIcon( DesktopIcon( "misc") );
+    addPage( pageItem );
     QHBoxLayout *genLayout = new QHBoxLayout(page);
     page -> setMinimumSize(310, 330);
     m_pGenPage = new AssocGenPage (m_pDoc, page, assocWidget);
     genLayout -> addWidget(m_pGenPage);
 
     // role page
-    QFrame * newPage = addPage( i18n("Roles"), i18n("Role Settings"), DesktopIcon( "misc") );
+    QFrame *newPage = new QFrame();
+    pageItem = new KPageWidgetItem( newPage, i18n("Roles"));
+    pageItem->setHeader( i18n("Role Settings"));
+    pageItem->setIcon( DesktopIcon( "misc") );
+    addPage( pageItem );
     QHBoxLayout * roleLayout = new QHBoxLayout(newPage);
     // newPage -> setMinimumSize(310, 330);
     m_pRolePage = new AssocRolePage(m_pDoc, newPage, assocWidget);
@@ -109,7 +124,12 @@
     if( !m_pAssoc)
         return;
 
-    KVBox *page = addVBoxPage( i18n("Font"), i18n("Font Settings"), DesktopIcon( "fonts"));
+    KVBox *page = new KVBox();
+    KPageWidgetItem* pageItem = new KPageWidgetItem( page, i18n("Font"));
+    pageItem->setHeader( i18n("Font Settings"));
+    pageItem->setIcon( DesktopIcon( "fonts") );
+    addPage( pageItem );
+
     m_pChooser = new KFontChooser( (QWidget*)page, false, QStringList(), false);
     m_pChooser->setFont( m_pAssoc->getFont());
     m_pChooser->setSampleText(i18n("Association font"));
--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/assocpropdlg.h #553820:553821
@@ -16,7 +16,7 @@
 #define ASSOCPROPDLG_H
 
 //kde class includes
-#include <kdialogbase.h>
+#include <kpagedialog.h>
 #include <kfontdialog.h>
 #include "../associationwidget.h"
 
@@ -32,7 +32,7 @@
  * @author Brian Thomas <Brian.A.Thomas at gsfc.nasa.gov>
  * Bugs and comments to uml-devel at lists.sf.net or http://bugs.kde.org
  */
-class AssocPropDlg : public KDialogBase {
+class AssocPropDlg : public KPageDialog {
     Q_OBJECT
 public:
 
--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/classpropdlg.cpp #553820:553821
@@ -35,8 +35,13 @@
 #include "../umlview.h"
 
 ClassPropDlg::ClassPropDlg(QWidget *parent, UMLObject * c, int pageNum, bool assoc)
-        : KDialogBase(IconList, i18n("Properties"), Ok | Apply | Cancel | Help,
-              Ok, parent, "_CLASSDLG_", true, true) {
+        : KPageDialog(parent) {
+    setCaption( i18n("Properties") );
+    setButtons( Ok | Apply | Cancel | Help );
+    setDefaultButtons(Ok );
+    setModal( true );
+    enableButtonSeparator( true );
+    setTypeFace( KPageDialog::List );
     m_pWidget = 0;
     m_pGenPage = 0;
     m_pAttPage = 0;
@@ -54,8 +59,13 @@
 }
 
 ClassPropDlg::ClassPropDlg(QWidget *parent, ObjectWidget * o)
-        : KDialogBase(IconList, i18n("Properties"), Ok | Apply | Cancel | Help,
-              Ok, parent, "_CLASSDLG_", true, true) {
+        : KPageDialog(parent) {
+    setCaption( i18n("Properties") );
+    setButtons( Ok | Apply | Cancel | Help );
+    setDefaultButtons(Ok );
+    setModal( true );
+    enableButtonSeparator( true );
+    setTypeFace( KPageDialog::List );
     m_pWidget = o;
     m_pGenPage = 0;
     m_pAttPage = 0;
@@ -67,13 +77,22 @@
     m_Type = pt_ObjectWidget;
     m_pObject = m_pWidget->getUMLObject();
     m_pDoc = UMLApp::app()->getDocument();
-    QFrame *page = addPage( i18n("General"), i18n("General Settings"), DesktopIcon( "misc") );
+    QFrame *page = new QFrame();
+    KPageWidgetItem *pageItem = new KPageWidgetItem( page, i18n("General") );
+    pageItem->setHeader( i18n("General Settings") );
+    pageItem->setIcon(  DesktopIcon( "misc") );
+    addPage( page );
     page -> setMinimumSize(310, 330);
     QHBoxLayout * topLayout = new QHBoxLayout(page);
     m_pGenPage = new ClassGenPage(m_pDoc, page, o);
     topLayout -> addWidget(m_pGenPage);
 
-    QFrame * newPage = addPage( i18n("Color"), i18n("Widget Colors"), DesktopIcon( "colors") );
+    QFrame * newPage = new QFrame();
+    pageItem = new KPageWidgetItem( page, i18n("Color") );
+    pageItem->setHeader( i18n("Widget Colors") );
+    setIcon( DesktopIcon( "colors") );
+    addPage( newPage);
+
     QHBoxLayout * m_pColorLayout = new QHBoxLayout(newPage);
     m_pColorPage = new UMLWidgetColorPage(newPage, o);
     m_pColorLayout -> addWidget(m_pColorPage);
@@ -84,8 +103,13 @@
 }
 
 ClassPropDlg::ClassPropDlg(QWidget *parent, UMLWidget * w)
-        : KDialogBase(IconList, i18n("Properties"), Ok | Apply | Cancel | Help,
-              Ok, parent, "_CLASSDLG_", true, true) {
+        : KPageDialog(parent) {
+    setCaption( i18n("Properties") );
+    setButtons( Ok | Apply | Cancel | Help );
+    setDefaultButtons(Ok );
+    setModal( true );
+    enableButtonSeparator( true );
+    setTypeFace( KPageDialog::List );
     m_pWidget = w;
     m_pGenPage = 0;
     m_pAttPage = 0;
@@ -116,14 +140,23 @@
 
     //now setup the options page for classes
     if (w->getBaseType() == Uml::wt_Class || w->getBaseType() == Uml::wt_Interface) {
-        QFrame* newPage = addPage( i18n("Display"), i18n("Display Options"), DesktopIcon("info") );
+        QFrame* newPage = new QFrame();
+        KPageWidgetItem *pageItem = new KPageWidgetItem( newPage, i18n("Display") );
+        pageItem->setHeader( i18n("Display Options") );
+        pageItem->setIcon( DesktopIcon("info") );
+        addPage( pageItem);
+
         QHBoxLayout* m_pOptionsLayout = new QHBoxLayout(newPage);
         ClassifierWidget *cw = static_cast<ClassifierWidget*>(w);
         m_pOptionsPage = new ClassOptionsPage( newPage, cw );
         m_pOptionsLayout -> addWidget(m_pOptionsPage);
     }
+    QFrame* colorPage = new QFrame();
+    KPageWidgetItem *pageItem = new KPageWidgetItem( colorPage, i18n("Color") );
+    pageItem->setHeader( i18n("Widget Colors") );
+    pageItem->setIcon( DesktopIcon("colors") );
+    addPage( pageItem);
 
-    QFrame* colorPage = addPage( i18n("Color"), i18n("Widget Colors"), DesktopIcon("colors") );
     QHBoxLayout * m_pColorLayout = new QHBoxLayout(colorPage);
     m_pColorPage = new UMLWidgetColorPage(colorPage, w);
     m_pColorLayout -> addWidget(m_pColorPage);
--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/classpropdlg.h #553820:553821
@@ -11,7 +11,7 @@
 #define CLASSPROPDLG_H
 
 //kde class includes
-#include <kdialogbase.h>
+#include <kpagedialog.h>
 #include <kfontdialog.h>
 
 #include "../umlnamespace.h"
@@ -36,7 +36,7 @@
  * @version 1.0
  * Bugs and comments to uml-devel at lists.sf.net or http://bugs.kde.org
  */
-class ClassPropDlg : public KDialogBase {
+class ClassPropDlg : public KPageDialog {
     Q_OBJECT
 public:
     /**




More information about the umbrello-devel mailing list