Bug 53376 - Messages should refer to operations (currently just strings)
Summary: Messages should refer to operations (currently just strings)
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Oliver Kellogg
URL:
Keywords:
: 84515 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-01-24 19:29 UTC by Jonathan Riddell
Modified: 2005-03-17 08:07 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Riddell 2003-01-24 19:29:09 UTC
Version:            (using KDE Devel)
Compiler:          gcc 2.95 
OS:          Linux

Sequence diagram messages are just strings, even when created by selecting a class method (operation).  They should be pointers to the operations and be updated the operation.
Comment 1 Jonathan Riddell 2004-01-19 17:28:33 UTC
As pointed out in beastie 72627 method parameters and attributes could also be references to classes in the model so their names are kept up to date too.

Comment 2 Jonathan Riddell 2004-01-19 17:30:11 UTC
*** Bug 72627 has been marked as a duplicate of this bug. ***
Comment 3 Oliver Kellogg 2005-03-10 21:54:04 UTC
*** Bug 84515 has been marked as a duplicate of this bug. ***
Comment 4 Oliver Kellogg 2005-03-14 23:58:11 UTC
My pleasure to squash this one...
Comment 5 Oliver Kellogg 2005-03-16 07:53:00 UTC
CVS commit by okellogg: 

Add infrastructure required for a sequence or collaboration message
which is an operation of a classifier to reference the respective
UMLOperation rather than being dumb text.
CCBUG:53376


  M +6 -2      associationwidget.cpp   1.142
  M +9 -2      associationwidget.h   1.60
  M +3 -9      floatingtext.cpp   1.69
  M +27 -21    linkwidget.cpp   1.11
  M +38 -8     linkwidget.h   1.12
  M +45 -11    messagewidget.cpp   1.63
  M +10 -3     messagewidget.h   1.31
Comment 6 Oliver Kellogg 2005-03-17 08:07:22 UTC
CVS commit by okellogg: 

showOpDlg(): Hook up with the infrastructure around LinkWidget::m_pOperation.
BUG:53376


  M +20 -5     floatingtext.cpp   1.70


--- kdesdk/umbrello/umbrello/floatingtext.cpp  #1.69:1.70
@@ -28,4 +28,5 @@
 #include "listpopupmenu.h"
 #include "operation.h"
+#include "model_utils.h"
 #include "inputdialog.h"
 #include "dialogs/assocpropdlg.h"
@@ -249,6 +250,6 @@ void FloatingText::showOpDlg() {
                 return;
         }
-        QString seqNum, op;
-        UMLClassifier* c = m_pLink->getSeqNumAndOp(this, seqNum, op);
+        QString seqNum, opText;
+        UMLClassifier* c = m_pLink->getSeqNumAndOp(this, seqNum, opText);
         if (c == NULL) {
                 kdError() << "FloatingText::showOpDlg: "
@@ -260,5 +261,6 @@ void FloatingText::showOpDlg() {
         SelectOpDlg selectDlg(m_pView, c);
         selectDlg.setSeqNumber( seqNum );
-        selectDlg.setCustomOp( op );
+        if (m_pLink->getOperation() == NULL)
+                selectDlg.setCustomOp( opText );
         int result = selectDlg.exec();
         if(!result) {
@@ -266,6 +268,19 @@ void FloatingText::showOpDlg() {
         }
         seqNum = selectDlg.getSeqNumber();
-        op = selectDlg.getOpText();
-        m_pLink->setSeqNumAndOp(seqNum, op);
+        opText = selectDlg.getOpText();
+        Umbrello::OpDescriptor od;
+        Umbrello::Parse_Status st = Umbrello::parseOperation(opText, od, c);
+        if (st == Umbrello::PS_OK) {
+                UMLDoc *umldoc = UMLApp::app()->getDocument();
+                bool isExistingOp = false;
+                UMLObject *o = umldoc->createOperation(c, od.m_name, &isExistingOp, &od.m_args);
+                UMLOperation *op = static_cast<UMLOperation*>(o);
+                if (od.m_pReturnType) {
+                        op->setType(od.m_pReturnType);
+                }
+                m_pLink->setOperation(op);
+                opText = QString::null;
+        }
+        m_pLink->setSeqNumAndOp(seqNum, opText);
         setMessageText();
 }