[Uml-devel] kdesdk/umbrello/umbrello/refactoring

Luis De la Parra Blum lparrab at gmx.net
Mon May 12 16:28:04 UTC 2003


CVS commit by luis: 


Add attribute and operation dialog pages.
now you can rename/change properites of these two by double-clicking on the items.


  M +26 -7     refactoringassistant.cpp   1.7


--- kdesdk/umbrello/umbrello/refactoring/refactoringassistant.cpp  #1.6:1.7
@@ -24,4 +24,6 @@
 
 #include "../dialogs/operationpropertiespage.h"
+#include "../dialogs/attributepropertiespage.h"
+#include "../dialogs/umbrellodialog.h"
 
 #include <qpoint.h>
@@ -87,15 +89,32 @@ void RefactoringAssistant::itemExecuted(
         if(typeid(*obj) == typeid(UMLOperation))
         {
-                page = new OperationPropertiesPage( static_cast<UMLOperation*>(obj), 0, "operation properties");
+                UMLOperation *o = static_cast<UMLOperation*>(obj);
+                UmbrelloDialog dialog(this, UmbrelloDialog::Swallow, "edit_operation", true, i18n("Operation properties"), 
+                               UmbrelloDialog::Ok | UmbrelloDialog::Cancel );
+                OperationPropertiesPage *page = new OperationPropertiesPage(o,m_doc,&dialog,0);
+                dialog.setMainWidget(page);
+                if(dialog.exec())
+                {
+                        item->setText(0,o->getName());
+                        item->setPixmap(0, (o->getScope() == Uml::Public ? m_pixmaps.Public :
+                                        (o->getScope() == Uml::Protected ? m_pixmaps.Protected :
+                                        m_pixmaps.Private)));
+                }
         }
         if(typeid(*obj) == typeid(UMLAttribute))
         {
-                //page = new AttributePropertiesPage( static_cast<UMLAttribute*>(obj), 0, "attribute properties");
-        }
-        if( page )
+                UMLAttribute *a = static_cast<UMLAttribute*>(obj);
+                UmbrelloDialog dialog(this, UmbrelloDialog::Swallow, "edit_attribute", true, i18n("Attribute properties"), 
+                               UmbrelloDialog::Ok | UmbrelloDialog::Cancel );
+                AttributePropertiesPage *page = new AttributePropertiesPage(a,&dialog,0);
+                dialog.setMainWidget(page);
+                if(dialog.exec())
         {
-                page->show();
+                        item->setText(0,a->getName());
+                        item->setPixmap(0, (a->getScope() == Uml::Public ? m_pixmaps.Public :
+                                        (a->getScope() == Uml::Protected ? m_pixmaps.Protected :
+                                        m_pixmaps.Private)));
+                }
         }
-        
 }
 






More information about the umbrello-devel mailing list