[Uml-devel] kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Fri Jul 9 14:43:15 UTC 2004


CVS commit by okellogg: 

Resolve bug 84549: Allow dragging an Actor (from the list view) into a
 sequence diagram.


  M +9 -0      floatingtext.cpp   1.51
  M +0 -4      messagewidget.cpp   1.38
  M +7 -2      umlview.cpp   1.151


--- kdesdk/umbrello/umbrello/floatingtext.cpp  #1.50:1.51
@@ -165,4 +165,13 @@ void FloatingText::slotMenuSelection(int
                         }
                         UMLClassifier* c = m_pLink->getOperationOwner(this);
+                        if (c == NULL) {
+                                bool ok = false;
+                                QString opText = KInputDialog::getText(i18n("Name"),
+                                                                       i18n("Enter operation name:"),
+                                                                       getText(), &ok, m_pView);
+                                if (ok)
+                                        m_pLink->setOperationText(this, opText);
+                                return;
+                        }
                         UMLObject* umlObj = m_pView->getDocument()->createChildObject(c, Uml::ot_Operation);
                         if (umlObj) {

--- kdesdk/umbrello/umbrello/messagewidget.cpp  #1.37:1.38
@@ -370,8 +370,4 @@ UMLClassifier *MessageWidget::getOperati
                 return NULL;
         UMLClassifier *c = dynamic_cast<UMLClassifier*>(pObject);
-        if (c == NULL)
-                kdError() << "MessageWidget::getOperationOwner: "
-                          << "ft->getUMLObject() is not a classifier"
-                          << endl;
         return c;
 }

--- kdesdk/umbrello/umbrello/umlview.cpp  #1.150:1.151
@@ -417,4 +417,9 @@ void UMLView::slotObjectCreated(UMLObjec
         UMLWidget* newWidget = 0;
         if(type == ot_Actor) {
+                if (getType() == dt_Sequence) {
+                        ObjectWidget *ow = new ObjectWidget(this, o, getLocalID() );
+                        ow->setDrawAsActor(true);
+                        newWidget = ow;
+                } else
                 newWidget = new ActorWidget(this, static_cast<UMLActor*>(o));
         } else if(type == ot_UseCase) {
@@ -559,5 +564,5 @@ void UMLView::contentsDragEnterEvent(QDr
         }
         if((diagramType == dt_Sequence || diagramType == dt_Collaboration) &&
-           ot != ot_Class ) {
+           ot != ot_Class && ot != ot_Actor) {
                 e->accept(false);
                 return;






More information about the umbrello-devel mailing list